Syntax
Public Function SetIndicatorData(chart_ID As String, indName As String, value As Double)
Description
This function is used to update the custom indicator which is added before by AddCustomIndicator method in the specified chart.
Parameters
Key |
Description |
chart_Id |
Chart identifier, 0 is the current chart, value of type String.
|
indName |
Name of added indicator, a value of type String. |
value |
The new value for the indicator to be set, a value of type Double. |
Return value
No value returned.
Sample
Dim indKey
Dim vchartId
Dim vchartName
Dim resultValue
Public Sub Main()
Dim highArry()
vchartId=chartId
vchartName=ChartSymbol(Clng(vchartId))
CopyHigh 0,1, bars(0),highArry
indKey=AddCustomIndicator(0, highArry,0)
End Sub
Public Sub OnTick(SymbolName)
ObjectSeriesGetValue 0,cstr(vchartName & ".high"),bars(0),resultValue
ObjectSeriesSetValue 0,CSTR(indKey),bars(0),CDBL(resultValue)
End Sub
Public Sub OnCalculate(symbol ,symPeriod, openVal , highVal , lowVal , closeVal )
SetIndicatorData 0,CSTR(indKey),CDbl(highVal)
End Sub
See Also
Back to VTL Client Script Index
|