ArraySetAsSeries not working
In MQL4 or MQL5?
input int InpPeriodRSI=14; // Period
//--- indicator buffers
double ExtPosBuffer[];
ArraySetAsSeries(RSI, true);
RSIHandle=iRSi(Symbol,PRICE_CLOSE);
how does the rsi indicator appear in the lower window of ea ?
input int InpPeriodRSI=14; // Period
//--- indicator buffers
double ExtPosBuffer[];
ArraySetAsSeries(RSI, true);
RSIHandle=iRSi(Symbol,PRICE_CLOSE);
how does the rsi indicator appear in the lower window of ea ?
Hello , try this mql5 code . Instructions included ☕️
#property version "1.00" input int rsi_period=14;//RSI period input ENUM_APPLIED_PRICE rsi_price=PRICE_CLOSE;//RSI price /* you need an indicator handle */ int RSI_Handle=INVALID_HANDLE;//you leave it at its reset state in decalaration int RSI_Sub=-1;//for deletion - consult OnDeinit string RSI_Name="";//for deletion bool Loaded=false;//indication of load int OnInit() { //reset your handle and the load indication Loaded=false; RSI_Handle=INVALID_HANDLE; //setup a timer to load when the symbol is ready EventSetMillisecondTimer(44); return(INIT_SUCCEEDED); } //Timer handler for load void OnTimer(){ //if we have not loaded if(!Loaded){ //if the symbol is synchronized if(SymbolIsSynchronized(_Symbol)){ //create the indicator (rsi) handle RSI_Handle=iRSI(_Symbol,_Period,rsi_period,rsi_price); //if the handle is created if(RSI_Handle!=INVALID_HANDLE){ //kill the timer EventKillTimer(); //set loaded to true Loaded=true; //plug the indicator on the chart long id=ChartID(); RSI_Sub=(int)ChartGetInteger(id,CHART_WINDOWS_TOTAL); ChartIndicatorAdd(id,RSI_Sub,RSI_Handle); RSI_Name=ChartIndicatorName(ChartID(),RSI_Sub,0); ChartRedraw(id); } } } } void OnDeinit(const int reason) { if(RSI_Handle!=INVALID_HANDLE){ ChartIndicatorDelete(ChartID(),RSI_Sub,RSI_Name); } } void OnTick() { }
Please use the CODE button (Alt-S) when inserting code.
- www.mql5.com
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
how does the rsi indicator appear in the lower window of ea ?