Info and log fixes
This commit is contained in:
@ -25,7 +25,7 @@ def getPnL(pair):
|
|||||||
|
|
||||||
strategyStartTime = None
|
strategyStartTime = None
|
||||||
for timestamp, message in logEntries:
|
for timestamp, message in logEntries:
|
||||||
if message == f"Starting strategy with {pair}":
|
if message == (f"Starting strategy with {pair}"):
|
||||||
strategyStartTime = timestamp
|
strategyStartTime = timestamp
|
||||||
|
|
||||||
if not strategyStartTime:
|
if not strategyStartTime:
|
||||||
|
|||||||
@ -210,11 +210,13 @@ class tradingData:
|
|||||||
j['long'] = False
|
j['long'] = False
|
||||||
j['longIDs'] = ['-1', '-1', '-1']
|
j['longIDs'] = ['-1', '-1', '-1']
|
||||||
generalLogger.info(f"Long order on {self.pair} level {j['price']} triggered TP/SL")
|
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
|
self.orderCounter -= 1
|
||||||
if orderID in shortIDs:
|
if orderID in shortIDs:
|
||||||
j['short'] = False
|
j['short'] = False
|
||||||
j['shortIDs'] = ['-1', '-1', '-1']
|
j['shortIDs'] = ['-1', '-1', '-1']
|
||||||
generalLogger.info(f"Short order on {self.pair} level {j['price']} triggered TP/SL")
|
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
|
self.orderCounter -= 1
|
||||||
if orderStatus == 'Filled':
|
if orderStatus == 'Filled':
|
||||||
for j in self.levels:
|
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']}")
|
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']}")
|
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:
|
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']}")
|
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):
|
async def strategy(pair: str, params):
|
||||||
generalLogger.info('Starting strategy with ' + pair)
|
generalLogger.info('Starting strategy with ' + pair)
|
||||||
|
tradingLogger.info('Starting strategy with ' + pair)
|
||||||
|
|
||||||
paramsDict = await jsonProcessing.parseParams(params)
|
paramsDict = await jsonProcessing.parseParams(params)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user