PaulParticipant
Master
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
Hi Paul, in order to help you with speed and efficiency, I suggest you to post your code, thank you.
PaulParticipant
Master
I found that the easiest solution is the best.
Just close at end of day. That’s preferable.
Besides use a extra indicator to create a signal so it doesn’t enter at the opening.
I posted the code in the strategies as it looks interesting.