Custom Moving average indicator changing parameters as per TF

Back to topics list To post a new topic, please log in or register
avatar
1
TradingForLife 2015.01.30 16:12
 

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

 

avatar
2017
gooly 2015.01.30 16:39 #
 
Either you learn to code by reading the Book and the Documentation (links are above) with their examples or you pay a freelance (link as well above)
avatar
1211
deysmacro 2015.01.30 16:44 #
 
Best to ask here ... https://www.mql5.com/en/job
avatar
12985
WHRoeder 2015.01.30 18:18 #
 
TradingForLife: I am not able to write code fr this condition.
  1. Why not?
  2. learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.

avatar
Moderator
3406
GumRai 2015.01.30 21:17 #
 

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. 

Back to topics list  

To add comments, please log in or register