'########################################################### ' Script Name: Price Label ' Author: Ehab Kanai ' Descreption: This Client Script will create a price label on the chart ' Website: http://www.hybridsolutions.com ' Date: March, 22nd, 2012 '###########################################################
Dim objID
Dim SymbolName
Dim askValue
''' <summary>
''' The main function is the entry point for any Script program
''' </summary>
Public Sub main()
fontSize=8
objID="Pricelabel1"
XPos=10
YPos=10
SymbolName=ChartSymbol(0)
SymbolSelect CSTR(SymbolName),CBool(True)
SymbolInfoDouble CSTR(SymbolName) ,2,askValue
if not AddPricelabel (0,0,CDbl(askValue),CSTR(objID)) then
AlertMessage ErrorDescription(GetLastError())
end if
End Sub
''' <summary>
''' The function is generated when a new tick is received fro any symbol
''' </summary>
Public sub OnTick(SymbolName)
if not SymbolInfoDouble( CSTR(SymbolName) ,2,askValue) then
AlertMessage ErrorDescription(GetLastError())
End if
SetPricelabel 0,CSTR(objID),PRICE_LABEL_POSITION,CDbl(askValue)
End Sub
See Also
Back to VTL Client Script Index
|