Identifying the Current Timeframe

 

Hi All

Can anyone please tell me how to identify and apply the current time frame showing on my chart to a variable?

Basically what I want to do is to only show specified vertical lines on certain time frames.

What I was planning on doing (rightly or wrongly) was to say - if the current time frame == a time frame on which I want to see the line - in this case, m1, m5, m15 and m30 - then I was going to set the OBJPROP_TIMEFRAMES to that time frame.

If the chart is showing a time frame on which I don't want to see the lines, I was going to set the OBJPROP_TIMEFRAMES to another time frame so it would be invisible on the chart I was currently looking at .

I hope that make sense.

Thanks in advance for any help.

Regards

Paul Eamonn

 
Current chart timeframe is Period()
 

RaptorUK

Many thanks for the swift reply.

Regards

Paul Eamonn

Reason: