You just put the handle of the first Indicator instead of the price inside th second.
George Ndwiga #:
First of all fix your posted code. I am a newbie to this. I am not quite clear on what you mean by this. Could you kindly demonstrate what needs to change?
You have the handle
SmoothAverageDefinition which is defined as
iMA(symbol,timeframe,period,shift,method,price).
If you do it otherwise compiler throws errors about unknown function overloads or something.
Then set the second one up in the same way and then replace the price by SmoothAverageDefinition. Now you can use CopyBuffer on the second one and have the results of both calculations on top of each other.
Okay. Let me try apply this then get back to you.
Tobias Johannes Zimmer #:
First of all fix your posted code.
First of all fix your posted code.
You have the handle
SmoothAverageDefinition which is defined as
iMA(symbol,timeframe,period,shift,method,price).
If you do it otherwise compiler throws errors about unknown function overloads or something.
Then set the second one up in the same way and then replace the price by SmoothAverageDefinition. Now you can use CopyBuffer on the second one and have the results of both calculations on top of each other.
It has worked just as I wanted.
Thank you very much for your insights.
Tobias Johannes Zimmer #:
First of all fix your posted code.
First of all fix your posted code.
You have the handle
SmoothAverageDefinition which is defined as
iMA(symbol,timeframe,period,shift,method,price).
If you do it otherwise compiler throws errors about unknown function overloads or something.
Then set the second one up in the same way and then replace the price by SmoothAverageDefinition. Now you can use CopyBuffer on the second one and have the results of both calculations on top of each other.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi good people,
I am trying to use to MAs with one using data from the other.
However, I am unable to skip over this hurdle on my expert advisor.
Here is the code I have for this so far. Any pointers to get this working will be highly appreciated.
Thanks in advance.