I have a strategy which sometimes gives me an error. It ignores closing the trade even if close condition is valid or it entirely ignores trade entry order. I'd like to attach here parts of the code which may cause the issue. Strategy works only in one direction based on choice, meaning that it takes only shorts or only longs depending on selection, never at the same time.
In attached picture of chart, short entry had to be stopped where red dotted line is drawn but trade is never closed.
Any help would be appreciated.
Comment