I wrote a simple indicator to compare RSI of previous bar with current rsi. But i need to change it to compare moving averages of RSI. please note that i know its doable to calculate moving average of rsi indicator by dragging moving average over rsi and applying it to previous indicators data and I also know there is ready to use indicators for this purpose on codebase but i need to code it.
Please note to line 62 of code. How can i compare rsi[i+1] with moving average of RSI (IMA(RSI) )?
I want to call rsi using iCustom and then in line 9, instead of PRICE_CLOSE, use that calculated rsi.
Please consider that this code seems nonsense for trading, but i want to know how to write above code.
- CrossOver moving average apply price with rsi
- Ask!
- Does anybody know how to do this?
Huido:
Please note to line 62 of code. How can i compare open[i+1] with moving average of RSI (IMA(RSI) )?
I want to call rsi using iCustom and then in line 9, instead of PRICE_CLOSE, use that calculated rsi.
- Open is 1.12345 and RSI is in the range zero to 100 What is the point in comparing them?
- RSI is not a custom indicator, you can't use iCustom.
- To get the MA of a buffer you must calculate it, like the MT4's iMAOnArray.
Migrating from MQL4 to MQL5 - MQL5 Articles -> № 17. Technical Indicators -> MAOnArrayMQL4
whroeder1:
- Open is 1.12345 and RSI is in the range zero to 100 What is the point in comparing them?
- RSI is not a custom indicator, you can't use iCustom.
- To get the MA of a buffer you must calculate it, like the MT4's iMAOnArray.
Migrating from MQL4 to MQL5 - MQL5 Articles -> № 17. Technical Indicators -> MAOnArrayMQL4
You are right for #1. I was written it wrong. I changed it now to compare previous rsi with current one.
So you would say its not possible to have something like this and use it instead of price_close in line 9?
double myrsi=iRSI(NULL,0,14,PRICE_CLOSE,0)
I would say, it is not possible.
Both indicators need an array to calculate the proper value.
The only way I see, is to create your own indicator, which is using one of the standard indicators to calculate the value
and put it to an internal array, while the other indicator needs to be rewritten to use this internal array instead of
Open, High, Low or Close.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register