Why are you talking about mql5 ? It's clearly mql4.
ExtMA3Buffer[ii-1]
You are looking in the future.
What is happening when ii=0 ?
#property indicator_chart_window SetIndexStyle(0,DRAW_LINE); SetIndexStyle(1,DRAW_LINE); SetIndexStyle(2,DRAW_LINE); SetIndexStyle(3,DRAW_HISTOGRAM);Also
In the chart window, histograms are drawn via pairs of buffers. If the first is higher than the second, it uses the first's color.
In separate window, histograms are drawn from the buffer value to zero. They are drawn from the first to the last. Of you want one to go the back, it must be the first buffer.
Why are you talking about mql5 ? It's clearly mql4.
You are looking in the future.
What is happening when ii=0 ?
Thanks for your help.
I'm still in MQL4? Some of my indicators have OnInit and Oncalculate.
My bad --- yesterday I read that "In MT5 first bar is 0, last one is rates_total-1", so I changed "ii+1" into "ii-1", then realized that it's still MT4 , but then forget to change them back.
Also
Thank you for your help, sir.
Sorry, I don't understand your advice, do you mean move SetIndexStyle lines outside of OnInit into front? that will cause "'SetIndexStyle' - declaration without type" .
And, does it have to be via pairs of buffers, in the chart window? I want it to draw from zero. In fact, I was planning to use verticle dot_line, instead of histogram, just don't know how to draw verticle lines NOT as objects.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi all,
It's been a long time, suddenly I find everything automatically turned into MQL5?
The following code is a three MA indicator I've been using for a long time.(In MT5 first bar is 0? but this indicator still runs fine. MQL5 running in MT4 is really confusing.) Today I'm trying to add a MA Cross signal, draw this signal as histogram. So I added the 4th buffer "crossBuffer". In the main loop, I added the second "for" structure, in which the first "if" structure is merely for debug purpose(forget 2nd and 3rd "if"), showing the histogram does not draw.
Could anybody please help?