@@ -119,8 +119,8 @@ def calculate_phi(prices, k, S0):
:param S0: 初始价格
:return: φ(k, ξ) 的值
"""
- price_changes = np.array(prices) - S0
- exponentials = np.exp(k * price_changes)
+ price_changes_pct = (np.array(prices) - S0) / np.array(prices)
+ exponentials = np.exp(k * price_changes_pct)
phi = np.mean(exponentials)
return phi
@@ -9,7 +9,7 @@ from logger_config import logger
from data_processing import on_message, stop_event
# Gate.io WebSocket API URL
-SYMBOL = "ETH_USDT"
+SYMBOL = "BTC_USDT"
SOCKET_TRADE = "wss://fx-ws.gateio.ws/v4/ws/usdt"
# 订阅消息格式