Syntax
Public Sub NewTick (chart_Index as integer, IndicatorName as string , newvalue as double)
This function is used to update close price for last candle that was added before by AddCustomIndicatorCandles method in the specified chart.
Parameters
Parameters |
Description |
chart_index |
Chart position on the chart windows, 0 means the current chart, value of type integer |
IndicatorName |
Name of added indicator, value of type String. |
Newvalue |
The new value for the indicator to be set, value of type Double. |
Return value
No return value.
Sample
Dim indKey
Dim vchartId
Dim vchartName
Dim resultValue
Public Sub Main()
Dim OpenArry()
Dim highArry()
Dim LowArry()
Dim CloseArry()
vchartId=chartId
vchartName=ChartSymbol(Clng(vchartId))
CopyOpen 0,1, bars(0),OpenArry
CopyHigh 0,1, bars(0),highArry
CopyLow 0,1, bars(0),LowArry
CopyClose 0,1, bars(0),CloseArry
indKey=AddCustomIndicatorCandles(0, openArry , highArry,lowArray , closeArry ,1,False,0,"Indicator",VbRed,VbBlue)
End Sub
Public Sub OnTick(SymbolName)
if symbolName = ChartSymbol(0) then
NewTick 0,CSTR(indKey),CDBL(GetHigh(0,bars(0)))
end if
End Sub
See Also
Back to VTL Client Script Index
|