You don't have to code anything. Simply drag and drop the Moving Average indicator from the navigator panel to your indicator window. Be sure to select "Previous indicator's data" as the value of the "Apply to" field in the MA settings.
bstone:
You don't have to code anything. Simply drag and drop the Moving Average indicator from the navigator panel to your indicator window. Be sure to select "Previous indicator's data" as the value of the "Apply to" field in the MA settings.
You don't have to code anything. Simply drag and drop the Moving Average indicator from the navigator panel to your indicator window. Be sure to select "Previous indicator's data" as the value of the "Apply to" field in the MA settings.
Yep, you are right. I looked for that option before I wrote my own. I guess I tried the Moving Average of Oscillator and it didn't have the 'previous indicator's data' option and I couldn't get it to print in the oscillator window, only in the chart window. Thanks for the info.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
I'm a MQL4 newb, but do have some programming background. I have been trying to make some changes to an existing indicator. The first few changes I made (my first MQL4 effort) worked perfectly, but now I'm trying to add a simple moving average to this indicator, that only has a range from 1-100 and I can never get the SMA to draw in the subwindow. I have some alert statements that look like the values are right, just that nothing draws on screen.
What I have done is open up the movingaverages indicator and cut and paste it's code into the new indicator I am modifying. I changed the ClosingPrice variable to the name of the Buffer that the primary indicator uses for its value. Seems like that should have done it, but it's not working.
Any suggestions?
Here is a snippet of the sma section of the movingaverages.mq4 file:
Where in that function should it actually plot it's point, for a drawn line? I thought it was the line that says:
But as I said, nothing ever writes/draws on the screen except my original indicator and the couple of extra things I added. I have allocated plenty of buffers, so that each drawing item has it's own.
Thanks.