looks like the indicator DRAW_HISTOGRAM line have 2 buffer, and both 2 buffer cannot be 0.
#property strict #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Blue #property indicator_color2 Red double buf0[]; double buf1[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { IndicatorBuffers(2); IndicatorDigits(Digits); SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_DOT); SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_DOT); SetIndexBuffer(0,buf0); SetIndexBuffer(1,buf1); SetIndexEmptyValue(0,0.0); SetIndexEmptyValue(1,0.0); return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { for(int i=rates_total-1; i>=0; i--) { buf0[i]=19.5; buf1[i]=19; } return(rates_total); }
if changed from "#property indicator_chart_window" to "#property indicator_separate_window", show in separate window, it's OK. So, i think it's bug in new released MT4 Build600 version.
claud:
Please use the SRC button when posting code.
After the MT4 upgrade, re-compiled the indicator source file, the DRAW_HISTOGRAM don't show again. Why? Thanks a lot.
<CODE DELETED>
This bug is not fixed in just released new build 604 version.
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
After the MT4 upgrade, re-compiled the indicator source file, the DRAW_HISTOGRAM don't show again. Why? Thanks a lot.