Hi,
I am stage “begins” in programming search engines in your excellent software.
I wanted to ask, is it possible to ask for such conditions, for example –
Before 30 bars – for 30 bars, the indicator was less than the “X”?
If so, how do you write it?
Now I know that you can ask, for example – before 30 candles – the indicator was less than the “X”
But I do not know how to ask for it automatically for several days.
Hi balance,
To do this we have to make a loop in the past to test if your indicator were effectively under the “X” value.
In this example i’m testing if the RSI over the last 30 bars were below the 50 level:
count = 0
myRSI = RSI[14](close)
for i = 0 to 30 do
if myRSI[i]<50 then
count=count+1
endif
next
if count=30 then
result = 1
else
result = 0
endif
I coded this in the forum, haven’t test it, please gimme feedback if it works .. or not 🙂