View Full Version : GetTime at last closed bar

blaidd drwg
06-17-2014, 09:24 AM
how to get GetTime from last closed bar ?
And how to get GetTime from bars(0)-n ?
What is the relatin between Record parameter and Time ?

06-17-2014, 11:19 AM

You can use this method (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/3442)


Public Sub main()

Dim result

result = GetTime(0,50)
' 0 means get the time for the current chart
' 50 means the bar #50 which the oldest bar=1 and the current bar= bars(0).
' the time for the last closed bar in the current chart = GetTime (0,bars(0)-1)
If result = "0" Then

MsgBox "The returned value from GetTime is 0 .To get the detailed error information, call GetLastError()."

elseif result = "" then

MsgBox "The local history is empty"


MsgBox "The Time Value for the bar of indicated chart is : " & result

End If

End Sub

blaidd drwg
06-17-2014, 01:02 PM
Thank You :-)