Symbol & data refactoring for Nautilus
This commit is contained in:
@@ -29,7 +29,7 @@ This will:
|
||||
### Expected Flow
|
||||
|
||||
1. **Client** sends OHLCRequest to Flink (REQ/REP)
|
||||
- Ticker: `BINANCE:BTC/USDT`
|
||||
- Ticker: `BTC/USDT.BINANCE`
|
||||
- Period: 3600s (1 hour)
|
||||
- Range: Jan 1-7, 2026
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ python client.py
|
||||
## What it does
|
||||
|
||||
1. Connects to Flink's client request endpoint (REQ/REP on port 5559)
|
||||
2. Requests 1-hour OHLC candles for BINANCE:BTC/USDT
|
||||
2. Requests 1-hour OHLC candles for BTC/USDT.BINANCE
|
||||
3. Time range: January 1-7, 2026 (168 candles)
|
||||
4. Waits for Flink to respond (up to 30 seconds)
|
||||
5. Displays the response status and sample data
|
||||
|
||||
@@ -32,7 +32,7 @@ class HistoryClient:
|
||||
Request historical OHLC data via Relay.
|
||||
|
||||
Args:
|
||||
ticker: Market identifier (e.g., "BINANCE:BTC/USDT")
|
||||
ticker: Market identifier (e.g., "BTC/USDT.BINANCE")
|
||||
start_time: Start timestamp in microseconds since epoch
|
||||
end_time: End timestamp in microseconds since epoch
|
||||
period_seconds: OHLC period in seconds (e.g., 3600 for 1h)
|
||||
@@ -161,7 +161,7 @@ def main():
|
||||
# Connect to Relay
|
||||
client.connect()
|
||||
|
||||
# Request BINANCE:BTC/USDT 1h candles for first 7 days of January 2026
|
||||
# Request BTC/USDT.BINANCE 1h candles for first 7 days of January 2026
|
||||
# January 1, 2026 00:00:00 UTC = 1735689600 seconds = 1735689600000000 microseconds
|
||||
# January 7, 2026 23:59:59 UTC = 1736294399 seconds = 1736294399000000 microseconds
|
||||
|
||||
@@ -169,7 +169,7 @@ def main():
|
||||
end_time_us = 1736294399 * 1_000_000 # Jan 7, 2026 23:59:59 UTC
|
||||
|
||||
response = client.request_historical_ohlc(
|
||||
ticker='BINANCE:BTC/USDT',
|
||||
ticker='BTC/USDT.BINANCE',
|
||||
start_time=start_time_us,
|
||||
end_time=end_time_us,
|
||||
period_seconds=3600, # 1 hour
|
||||
|
||||
@@ -56,7 +56,7 @@ class AsyncHistoryClient:
|
||||
3. Query Iceberg with the table information (or notification includes data)
|
||||
|
||||
Args:
|
||||
ticker: Market identifier (e.g., "BINANCE:BTC/USDT")
|
||||
ticker: Market identifier (e.g., "BTC/USDT.BINANCE")
|
||||
start_time: Start timestamp in microseconds since epoch
|
||||
end_time: End timestamp in microseconds since epoch
|
||||
period_seconds: OHLC period in seconds (e.g., 3600 for 1h)
|
||||
@@ -263,12 +263,12 @@ def main():
|
||||
# Connect
|
||||
client.connect()
|
||||
|
||||
# Request BINANCE:BTC/USDT 1h candles for first 7 days of January 2026
|
||||
# Request BTC/USDT.BINANCE 1h candles for first 7 days of January 2026
|
||||
start_time_us = 1735689600 * 1_000_000 # Jan 1, 2026 00:00:00 UTC
|
||||
end_time_us = 1736294399 * 1_000_000 # Jan 7, 2026 23:59:59 UTC
|
||||
|
||||
notification = client.request_historical_ohlc(
|
||||
ticker='BINANCE:BTC/USDT',
|
||||
ticker='BTC/USDT.BINANCE',
|
||||
start_time=start_time_us,
|
||||
end_time=end_time_us,
|
||||
period_seconds=3600, # 1 hour
|
||||
|
||||
@@ -39,7 +39,7 @@ async def main():
|
||||
print("✅ Client started\n")
|
||||
|
||||
# Request parameters
|
||||
ticker = "BINANCE:BTC/USDT"
|
||||
ticker = "BTC/USDT.BINANCE"
|
||||
period_seconds = 3600 # 1-hour candles
|
||||
|
||||
# Request 7 days of data (Jan 1-7, 2026)
|
||||
|
||||
Reference in New Issue
Block a user