Summary: This indicator script is used to add two underlying indicators. Calculation: The sum of the two underlying indicators.
' Assign the parameters to script variables. _indicatorKey1 = indicatorKey1 _indicatorKey2 = indicatorKey2
' Get the underlying indicator values, indexed by bar index. Define values1() As Number = IndicatorValues(_indicatorKey1, barIndex, length) ' Get the underlying indicator values, indexed by bar index. Define values2() As Number = IndicatorValues(_indicatorKey2, barIndex, length) ' Use for the calculated Add Indicators values, indexed by bar index. Define results(length - 1) As Number ' Calculate the Add Indicators values for the specified bar range. For i As Integer = length - 1 To 0 Step -1 ' Calculate and assign the Add Indicators value for the current bar. results(i) = values1(i) + values2(i) Next Return results