Custom Moving average indicator changing parameters as per TF
TradingForLife:
If M15 chart is open, it should plot avg line using Linear wt avg method on Open price w/o shift and Avg period: 14
and if I switch to M30 or higher TF, it will compute avg line using Exponential avg method on HLCC/4 price with shift-2 and Avg period: 14
if you are unable to code it
Why not simply add your first MA to the chart and in the visualization tab, set it to only show on M15 and any other tf that you want it displayed
Then add the 2nd and have it displayed only on M30 and higher.
Hi,
I am new to MQ4 coding. Can somebody please guide me for writing a code for following:
I need a Custom moving average indicator which would plot moving average line based on chart timeframe.
e.g.: If M15 chart is open, it should plot avg line using Linear wt avg method on Open price w/o shift and Avg period: 14
and if I switch to M30 or higher TF, it will compute avg line using Exponential avg method on HLCC/4 price with shift-2 and Avg period: 14
Gist: It is Moving Average indicator, which switches parameters internally based on chart TF and accordingly plot avg line.
I am not able to write code fr this condition. Appreciate any help in this regard.
Thanks