|
@@ -256,7 +256,7 @@ class HyperliquidClient:
|
|
return None
|
|
return None
|
|
|
|
|
|
def get_market_data(self, symbol: str) -> Optional[Dict[str, Any]]:
|
|
def get_market_data(self, symbol: str) -> Optional[Dict[str, Any]]:
|
|
- """Get market data for a symbol."""
|
|
|
|
|
|
+ """Get market data for a symbol, including OHLCV for high/low."""
|
|
try:
|
|
try:
|
|
if not self.sync_client:
|
|
if not self.sync_client:
|
|
logger.error("❌ Client not initialized")
|
|
logger.error("❌ Client not initialized")
|
|
@@ -265,6 +265,15 @@ class HyperliquidClient:
|
|
ticker = self.sync_client.fetch_ticker(symbol)
|
|
ticker = self.sync_client.fetch_ticker(symbol)
|
|
orderbook = self.sync_client.fetch_order_book(symbol)
|
|
orderbook = self.sync_client.fetch_order_book(symbol)
|
|
|
|
|
|
|
|
+ # Fetch last 24h OHLCV data to get accurate high/low
|
|
|
|
+ ohlcv = self.sync_client.fetch_ohlcv(symbol, '1d', limit=1)
|
|
|
|
+
|
|
|
|
+ if ohlcv:
|
|
|
|
+ # CCXT OHLCV format: [timestamp, open, high, low, close, volume]
|
|
|
|
+ last_day_candle = ohlcv[0]
|
|
|
|
+ ticker['high'] = last_day_candle[2]
|
|
|
|
+ ticker['low'] = last_day_candle[3]
|
|
|
|
+
|
|
market_data = {
|
|
market_data = {
|
|
'ticker': ticker,
|
|
'ticker': ticker,
|
|
'orderbook': orderbook,
|
|
'orderbook': orderbook,
|