fix: use BTC for DB queries and BTCUSDT for Bybit API (v1.3.1)
This commit is contained in:
@ -68,7 +68,7 @@ class DatabaseManager:
|
||||
|
||||
class PingPongBot:
|
||||
def __init__(self, config_path="config/ping_pong_config.yaml"):
|
||||
self.version = "1.3.0"
|
||||
self.version = "1.3.1"
|
||||
with open(config_path, 'r') as f:
|
||||
self.config = yaml.safe_load(f)
|
||||
|
||||
@ -86,7 +86,8 @@ class PingPongBot:
|
||||
|
||||
self.db = DatabaseManager()
|
||||
|
||||
self.symbol = self.config['symbol']
|
||||
self.symbol = self.config['symbol'].upper() # e.g. BTCUSDT
|
||||
self.db_symbol = self.symbol.replace("USDT", "") # e.g. BTC
|
||||
self.interval = str(self.config['interval'])
|
||||
self.direction = self.config['direction'].lower()
|
||||
|
||||
@ -256,7 +257,7 @@ class PingPongBot:
|
||||
last_exchange_update = now
|
||||
|
||||
# 2. DB Sync (5s)
|
||||
candles = await self.db.get_candles(self.symbol, self.interval, limit=100)
|
||||
candles = await self.db.get_candles(self.db_symbol, self.interval, limit=100)
|
||||
if candles:
|
||||
latest = candles[0]
|
||||
if latest['time'] != self.last_candle_time:
|
||||
|
||||
Reference in New Issue
Block a user