Download MetaTrader 5

Histogram Width can not be affected. Please help

To add comments, please log in or register
Search in documentation is available via MetaTrader 5. Search and learn!
stitchtrader
133
stitchtrader 2013.05.06 08:49 

Hi, 

I wrote the following code. But the width setting of Histogram (#property indicator_width1  4) could not affect.

Please tell me why. How can I make it?

Thanks! 

I need the feature to make a simple candlestick indicator like the image working with MT4.

 

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_plots   1
#property indicator_type1   DRAW_HISTOGRAM2
#property indicator_color1  clrBlue
#property indicator_width1  4

double HighBuffer[];
double LowBuffer[];

int OnInit()
  {
  SetIndexBuffer(0, HighBuffer, INDICATOR_DATA);
  SetIndexBuffer(1, LowBuffer, INDICATOR_DATA);
  return(INIT_SUCCEEDED);
  }

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[])
  {
   int start = 0;  if(prev_calculated > 0)  start = prev_calculated - 1;
   for(int i=start; i<rates_total; i++)
     {
      HighBuffer[i] = high[i];
      LowBuffer[i] = low[i];
     }
  return(rates_total);
  }

 

testhistogram.mq5 with MT5

testhistogram with MT4 

MT4 

MT4 default

Files:
Alain Verleyen
Moderator
30731
Alain Verleyen 2013.05.06 10:09  
stitchtrader:

Hi, 

I wrote the following code. But the width setting of Histogram (#property indicator_width1  4) could not affect.

Please tell me why. How can I make it?

Thanks! 

I need the feature to make a simple candlestick indicator like the image working with MT4.

Seems like you can't set a width larger than the actual candles. I don't know if it's a bug or a feature ;-)

You can write to ServiceDesk to report this and obtain a definitive answer.

Get in touch with developers using Service Desk!
Get in touch with developers using Service Desk!
  • www.mql5.com
We therefore attach great importance to all user reports about issues in our programs and try to answer each one of them.
stitchtrader
133
stitchtrader 2013.05.06 14:48  
angevoyageur:

Seems like you can't set a width larger than the actual candles. I don't know if it's a bug or a feature ;-)

You can write to ServiceDesk to report this and obtain a definitive answer.

Hi Alain,

Thank you so much :)

I have reported this to ServiceDesk. I look forward to hear from them.

I think it is a very important feature, so I 'll go back to MT4.

Hoping that they'll fix it soon!

Slawa
Moderator
6842
Slawa 2013.05.07 12:38  

Why "cannot be affected"?

I see difference between

#property indicator_width1  4

and

#property indicator_width1  3
stitchtrader
133
stitchtrader 2013.05.07 14:25  

Hi Slawa,

Thanks for your comment :)

That's right.  Sorry for my bad English. Seems like there are differences among width 1~3.  

But MT5 can't delineate width 4 or above for now, though MT4 can do that -

Width 4 with MT4

Alain Verleyen
Moderator
30731
Alain Verleyen 2013.05.07 15:39  
stringo:

Why "cannot be affected"?

I see difference between

and

You see the difference only if histogram width is <= candle width.
Slawa
Moderator
6842
Slawa 2013.05.08 07:00  
angevoyageur:
You see the difference only if histogram width is <= candle width.

I know how histogram is drawn.

Definitely there is difference between MT4 and MT5. As designed.

Definitely this is first complaint about histogram drawing. What should we do?

BTW there is special style DRAW_CANDLES

stitchtrader
133
stitchtrader 2013.05.17 11:49  
MT4 Less space
To add comments, please log in or register