Download MetaTrader 5
To add comments, please log in or register
Develop applications to order. Make profit using Freelance service!
pankajp
10
pankajp 2015.01.30 15: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

Carl Schreiber
5927
Carl Schreiber 2015.01.30 15: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)
SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2015.01.30 15:44  
Best to ask here ... https://www.mql5.com/en/job
whroeder1
13593
whroeder1 2015.01.30 17: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.
Keith Watford
Moderator
7866
Keith Watford 2015.01.30 20: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. 

/
To add comments, please log in or register