Hello.
I have problems to find and write the correct function in my new indicator. I want it to give me a signal when an indicator has been under a certain value a certain days in a row.
For example:
When RSI[4] has been < 20 the last four days. Is this possible to do? I would be very glad if there is someone here that could help me.
Thanks a lot!
/Christian
WingParticipant
Veteran
If you are using for example the daily timeframe:
MyInd=rsi[4](close)
if MyInd[0]<20 and MyInd[1]<20 and MyInd[2]<20 and MyInd[3]<20 then
....
endif
I suggest a different approach:
MyInd=rsi[4](close)
if summation[10](MyInd < 20) = 10 then
....
endif
In this case 10 periods are scanned and tested if they are consecutive (10 periods aginst constant 10).