Syntax
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 toadd new candle to specified indicator which is 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 |
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.
Sample
Dim indKeyDim vchartIdDim vchartNameDim resultValuePublic 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 SubPublic Sub OnCalculate(symbol ,symPeriod, openVal , highVal , lowVal , closeVal ) NewCandle 0,CSTR(indKey),cdbl(openVal),CDbl(highVal) ,CDbl(lowArray) ,CDbl(closeArry)End Sub
See Also