I'm experimenting on indicators and I wrote a simple SMA using iMA function, it works well just for program fixed applied_price (PRICE_CLOSE).
I didn't found a way to intercept and use the starting program selection "Parameters - Apply to:" instead, is it possible?
Thanks.I intend this kind of selection https://c.mql5.com/2/0/price_for_calculations.png
and set corresponding value as applied_price parameter in iMA.
ma_handle=iMA(Symbol(),0,period,shift,MODE_SMA,value);
I intend this kind of selection https://c.mql5.com/2/0/price_for_calculations.png
and set corresponding value as applied_price parameter in iMA.
I know what's your intention. But I asked you on what values you want to apply iMA.
Instead of price, you can use an handle of an other indicator.
Yes! this works very well indeed
ema_handle=iMA(Symbol(),0,ema_period,0,MODE_EMA,PRICE_CLOSE); sma_handle=iMA(Symbol(),0,sma_period,sma_shift,MODE_SMA,ema_handle);
but now I would like to start the chain, I would like to apply my indicator to any other opened indicator on the graph, just like an usual indicator having a single data buffer OnCalculate
Yes! this works very well indeed
but now I would like to start the chain, I would like to apply my indicator to any other opened indicator on the graph, just like an usual indicator having a single data buffer OnCalculate
"Previous Indicator's Data"
Already answered, get an handle to the indicator you want and use it instead of price. Please do some efforts and read the documentation: ChartIndicatorGet().
oops
thanks
I've defined an enumeration and an input field to select "close", "open", "previous indicator's data" ecc... and build the handle for passing it to iMA.
I dislike only the duplicated input structure and the fake functionality for "Parameters - Apply to:", but no matter.
PS: Solved, I use multiple data buffer form OnCalculate

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I'm experimenting on indicators and I wrote a simple SMA using iMA function, it works well just for program fixed applied_price (PRICE_CLOSE).
I didn't found a way to intercept and use the starting program selection "Parameters - Apply to:" instead, is it possible?
Thanks.