Info and log fixes

This commit is contained in:
2025-05-26 11:20:39 +03:00
parent 54781cb2f2
commit 6f2123d589
2 changed files with 5 additions and 1 deletions

View File

@ -25,7 +25,7 @@ def getPnL(pair):
strategyStartTime = None
for timestamp, message in logEntries:
if message == f"Starting strategy with {pair}":
if message == (f"Starting strategy with {pair}"):
strategyStartTime = timestamp
if not strategyStartTime:

View File

@ -210,11 +210,13 @@ class tradingData:
j['long'] = False
j['longIDs'] = ['-1', '-1', '-1']
generalLogger.info(f"Long order on {self.pair} level {j['price']} triggered TP/SL")
tradingLogger.info(f"Long order on {self.pair} level {j['price']} triggered TP/SL")
self.orderCounter -= 1
if orderID in shortIDs:
j['short'] = False
j['shortIDs'] = ['-1', '-1', '-1']
generalLogger.info(f"Short order on {self.pair} level {j['price']} triggered TP/SL")
tradingLogger.info(f"Short order on {self.pair} level {j['price']} triggered TP/SL")
self.orderCounter -= 1
if orderStatus == 'Filled':
for j in self.levels:
@ -224,6 +226,7 @@ class tradingData:
generalLogger.info(f"Long order on {self.pair} level {j['price']} filled with P&L {i['closedPnl']} and qty {i['qty']}")
tradingLogger.info(f"Long order on {self.pair} level {j['price']} filled with P&L {i['closedPnl']} and qty {i['qty']}")
if orderID in shortIDs:
generalLogger.info(f"Short order on {self.pair} level {j['price']} filled with P&L {i['closedPnl']} and qty {i['qty']}")
tradingLogger.info(f"Short order on {self.pair} level {j['price']} filled with P&L {i['closedPnl']} and qty {i['qty']}")
@ -247,6 +250,7 @@ async def getClient(apiKey, apiSecret, testnet, demoTrading):
async def strategy(pair: str, params):
generalLogger.info('Starting strategy with ' + pair)
tradingLogger.info('Starting strategy with ' + pair)
paramsDict = await jsonProcessing.parseParams(params)