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
Code:
Result:
Thank you so much @Fernando I think my one of my main problems was not understanding that I needed to specify 2 plots in the compiler directives when I used 2 histograms, MT4 let me get away with specifying one plot and then indirectly creating 2 histogram plots in directive by specifying indicator color 1 and indicator color 2 directives, so I carried this over to mql5. Also of course I had thought that histogram 2 would handle 2 plots.
On the mixing of intermediate/calculation buffers part, could you please clarify on something please, do you mean that the assignment of values should be done from a variable that got its data independently of the buffer ie. that another buffer should not be somewhere in the pipeline of data you want to assign to another buffer? Also, If the above is true, should I then create a normal array instead of a calculation buffer to pass on values for the ADX and Awesome Osc handle that i retrieve in calls to handleValuesToBuffer() in my code?
Edit Thank yout too @Vladimir , I would also appreciate if you could shed light on the buffer values mixing.salitos #: Thank you so much @Fernando I think my one of my main problems was not understanding that I needed to specify 2 plots in the compiler directives when I used 2 histograms, MT4 let me get away with specifying one plot and then indirectly creating 2 histogram plots in directive by specifying indicator color 1 and indicator color 2 directives, so I carried this over to mql5. Also of course I had thought that histogram 2 would handle 2 plots.
On the mixing of intermediate/calculation buffers part, could you please clarify on something please, do you mean that the assignment of values should be done from a variable that got its data independently of the buffer ie. that another buffer should not be somewhere in the pipeline of data you want to assign to another buffer? Also, If the above is true, should I then create a normal array instead of a calculation data to pass on values for the ADX and Awesome Osc handle that i retrieve in calls to handleValuesToBuffer() in my code?
I had already stated that you had to define 2 plots ... "So, yes, just as you do on MT4 you can have 2 separate plots, each one being a histogram but with different display properties."
However, even in MT4 you also require 2 "plots", and you just stated that you were defining 2 colours, and therefore 2 plots (MT4 does not have "plots", only buffers). You were just being lucky that it was using valid default values for the other properties instead of you specifying them explicitly. In other words you were programming it incorrectly, but you were getting away with it by pure luck on MT4.
As for the "mixing", calculation buffers are not "plots", so they should be registered at the end of the buffer list ...
and not as you have done it ...
On MT4 there are no calculation buffers. It accepts the classification without an error but they are treated as normal data buffers. The distinction is just in the order they are indexed when comparing the buffer count in the compiler directive and the buffer count defined by the function, meaning that they have to be at the end.
On MT5, you can actually mix them (only to a degree), but you have to be VERY careful if you don't know what you are doing, so to prevent such problems, ALWAYS put them at the end and you will save yourself a lot of hassles.