Posted by Mohammad Rahhal, Last modified by Diana Alkouni on 01 September 2020 03:45 PM


Public Function iclose(Symbol As String, timeFrame As ENUM_TIMEFRAMES, shift As Long)As Double


This function is used to return the close price value for a bar at a specific time frame by a given the bar number.


Key Description 
Symbol Trading symbol name, the value of type String.
timeframe The chart time frame can be one of the ENUM_TIMEFRAMES.
Shift Bar number to get the close price value for it, the value of type Long.

Return value

Return's the close value for the indicated symbol, Time frame and bar number as a double value. These Function returns 0 if the history is not loaded.


Public Sub main()

  Dim barNumber

 Dim result


  result=iclose ("EUR/USD",PERIOD_D1,Clng(barNumber))

  if result=0 then

  ' print a message  to the  …\VTL10\Log log file

   PrintData " The close value not loaded "


  ' print a message  to the  …\VTL10\Log log file

  PrintData("The close value for bar Number " & Cstr(barNumber) &  " is "  & CSTR(result))

 end if 

End Sub

 See Also

Back to VTL Client Script Index

(1 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