How to have EA check RSI value of MA

 

Hi

I'm trying to find how to get an "RSI" value for an MA in my script/EA. Let me explain.

In Metatrader when you have an RSI indicator window and you drag a Moving Average indicator onto it you can see if the MA is in the overbought or oversold region etc.

How do I get that RSI % value for the MA in my code? I've tried RSIOnMA but I don't get the right values unless I'm using it incorrectly. I just need some advice on what or where to look for.

Any pointers will be greatly appreciated.

 
Gerhard Botha:

Hi

I'm trying to find how to get an "RSI" value for an MA in my script/EA. Let me explain.

In Metatrader when you have an RSI indicator window and you drag a Moving Average indicator onto it you can see if the MA is in the overbought or oversold region etc.

How do I get that RSI % value for the MA in my code? I've tried RSIOnMA but I don't get the right values unless I'm using it incorrectly. I just need some advice on what or where to look for.

Any pointers will be greatly appreciated.

There is no RsiOnMa or RsiOnArray function in MQL5 but yes a RSI handle could have a Ma handle as price source

So can't really tell what you have done without seeing your code
 
Gerhard Botha:

Hi

I'm trying to find how to get an "RSI" value for an MA in my script/EA. Let me explain.

In Metatrader when you have an RSI indicator window and you drag a Moving Average indicator onto it you can see if the MA is in the overbought or oversold region etc.

How do I get that RSI % value for the MA in my code? I've tried RSIOnMA but I don't get the right values unless I'm using it incorrectly. I just need some advice on what or where to look for.

Any pointers will be greatly appreciated.

Example: RSIOnMAOnRSI

RSIOnMAOnRSI

Fig. 1. Indicator 'RSIOnMAOnRSI'

RSIOnMAOnRSI
RSIOnMAOnRSI
  • www.mql5.com
Индикатор отображает три линии: RSI, RSI рассчитанный на Moving Average и Moving Average рассчитанный на RSI
 
Thank you for the replies. Vladimir, thank you. I'll give it a go and let you know.
 

I'm not getting it right. The Light Blue in my window is the RSI (14) which is the same as the Violet RSI indicator in the RSIOnMAOnRSI indicator. The MA however does not match no matter which one I'm using. All my MA's in window 1 is between the 10 and 20 marks where as the RSIOnMAOnRSI is between 20 and 30.

 
Gerhard Botha :

I'm not getting it right. The Light Blue in my window is the RSI (14) which is the same as the Violet RSI indicator in the RSIOnMAOnRSI indicator. The MA however does not match no matter which one I'm using. All my MA's in window 1 is between the 10 and 20 marks where as the RSIOnMAOnRSI is between 20 and 30.

iRSI and iMA are two DIFFERENT indicators: their scale is IMMEDIBLE. I gave you an example - see the example, read the code: the code creates an RSI indicator handle based on MA and another MA indicator handle based on RSI.

 
Vladimir Karputov:

iRSI and iMA are two DIFFERENT indicators: their scale is IMMEDIBLE. I gave you an example - see the example, read the code: the code creates an RSI indicator handle based on MA and another MA indicator handle based on RSI.

I understand. Thank you for the code and the advice
 
Vladimir Karputov:

iRSI and iMA are two DIFFERENT indicators: their scale is IMMEDIBLE. I gave you an example - see the example, read the code: the code creates an RSI indicator handle based on MA and another MA indicator handle based on RSI.

I don't think "IMMEDIBLE" is an English word.
Reason: