For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
Take Profit-Stoploss and Log the result
-
Hey everyone!
Finally sign up to the community got fixed and I can ask this! HahaFrom this topic take profit- stop loss I learned to set profit and stoploss when taking a LONG trade. However, should the Order change when taking a SHORT trade?
if conditions and not self.position: self.long_buy_order = self.buy_bracket( data=self.datas[0], size=1, exectype=bt.Order.Limit, # Stop? plimit=price, stopprice=price_stoploss, stopexec=bt.Order.Stop, # Limit? limitprice=price_target, limitexec=bt.Order.Limit, # Stop? )
Plus, is there a way to LOG the result of the trade?
I wanna train a supervised ML model and I would need to know if the trade filled the target or the stoploss.
Many thanks in advance!