Indentifying a new RSI high or low price

 

Hi

I have an EA that identifies when the price has made a new high or low, here is the basic code for this:

  hi_lo[0] = MathMax(
    (MathMax(iClose(Symbol(),Period(),iHighest(Symbol(),Period(),MODE_OPEN,bar,end)),
            iOpen(Symbol(),Period(),iHighest(Symbol(),Period(),MODE_OPEN,bar,end)))),
    (MathMax(iClose(Symbol(),Period(),iHighest(Symbol(),Period(),MODE_CLOSE,bar,end)),
            iOpen(Symbol(),Period(),iHighest(Symbol(),Period(),MODE_CLOSE,bar,end)))));
   hi_lo[1] = MathMin(
    (MathMin(iClose(Symbol(),Period(),iLowest(Symbol(),Period(),MODE_OPEN,bar,end)),
            iOpen(Symbol(),Period(),iLowest(Symbol(),Period(),MODE_OPEN,bar,end)))),
    (MathMin(iClose(Symbol(),Period(),iLowest(Symbol(),Period(),MODE_CLOSE,bar,end)),
            iOpen(Symbol(),Period(),iLowest(Symbol(),Period(),MODE_CLOSE,bar,end)))));

At the same time I would like to check that the RSI has also made a new high or low, please note I have all the variables setup the above is just a snippet from a function of my EA.

With the following, am I on the right track:

   hi_lo_rsi[0] = MathMax(iRSI(Symbol(),Period(),theRsiPeriod,0,shift));
   hi_lo_rsi[1] = MathMin(iRSI(Symbol(),Period(),theRsiPeriod,0,shift));

I am new to coding so sorry if my attemplts look rubbish...

Thanks

Antony

 

Or would this be the correct way:

Dont worry about the bar and end inputs as these are to do with the session times, these are worked just before, it more of the command for looking at the highest RSI value in that session:

hi_lo_rsi[0] = iHighest(Symbol(),Period(),iRSI,bar,end)
   hi_lo_rsi[1] = iLowest(Symbol(),Period(),iRSI,bar,end)
 

I have researched this, but the times are already worked in my EA for actaul price high low function:

double Rsi_high_low;
//~~~~~~~~~~
for(int i=0;i<Bars;i++){
    double Highest_RSI_ofDay;
    if(Time[i]>=iTime(NULL,PERIOD_D1,0)){
        if(iRSI(NULL,0,14,PRICE_CLOSE,i)>Highest_RSI_ofDay){
            Highest_RSI_ofDay=iRSI(NULL,0,14,PRICE_CLOSE,i);
    }}else{break;}

//~~~~~~~~~~
Alert(Highest_RSI_ofDay);
//~~~~~~~~~~
return(Highest_RSI_ofDay);}

return(0);}

Would it be something like this:

Basically I ma just looking for a peice of code that will tell me the highest RSI value, times values are already set so there is no problem for this, I am just trying translate the highest RSI value for the day.

double Rsi_high_low;


    double Highest_RSI_ofDay;
   
        if(iRSI(NULL,0,14,PRICE_CLOSE,bar,end)>Highest_RSI_ofDay){
            Highest_RSI_ofDay=iRSI(NULL,0,14,PRICE_CLOSE,bar,end);
    }}else{break;}


return(Highest_RSI_ofDay);}

return(0);}
 

Hi

I dont know if I have been clear enough but I am not asking for help with the timings etc just the acutal code to identify highest/lowest RSI values.

I know this is the value for the price, candle main body (close and open):

  hi_lo[0] = MathMax(
    (MathMax(iClose(Symbol(),Period(),iHighest(Symbol(),Period(),MODE_OPEN,bar,end)),
            iOpen(Symbol(),Period(),iHighest(Symbol(),Period(),MODE_OPEN,bar,end)))),
    (MathMax(iClose(Symbol(),Period(),iHighest(Symbol(),Period(),MODE_CLOSE,bar,end)),
            iOpen(Symbol(),Period(),iHighest(Symbol(),Period(),MODE_CLOSE,bar,end)))));
   hi_lo[1] = MathMin(
    (MathMin(iClose(Symbol(),Period(),iLowest(Symbol(),Period(),MODE_OPEN,bar,end)),
            iOpen(Symbol(),Period(),iLowest(Symbol(),Period(),MODE_OPEN,bar,end)))),
    (MathMin(iClose(Symbol(),Period(),iLowest(Symbol(),Period(),MODE_CLOSE,bar,end)),
            iOpen(Symbol(),Period(),iLowest(Symbol(),Period(),MODE_CLOSE,bar,end)))));

My problem is I need to figure out the code needed to do the same but with the RSI value.

Thanks

Antony

Reason: