How to program these lines on a chart.

 


Hi all I would like to know how to create these little line markers just above the time line y axis. They are not able to be selected or moved around. I cannot find a OBJ_TYPE corresponding to it in ObjectCreate(). 

 

You may be able to use 

OBJ_RECTANGLE_LABEL

 
bigbear92: They are not able to be selected or moved around.

Then they are probably not objects but buffer lines. And likely redrawn when the chart scale changes.

See 'Forex market session indicator' indicator by 'OldZ1' for MetaTrader 4 in the MQL5 Code Base
 
whroeder1:

Then they are probably not objects but buffer lines. And likely redrawn when the chart scale changes.

See 'Forex market session indicator' indicator by 'OldZ1' for MetaTrader 4 in the MQL5 Code Base

Hi, is there a way to put buffer lines on the main chart window line in the above picture instead of a separate window?

 
whroeder1:

Then they are probably not objects but buffer lines. And likely redrawn when the chart scale changes.

See 'Forex market session indicator' indicator by 'OldZ1' for MetaTrader 4 in the MQL5 Code Base

Why do you think it's buffer lines ?

I would say objects as Keith.

 
bigbear92: Hi, is there a way to put buffer lines on the main chart window line in the above picture instead of a separate window?

Your image shows they aren't in a separate window, they are at the bottom of the only window. Compare to image in the link I provided.

Alain Verleyen: Why do you think it's buffer lines ?

Non-selectable "objects" are usually buffers, especially in MT4, where non-selectable wasn't an option pre-build 600.

 
whroeder1:

Your image shows they aren't in a separate window, they are at the bottom of the only window. Compare to image in the link I provided.

Non-selectable "objects" are usually buffers, especially in MT4, where non-selectable wasn't an option pre-build 600.

Yes, it makes sense, I missed that point.
 
whroeder1:

Then they are probably not objects but buffer lines. And likely redrawn when the chart scale changes.

See 'Forex market session indicator' indicator by 'OldZ1' for MetaTrader 4 in the MQL5 Code Base

I still have no idea how to go about creating these lines at the bottom of the chart. Any help leading me to the right direction would be greatly appreciated :)


#property       indicator_separate_window

#property indicator_chart_window // I have tried changing it to this but then no lines show up


I have tried changing from separate_window to the chart_window but then the lines dissappear. No idea how to set to the lowest price of the visible y axis.

 

Never Mind I found out the

WindowPriceMin

function works.

 
bigbear92: . but then the lines dissappear. No idea how to set to the lowest price of the visible y axis.
  1. whroeder1: And likely redrawn when the chart scale changes.
  2. Chart Price Max/Min - MQL4 and MetaTrader 4 - MQL4 programming forum