This commit is contained in:
David Brazda
2023-04-21 17:13:00 +02:00
parent 6dce04c937
commit 7d02442d4d
2 changed files with 2 additions and 2 deletions

View File

@ -311,7 +311,7 @@ def next(data, state: StrategyState):
#HLAVNI ITERACNI LOG JESTE PRED AKCI - obsahuje aktualni hodnoty vetsiny parametru
lp = state.interface.get_last_price(symbol=state.symbol)
state.ilog(e="ENTRY", msg="AVGP:"+str(round(state.avgp,2))+ "POS:" +str(state.positions)+" PROFIT:"+str(round(state.profit,2)), last_price=lp, stratvars=state.vars)
state.ilog(e="ENTRY", msg="AVGP:"+str(round(float(state.avgp),2))+ "POS:" +str(state.positions)+" PROFIT:"+str(round(float(state.profit),2)), last_price=lp, stratvars=state.vars)
#maxSlopeMA = -0.03
#SLOPE ANGLE PROTECTIONs

View File

@ -77,7 +77,7 @@ class StrategyOrderLimitVykladaci(Strategy):
avg_costs = float(self.state.avgp) * float(data.qty)
trade_profit = (sold_amount - avg_costs)
self.state.profit += trade_profit
self.state.ilog(e="SELL not - PROFIT: "+str(round(trade_profit,3))+" celkem: "+str(round(self.state.profit,3)), msg=str(data.event), sold_amount=sold_amount, avg_costs=avg_costs, trade_qty=data.qty, trade_price=data.price, orderid=str(data.order.id))
self.state.ilog(e="SELL not - PROFIT: "+str(round(float(trade_profit),3))+" celkem: "+str(round(float(self.state.profit),3)), msg=str(data.event), sold_amount=sold_amount, avg_costs=avg_costs, trade_qty=data.qty, trade_price=data.price, orderid=str(data.order.id))
if data.event == TradeEvent.PARTIAL_FILL:
self.state.ilog(e="SELL notifikace - Partial fill", msg="pouze update pozic", orderid=str(data.order.id))