Hello,
I want to get period of current RSI indicator. Does anybody know how I can get it in MQL4 or MQL5?
Thanks
Salam!
void OnStart() { int windows=(int)ChartGetInteger(0,CHART_WINDOWS_TOTAL); for(int w=0;w<windows;w++) { int total=ChartIndicatorsTotal(0,w); for(int i=0;i<total;i++) { string name=ChartIndicatorName(0,w,i); if(StringFind(name,"RSI(",0)!=-1){ int startPos = (int) StringFind(name,"(",0)+1; // or use 4 as it is clear where to start int endPos = (int) StringFind(name,")",0); int rsiPeriod = (int) StringSubstr(name,startPos,endPos-startPos); } } } }
Mansour Mansouri #: I need to know what RSI period is on the chart in my EA.
- There is no generalized way to know what is on the chart. The human put the RSI on the chart. Only the human knows.
- The EA has no eyes. It doesn't need anything on the chart. Add an input to your EA and let the human tell you.
- There is no generalized way to know what is on the chart. The human put the RSI on the chart. Only the human knows.
- The EA has no eyes. It doesn't need anything on the chart. Add an input to your EA and let the human tell you.
I want to do the same. Add an input to my EA and human tell me. But I do not know how to put RSI on the chart according to these inputs.
I want to do the same. Add an input to my EA and human tell me. But I do not know how to put RSI on the chart according to these inputs.
IndicatorAdd

- www.mql5.com
What about MT4?
Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page)?
General rules and best pratices of the Forum. - General - MQL5 programming forum? (2017)
Next time, post in the correct place. The moderators will likely move this thread there soon.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
I want to get period of current RSI indicator. Does anybody know how I can get it in MQL4 or MQL5?
Thanks