Returning MA parameters

 

Hi All,

I have never come to this forum without leaving with a solution. Sometimes it takes a little work to solve a problem but the help here is always outstanding. This one may be simple.

A moving average is drawn on a chart after being selected by a specific set of criteria. I want to retrieve the parameters of the selected MA through code.

Or think of it this way...there's an MA on the chart but I can't access it's parameter values by clicking on it although it is a legitimate MT4 indicator. How can I retrieve the parameters with code?

Any ideas?

Regards,
Yellowlion

 

Hi there,

Not a solution but maybe an idea......

One would think that an indicator is an object, but it appears not.

The actual parameter is stored in the current chart in the profile folder. Perhaps you could look at trying to read that file somehow.

 
kennyhubbard wrote >>

Hi there,

Not a solution but maybe an idea......

One would think that an indicator is an object, but it appears not.

The actual parameter is stored in the current chart in the profile folder. Perhaps you could look at trying to read that file somehow.

Kenny,


You are right, MA's are indicators, not objects, and can't be accessed with object methods.

Thanks for the .chr idea. Never tried to open those files before. It's a good start. The .chr files are readable with a text editor, and visible are the moving averages with parameters plain as day. Looks like some form of XML with the indicators contained within <indicator> tags and the parameters defined as variables (param = value). Now...how to read these files with MT4 code.

YL
 
Hi yellowlion

You probably could check the file functions here:
https://docs.mql4.com/files

A
s well as you can use an external command to read the file or copy it to a folder of your choice. A DLL function can do the same...

Hope the above helps.

thank you
Automated
--
grid trading EA, +558 pips in 24 hours:
http://www.gridtradingcourse.com/videos/grid_trading_eurusd_1/Grid_Trading_EURUSD.html



Reason: