Download MetaTrader 5
To add comments, please log in or register
No PC at hand? Communicate with friends using your mobile phone!
daytradingzoo
44
daytradingzoo 2015.07.18 07:51 

Hi,

 I would like to know how I would program a indicator that has another indicator as an input?

 

Example: I would like to put a Moving Average over a Average True Range.. So in human language I woud like something like EMA(ATR(15), 8)[0] to read the current 8EMA of the 15-period ATR. 

 

If somebody could point me into the right direction it would be much appreciated. 

whroeder1
13596
whroeder1 2015.07.18 11:30  
daytradingzoo I would like to know how I would program a indicator that has another indicator as an input?
  1. If you just want it, drag the MA on top of the ATR and select price=previous indicator.
  2. If you want to code it, take the MA code and replace where it has price with iATR
  3. If you want the MA, read the ATR values into an array and use iMAOnArray
daytradingzoo
44
daytradingzoo 2015.07.19 18:59  
Thanks for your answer. How about if I would like to calculate the Bollinger Bands over let's say Volume.. I'm trying to insert iVolume into the iBands indicator in code. But iBands expects a PRICE enumerator. So inserting a iVolume value there would lead to errors I presume? I guess I'd have to create a new iBands version that does accept other inputs than PRICE enumerator. Unfortunately I cannot access / modify the iBands indicator because it's a system indicator. Any idea where I can get the source code?
whroeder1
13596
whroeder1 2015.07.20 12:12  

You don't change the iBands call - you take the BB code and modify it "and replace where it has price with" iVolume.

And since volume is not a price, neither will the BB lines. You'll have to change the indicator to a separate window.

daytradingzoo
44
daytradingzoo 2015.07.22 11:01  
Great. Thanks I will try it WHRoeder. Thanks for taking the time to answer my question.
/
To add comments, please log in or register