Is it possible for a script to determine what input values are currently being used by an indicator on the same chart?
Christian Berrigan:
Hello,
I'm wondering if it is possible for a script to discover what input parameter values are currently being used by an indicator on a chart.
Here is the most concise example I can provide, with the examples and questions in the comments of the code:
Really appreciate any insight or alternative work-arounds. Thank you in advance for your time!
I figured it out! Finally found the ChartIndicatorGet() and IndicatorParameters()
This seems to work:
int OnStart() { //--- macdStatusHandle=iCustom(_Symbol,_Period,indicatorToUse); MqlParam indParms[]; int indHandle=ChartIndicatorGet(0,0,"MACD Timeframes"); Print("handle: ",indHandle); ENUM_INDICATOR indicatorType; int paramCount=IndicatorParameters(indHandle,indicatorType,indParms); Print("errors: ",GetLastError()); IndicatorRelease(indHandle); //indParms contains the parameters and their current values :) return(0); }
I wish I had better intuition about how to find these functions.
Hope this helps someone else someday.

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
UPDATE: Solved. See solution below.
Hello,
I'm wondering if it is possible for a script to discover what input parameter values are currently being used by an indicator on a chart.
Here is the most concise example I can provide, with the examples and questions in the comments of the code:
Really appreciate any insight or alternative work-arounds. Thank you in advance for your time!