how to calc indirect RSI ???

 

hi friends 

 Im working on my custom indicator but Im having probleme getting the RSI for JPY/USD

i can get only get the USD/JPY's RSI

so, how to calc it ?? 

 best regards 

 

According to the documentation here on the site <https://www.metatrader5.com/en/terminal/help/indicators/oscillators/rsi>, the RSI is calculated as follows:

RSI = 100-(100/(1+U/D))
So, just reverse it!
 
FMIC:

According to the documentation here on the site <https://www.metatrader5.com/en/terminal/help/indicators/oscillators/rsi>, the RSI is calculated as follows:

So, just reverse it!

Im good good enough to that calc but look at this code

//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+

   int counted_bars=IndicatorCounted();
   for(int i=0;i<Bars;i++)
   {  
      double usdi = (iRSI("USDGBP",0,RSIperiod,PRICE_CLOSE,i)+iRSI("USDEUR",0,RSIperiod,PRICE_CLOSE,i)+iRSI("USDCNY",0,RSIperiod,PRICE_CLOSE,i)+iRSI("USDJPY",0,RSIperiod,PRICE_CLOSE,i)+iRSI("USDAUD",0,RSIperiod,PRICE_CLOSE,i))/5;
      double gbpi = (iRSI("GBPUSD",0,RSIperiod,PRICE_CLOSE,i)+iRSI("GBPEUR",0,RSIperiod,PRICE_CLOSE,i)+iRSI("GBPCNY",0,RSIperiod,PRICE_CLOSE,i)+iRSI("GBPJPY",0,RSIperiod,PRICE_CLOSE,i)+iRSI("GBPAUD",0,RSIperiod,PRICE_CLOSE,i))/5;
      double euri = (iRSI("EURGBP",0,RSIperiod,PRICE_CLOSE,i)+iRSI("EURUSD",0,RSIperiod,PRICE_CLOSE,i)+iRSI("EURCNY",0,RSIperiod,PRICE_CLOSE,i)+iRSI("EURJPY",0,RSIperiod,PRICE_CLOSE,i)+iRSI("EURAUD",0,RSIperiod,PRICE_CLOSE,i))/5;
      double cnyi = (iRSI("CNYGBP",0,RSIperiod,PRICE_CLOSE,i)+iRSI("CNYEUR",0,RSIperiod,PRICE_CLOSE,i)+iRSI("CNYUSD",0,RSIperiod,PRICE_CLOSE,i)+iRSI("CNYJPY",0,RSIperiod,PRICE_CLOSE,i)+iRSI("CNYAUD",0,RSIperiod,PRICE_CLOSE,i))/5;
      double jpyi = (iRSI("JPYGBP",0,RSIperiod,PRICE_CLOSE,i)+iRSI("JPYEUR",0,RSIperiod,PRICE_CLOSE,i)+iRSI("JPYCNY",0,RSIperiod,PRICE_CLOSE,i)+iRSI("JPYUSD",0,RSIperiod,PRICE_CLOSE,i)+iRSI("JPYAUD",0,RSIperiod,PRICE_CLOSE,i))/5;
      double audi = (iRSI("AUDGBP",0,RSIperiod,PRICE_CLOSE,i)+iRSI("AUDEUR",0,RSIperiod,PRICE_CLOSE,i)+iRSI("AUDCNY",0,RSIperiod,PRICE_CLOSE,i)+iRSI("AUDJPY",0,RSIperiod,PRICE_CLOSE,i)+iRSI("AUDUSD",0,RSIperiod,PRICE_CLOSE,i))/5;
   
      if(usd==true){
         usdBuffer[i]=usdi;
      }
      if(gbp==true){
         gbpBuffer[i]=gbpi;
      }
      if(eur==true){
         eurBuffer[i]=euri;
      }
      if(cny==true){
         cnyBuffer[i]=cnyi;
      }
      if(jpy==true){
         jpyBuffer[i]=jpyi;
      }
      if(aud==true){
         audBuffer[i]=audi;
      }
   }  

//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+

 the prob Im having is that the jpyBuffer and cnyBuffer are 0.

 

There is no "JPYUSD" symbol nor several of the others you are using such as "JPYGBP", "JPYEUR",

So use the iRSI for "USDJPY" instead and reverse the value (100 - iRSI) i.e. RSI("JPYUSD") = 100 - iRSI("USDJPY").

I gave you the calculation of the RSI for a reason, so that you could see how to reverse it. You need to apply your high school maths (such as algebra).

As for the many non-existent currency pairs. First lookup what is available from your broker. Don't just invent symbols or currency pairs that don't exist.

 
FMIC:

There is no "JPYUSD" symbol nor several of the others you are using such as "JPYGBP", "JPYEUR",

So use the iRSI for "USDJPY" instead and reverse the value (100 - iRSI) i.e. RSI("JPYUSD") = 100 - iRSI("USDJPY").

I gave you the calculation of the RSI for a reason, so that you could see how to reverse it. You need to apply your high school maths (such as algebra).

As for the many non-existent currency pairs. First lookup what is available from your broker. Don't just invent symbols or currency pairs that don't exist.


I got it , thnx thnx thnx a lot Fernando
Reason: