Knowledgebase:
iOpen
Posted by Mohammad Rahhal, Last modified by Rawan Al Hourani on 17 July 2017 12:11 PM


Syntax

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

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

Parameters

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

Return value

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

Sample

Public Sub main()

  Dim barNumber

 Dim result

 barNumber=3

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

  if result=0 then

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

   PrintData " The open value not loaded "

     else

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

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

 end if 

End Sub

 


See Also


Back to VTL Client Script Index

(1 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
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