cross rsi problem

 

hello all.

excuse me for my english...

i'm newbie to mql4. please help me.

i am writing an indicator. i want when i atach it to chart, it check for cross fast rsi and slow rsi,

if rsi crossed in less than 5 candle before, it comments that,

e.g : 4 candle before rsi crossed

is there anybody help me?

 
maniac1984:
i am writing an indicator. i want when i atach it to chart, it check for cross fast rsi and slow rsi,

if rsi crossed in less than 5 candle before, it comments that,
for (int iBar = limit; iBar >=0; iBar--){
    rsiFast[iBar] = ..
    rsiSlow[iBar] = ..
    for (int iPrev = iBar+4; iPrev > iBar; iPrev--) if(
    (rsiFast[iBar]-rsiSlow[iBar]) * (rsiFast[iPrev]-rsiSlow[iPrev]) < 0
    ){
        :   // rsi's crossed at iPrev
        break;
    }
}
 
thanks a lot for help WHReader
Reason: