I am writing a code for a dynamic stoploss as attached. However, upon entry, the stoploss is wrongly set at the entry price. This results in the position being closed immediately.
My original intention is to enter a stoploss that will only be removed after I close my position. Is there any way to rectifiy this problem?

Comment