Error (very serious error) - according to the MQL5 style, the indicator handle must be created ONCE and must be done in OnInit.
Correct it - until you correct this error, it is useless to move on.
If you want to learn both iMA and iRSI in one window - see this option: RSIOnMAOnRSI
Hi Vadimir, interesting stuff. Let me play around with it.
Vladimir, your code is copyrighted? How can I use it?
It is written in the terms:
§4.6:
"4.6. By submitting any materials to the sections of www.mql5.com for public use, the User automatically grants (or warrants that the owner of such materials has expressly granted MetaQuotes Ltd) MetaQuotes Ltd, its partners and Affiliated Entities the royalty-free, perpetual, irrevocable, non-exclusive right (non-exclusive license) to use, post, store, reproduce, modify, create derivative works from (such as those resulting from translations, adaptations or other optimizations), communicate, publish, publicly perform, publicly display and distribute such materials, worldwide for the full term of any copyright that may exist in such material as stipulated by local laws. The above rights are used for the limited purpose of operating, promoting, and improving the website www.mql5.com. No additional formality, including that in writing, will be required for the rights granted by the User to be recognized. This license shall continue even if You stop using the website www.mql5.com. Before You submit to MetaQuotes Ltd any materials and thus grant this license for their use, make sure You have the necessary rights to do so."

- www.mql5.com

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi all
I use a MA(50) and also overlaid an RSI just to make use of the levels 90, 80, 50, 20 and 10. The signal line color of the RSI I make the same as the background color to make it "disappear". All I am interested in from the RSI is the levels. MA's levels function does not work.
In MQL5, is use the iMA function to determine the values for the past 50 candles. To convert the values to base 0 to 100, I use the formula in the loop (see code below).
This works fine, however, the top and bottom values for the 50 MA values are 0 and 100 (off course). But I'm trying to achieve exactly the same results as in the indicator window. The upper and lower values are not 100 and 0 for an MA(50). The can get pretty high, like 95+ or very low, but my calculated values different.
Can you tell me how I arrive at the same upper and lower values (red arrow) as in the attached screenshot? Either the real value or 100-based.