Posted by Mohammad Rahhal, Last modified by Ismail Moamer on 18 October 2021 12:05 PM


Public Sub NewCandle (Chart_Index as integer , indName as string , OpenValue as double , HighValue as double , LowValue as double , CloseValue as double )

This function is used to add new candle to specified indicator which is added before by AddCustomIndicatorCandles method in the specified chart.


Parameters Description 
chart_index Chart position on the chart windows, 0 means the current chart, value of type integer
ArrOpen The open prices array to be drawn. Value of type double
arrHigh The High prices array to be drawn. Value of type double
arrLow The Low prices array to be drawn. Value of type double
ArrClose The close prices array to be drawn. Value of type double
indName Name of added indicator, value of type String

Return value

No return value.


Dim indKey

Dim vchartId

Dim vchartName

Dim resultValue

Public Sub Main()

    Dim OpenArry()

    Dim highArry()

    Dim LowArry()

    Dim CloseArry()



      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 OnCalculate(symbol ,symPeriod, openVal , highVal , lowVal , closeVal )

      NewCandle 0,CSTR(indKey),cdbl(openVal),CDbl(highVal) ,CDbl(lowArray) ,CDbl(closeArry)

End Sub

See Also

Back to VTL Client Script Index

(0 vote(s))
Not helpful

Comments (0)
Post a new comment
Full Name:
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