Posted by Mohammad Rahhal, Last modified by Diana Alkouni on 08 September 2020 07:30 AM


 Public Function ChartPeriod(Optional chart_id As long = 0) As Integer


This function is used to return the timeframe value (one of the ENUM_TIMEFRAMES value) for a specified chart.


Key Description
chart_id Chart identifier, 0 is the current chart, value of type Long.

Return value

Returns one of the ENUM_TIMEFRAMES. If the chart does not exist it returns 0.In order to get an error, call GetLastError() function.


Public Sub main()

Select Case ChartPeriod() 'Select Period

Case 1

AlertMessage "Period = 1 minute" 

Case 2

AlertMessage "Period = 5 minutes" 

Case 3

AlertMessage "Period = 15 minutes" 

Case 4

AlertMessage "Period = 30 minutes" 

Case 5

AlertMessage "Period = 1 hour" 

Case 6

AlertMessage "Period = 4 hours" 

Case 7

AlertMessage "Period = 1 day" 

Case 8

AlertMessage "Period = 1 week" 

Case 9

AlertMessage "Period = 1 month" 

Case Else 

AlertMessage "Chart not selected" 

End Select

End Sub


See Also

Back to VTL Client Script Index

(0 vote(s))
Not helpful

Comments (0)
Post a new comment
Full Name:
CAPTCHA Verification 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).

Help Desk Software by Hybrid Solutions