‘###########################################################
‘ 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 objIDDim SymbolName Dim askValue'''''' The main function is the entry point for any Script program'''
Public Sub main()fontSize=8objID=”Pricelabel1″XPos=10YPos=10SymbolName=ChartSymbol(0)SymbolSelect CSTR(SymbolName),CBool(True)SymbolInfoDouble CSTR(SymbolName) ,2,askValueif not AddPricelabel (0,0,CDbl(askValue),CSTR(objID)) then AlertMessage ErrorDescription(GetLastError())end ifEnd Sub”’
''' The function is generated when a new tick is received fro any symbol'''
Public sub OnTick(SymbolName)if not SymbolInfoDouble( CSTR(SymbolName) ,2,askValue) then AlertMessage ErrorDescription(GetLastError())End ifSetPricelabel 0,CSTR(objID),PRICE_LABEL_POSITION,CDbl(askValue)End Sub
See Also