Close trade only if condition is recurring
-
Hey Guys,
Looking for some guidance. I am trying to figure out the best way to build a condition, that will close a previous trade and open a new one, only if the conditions recurring are not the same ones that originally occurred.
Thanks
-
@zaccroft
Hey you could add a variable, which increases by 1 every time one of both conditions occurs, and when the value of one is above the one that made you take the last trade, close positions, SELL now. -
Hey thanks for the response @seb-0
The problem is that if I set it, to check the condition say once a tick (or even once an hour), it will see the old condition and it will proceed to close the open position to re-open a new one, leaving it in an infinite loop of closing/re-opening since condition 1 = condition 1.
I want it to have the ability to ignore the first position, unless a new instance of that conditions occurs.
-
@zaccroft does the block "no trade" solve your problem?
Or if its a above/below condition, switch to "cross above" / "cross below"