If I run this from MetaTrader, nothing appears (Actually volumes appear unrequested 🤷♀️).If I run this from the dev IDE, Fast & slow EMA appear superimposed on the main chart, but the MACD signal/histogram window does not appear. I am not great at graphics/drawing stuff/indicator development and would be grateful if someone can take a look and see what I have done wrong/I have missed. Unfortunately what I have done makes sense to me - but something is plainly wrong.With my best regards, Insectoid creature.
Not feasible! The fast and slow EMAs are of the same scale as the price, while histogram and signal are of the scale of price ranges.
If you were to place them in the same window, then the histogram and signal would become so small you would not see them, because they have different scales.
Thank you Fernando,
Good answer and I didn't think of that.
However perhaps you have given me hope; a) I could apply a scaling factor or; b) show the Fast & slow EMA in the chart window and the signal/histogram in the sub window.
Do either of these ideas sound feasible? You might be able to tell my level of expertise by these questions (i.e., low 🤠). I have some coding skills but less so with the huge landscape of MQL5 libraries.
Thanks,
With my best regards, ESB.- The scaling is technically feasible, but would still be meandering all over the place due to the variance of the values. I also find the ideia useless to place them on the same window as the histogram and signal. What is the point?
- Placing them on the main window is much more useful but it is unfeasible because a custom indicator cannot plot buffers in both windows at the same time. It can only plot buffers, either on the main chart, or on the sub-window, but not both.
Hi Fernando,
I apologise for my slow repy: a) I was thinking and; b) I have been distracted by work.
I had watched a MACD strategy YouTube video, I have been looking to discover how to spot when not to trade when the market is reversing and the idea looked worth investigating.
Hence I was looking for a two line MACD, I couldn't find one so thought I'd roll my own based on the example MACD shipped with MetaTrader 5. It's always a good idea to understand the problem before diving into code and I hadn't fully grasped what I should be doing. Anyway, lucky me, I found what I was looking for here.
So for the time being, my search is over and I thank you for taking the trouble to read my request and think about it.
Wishing you well and thanks again, ESB.
- 2010.08.24
- www.mql5.com
But that is just a normal MACD. It has nothing to do with ploting the Fast and Slow EMAs themselves in the window.
It's the MACD line (difference between Fast and Slow EMA), the Signal (an EMA of the MACD line), and the histogram (difference between MACD line and signal).
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello All,
I want to make a straightforward change to the example shipped MACD to expose the Fast & slow EMA's as lines in the same window as the histogram & signal.
The standard shipped example MACD (attached) exposes the histogram & signal in a separate window. I can build it, it works - all good.
I have read the docs and made the following changes/additions to the standard MACD, the rest of the code remains as is:
If I run this from MetaTrader, nothing appears (Actually volumes appear unrequested 🤷♀️).
If I run this from the dev IDE, Fast & slow EMA appear superimposed on the main chart, but the MACD signal/histogram window does not appear.
I am not great at graphics/drawing stuff/indicator development and would be grateful if someone can take a look and see what I have done wrong/I have missed. Unfortunately what I have done makes sense to me - but something is plainly wrong.
With my best regards, Insectoid creature.