‘###########################################################
‘ Script Name: Custom Indicator
‘ Author: Ehab Kanani
‘ Description: This Client Script will draw a custom indicator on the chart based on your values
‘ Website: http://www.hybridsolutions.com
‘ Date: March, 22nd, 2012
‘###########################################################
Dim indKeyDim vchartIdDim vchartName Dim resultValuePublic Sub main ()Dim highArry() vchartId=chartId vchartName=ChartSymbol(Clng(vchartId))CopyHigh 0,1, bars(CLNG(vchartId)),highArryindKey=AddCustomIndicator(0, highArry,1,False)End SubPublic Sub OnTick(SymbolName)if symbolName = ChartSymbol(0) then ObjectSeriesSetValue 0,CSTR(indKey),CLNG(bars(0)),CDBL(GetHigh(0,bars(0)))end ifEnd SubPublic Sub OnCalculate(symbol ,symPeriod, openVal , highVal , lowVal , closeVal )SetIndicatorData 0,CSTR(indKey),CDbl(highVal)End Sub'''''' The function is generated when initialization script'''
Public Sub OnInit()”’TODO: initialization methodEnd Sub”’
''' The function is generated when deinitialization script'''
Public Sub OnDeInit()”’TODO: deinitialization methodEnd Sub”’
''' The OnTimer function called when the timer event occurs'''
Public Sub OnTimer()”’TODO: Timer FunctionEnd Sub
See Also