Hi I ran into a problem with coding. Hopefully someone has an answer for it.
detector is always -1 or 1
previous intraday has a short position based on detector -1.
It has stops attached.
I cancel the order in the evening to make changes.
At the opening because detector is still -1 it enters immediately short with different stops.
If I take profit/loss on a position it supposed to re-enter based on detector.
if not shortonmarket and detector = -1 and (detector[1] = 0 or detector[1] = 1) then
Only, I want to skip the first entry when a system goes active. Then have always a position based on the next opposite detector 1 or -1.
Is there a solution for this?
Thanks,
Paul