Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

MetaTrader 5 Libraries | iRSIOnArray for MT5

MetaTrader Experts, Indicators, Scripts and Libraries

This header provides the iRSIOnArray function known from MT4. It works with both MQL 4 and 5 code. A reason to use it also under MT4 could be that it fixes a bug known in the original function, where a constantly increasing array - like 100,101,102 - returns an RSI of 0 instead of 100.

Usage:

#include <RSIOnArray.mqh>    int OnInit()    {     double array[]={100,101,102};     int total=0;     int period=2;     int shift=0;     double rsi=iRSIOnArray(array,total,period,shift);

27478