moving average period from inside ea

 
 

S

You will need to clarify the question for us in order to get an answer...

-BB-

 
I am using an EA to monitor moving average crossovers with this line: double pastMAfast = NormalizeDouble(iMA(Symbol(),0,fastPeriod,fastShift,fastMethod,fastPrice,5),5); I also have a moving average visible on the chart. I am looking for a way to have the EA recognize when the moving average period is changed on the chart (by using right click change property) and use that new value as the fastperiod variable which, is an interger. is this possible? thanks
 
The properties of the MA on the chart are irrelevant. The EA call IMA with it's own parameters and those should be exported. Change the EA's.
 
sorry, guess I didn't explain myself very well. I am trying to synchronize what I see on the chart to what is happening in the EA. when the chart ma period is changed, I would like the ima call to use the new value. Basically, I am looking for a way to access the property of the ma on the chart.
 
sect8:
sorry, guess I didn't explain myself very well. I am trying to synchronize what I see on the chart to what is happening in the EA. when the chart ma period is changed, I would like the ima call to use the new value. Basically, I am looking for a way to access the property of the ma on the chart.
Set & use a globalVariable for the period parameter both in the EA & Indicator. Change the 'GVPeriodMa' from F3 dialog box. It should changed the EA & Indy simultaneously.
 
That would require a custom indicator.
 

That would require a custom indicator.

WHRoeder was that regarding my post? I thought I missed reading some of sect8 post, but upon re-reading...

sect8:

I am using an EA to monitor moving average crossovers with this line: double pastMAfast = NormalizeDouble(iMA(Symbol(),0,fastPeriod,fastShift,fastMethod,fastPrice,5),5); I also have a moving average visible on the chart. I am looking for a way to have the EA recognize when the moving average period is changed on the chart (by using right click change property) and use that new value as the fastperiod variable which, is an interger. is this possible? thanks

... the second line I colored red as I understood would constitute a custom indicator. Perhaps sect8 can clarify. Both EA & Indicator can read GVs AFAIK.

regards
cameo

 
Thanks for the help. The global variable worked until I ran the EA on more than one chart...I wound up drawing the lines on the chart and now have what I wanted........still would like to be able access the property for the indicators that are included with mql4....Example, use the EA to test the indicator period before changing it for a particular chart or timeframe...........again, thanks
Reason: