Download MetaTrader 5

Chart Operations on OBJ_CHART

To add comments, please log in or register
svengralla
116
svengralla  

Hi,


whats the syntax for setting CHART_SHOW_OHLC --> false, on a Chart object that was created as OBJ_CHART?


Thank you, Sven

Alain Verleyen
Moderator
36404
Alain Verleyen  
svengralla:

Hi,


whats the syntax for setting CHART_SHOW_OHLC --> false, on a Chart object that was created as OBJ_CHART?


Thank you, Sven

https://www.mql5.com/en/forum/13297
How to change colors of bar and candle in chart object
How to change colors of bar and candle in chart object
  • www.mql5.com
I also wanted to know how to hide OHLC values in the upper left corner.
svengralla
116
svengralla  

Hi,

thanks for the response. I tried ...


long mini_chart_id;
mini_chart_id=ObjectGetInteger(0,"mini_chart_1",OBJPROP_CHART_ID);
ChartSetInteger(mini_chart_id, CHART_SHOW_OHLC, false);


But this doesnt work. What am I missing?

Alain Verleyen
Moderator
36404
Alain Verleyen  
svengralla:

Hi,

thanks for the response. I tried ...



But this doesnt work. What am I missing?

Is mini_chart_id gets a correct value ?

Check the returned value of ChartSetInteger() and print the error code if needed.

svengralla
116
svengralla  
angevoyageur:

Is mini_chart_id gets a correct value ?

Check the returned value of ChartSetInteger() and print the error code if needed.


long mini_chart_id;
mini_chart_id=ObjectGetInteger(0,"mini_chart_1",OBJPROP_CHART_ID);
Print("id ",mini_chart_id);
Print(ChartSetInteger(mini_chart_id, CHART_SHOW_OHLC, false));
2014.04.30 20:56:30.157    chart_mini (EURUSD,M1)    585
2014.04.30 20:56:30.157    chart_mini (EURUSD,M1)    true
2014.04.30 20:56:30.154    chart_mini (EURUSD,M1)    id 130427029228697791
Alain Verleyen
Moderator
36404
Alain Verleyen  
svengralla:


2014.04.30 20:56:30.157    chart_mini (EURUSD,M1)    585
2014.04.30 20:56:30.157    chart_mini (EURUSD,M1)    true
2014.04.30 20:56:30.154    chart_mini (EURUSD,M1)    id 130427029228697791


("chart_mini"?)

ChartRedraw(mini_chart_id);
svengralla
116
svengralla  
angevoyageur:

Yes, that's it.

Thank you.


I had the "ChartRedraw" issue already before, working on a different indicator.

So, thats something definitely to be kept in mind.

Interestingly, it's not an issue on Mt4.

To add comments, please log in or register