Knowledgebase:
SetIndicatorData
Posted by Mohammad Rahhal, Last modified by Rawan Al Hourani on 17 July 2017 11:11 AM

Public Function SetIndicatorData(chart_ID As String, indName As String, value As Double)

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, value of type String .
value The new value for the indicator to be set , 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

(0 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