skyffire 1 жил өмнө
parent
commit
6264529969

+ 2 - 2
kappa/data_processing.py

@@ -197,7 +197,7 @@ def calculate_sigma_squared(prices, timestamps):
         return 0.0
         return 0.0
 
 
     time_diff = int(int((timestamps[-1] - timestamps[0]).total_seconds() * 1000) / 100)
     time_diff = int(int((timestamps[-1] - timestamps[0]).total_seconds() * 1000) / 100)
-    price_diff_squared = [(prices[i] - prices[i - 1]) ** 2 for i in range(1, n)]
+    price_diff_squared = [(1 - prices[i] / prices[i - 1]) ** 2 for i in range(1, n)]
     sigma_squared = np.sum(price_diff_squared) / time_diff
     sigma_squared = np.sum(price_diff_squared) / time_diff
 
 
     return sigma_squared
     return sigma_squared
@@ -258,7 +258,7 @@ def process_depth_data():
     sigma_squared = calculate_sigma_squared(S_values, order_book_timestamps)
     sigma_squared = calculate_sigma_squared(S_values, order_book_timestamps)
 
 
     # ========================== 计算 δ^a + δ^b ==========================
     # ========================== 计算 δ^a + δ^b ==========================
-    gamma = 0.5
+    gamma = 1
     T_minus_t = 1.0
     T_minus_t = 1.0
     delta_sum = calculate_delta_sum(gamma, sigma_squared, T_minus_t, k_initial)
     delta_sum = calculate_delta_sum(gamma, sigma_squared, T_minus_t, k_initial)
     logger.info(f"δ^a + δ^b: {delta_sum}")
     logger.info(f"δ^a + δ^b: {delta_sum}")

+ 1 - 1
kappa/ws_client.py

@@ -9,7 +9,7 @@ from logger_config import logger
 from data_processing import on_message, stop_event
 from data_processing import on_message, stop_event
 
 
 # Gate.io WebSocket API URL
 # Gate.io WebSocket API URL
-SYMBOL = "SATS_USDT"
+SYMBOL = "ETH_USDT"
 SOCKET_TRADE = "wss://fx-ws.gateio.ws/v4/ws/usdt"
 SOCKET_TRADE = "wss://fx-ws.gateio.ws/v4/ws/usdt"
 
 
 # 订阅消息格式
 # 订阅消息格式