Hi,
i would like to set an exit signal after N times that an oscillator (rsi,stochastic, etc), cross the zero level, and setting the exit to a maximum or minimum of said oscillator.
Is it possible to do on proreal?
thank you for the reply, best regards
Yes sure, that kind of code should be ok to exit an order N bars after the RSI has crosses down the level 50 and now below 30.
N = 10
i = rsi[14]
if i crosses under 50 then
start=barindex
endif
if longonmarket and barindex-start>=N and i<30 then
sell at market
endif
(not tested).
Hi,
i’m express myself bad. What i need is like this example. I got an enter signal from a cross, and then, i wanna put my exit signal equal to point 3 of my momentum indicator.
Ok, but all I can see from your example is numbers on a chart, how do you expect I understand something from this? Why are there points 1,2 and 3? Are they necessary in your exit conditions or not?
I think what he means is that “if the oscillator crosses over “0” for the 3rd time, then sell/exit”.
If long/short on market then:
if oscillator crosses over for the 3rd time: Sell