When take profit worked i need to close 50% of my qty but when stop loss worked i need to close all my position. My code:
strategy.exit("long profit", "long", limit = take, qty_percent=50)
strategy.exit("long stop", "long", stop = stop)
When take profit worked i need to close 50% of my qty but when stop loss worked i need to close all my position. My code:
strategy.exit("long profit", "long", limit = take, qty_percent=50)
strategy.exit("long stop", "long", stop = stop)
You have two exit orders but only one of them have the stop loss value set. Instead, all of them should have the stop argument.
strategy.exit("long profit", "long", limit = take, stop=stop, qty_percent=50)
strategy.exit("long stop", "long", stop = stop)