Trace max float profit of long/short order before it's closed
hi all, I want to trace the max float profit of a long/short order since it's completed until it is closed. As long order for example, the long order is created as mainside, and there are lowside sell StopTrail order and highside sell Limit order. How can I trace the float profit history of the long order. And the float profit =(current_bar_price - executed_price) x executed_size. I need a clean and elegant manner to realize it. Thx!
if long_signal: if self.position.size < 0: self.order = self.close() else: mainside = self.buy(size = default_size,transmit=False) lowside = self.sell(size=lowside_sell_size,exectype=bt.Order.StopTrail,transmit=False, parent=mainside,trailpercent=0.05) highside = self.sell(price=highside_sell_price, size=highside_sell_size, exectype=bt.Order.Limit, transmit=True, parent=mainside)
Elis Moer last edited by
Nurse shoes should be chosen based on the type of work that you do and your physical condition. For example, nurses performing intensive physical tasks may need stiffer shoes with more support than normal office-based nurses.