strategy trade counter, gui shortcuts, better log

This commit is contained in:
David Brazda
2023-04-23 17:43:27 +02:00
parent a6e0ac987a
commit 83a7bb77da
16 changed files with 112 additions and 39 deletions

View File

@ -222,12 +222,13 @@ def save_history(id: UUID, st: object, runner: Runner, reason: str = None):
#zkousime precist profit z objektu
try:
profit = st.state.profit
trade_count = len(st.tradeList)
except Exception as e:
profit = str(e)
for i in db.stratins:
if str(i.id) == str(id):
i.history += "START:"+str(runner.run_started)+"STOP:"+str(runner.run_stopped)+"ACC:"+runner.run_account.value+"M:"+runner.run_mode.value+"PROFIT:"+str(profit)+ "REASON:" + str(reason)
i.history += "START:"+str(runner.run_started)+"STOP:"+str(runner.run_stopped)+"ACC:"+runner.run_account.value+"M:"+runner.run_mode.value+"PROFIT:"+str(round(profit,2))+ "TradeCNT:"+str(trade_count) + "REASON:" + str(reason)
#i.history += str(runner.__dict__)+"<BR>"
db.save()