Substract(Array1, Array2) as Array OR Substract(Array, Number) as Array

Substract function returns the substraction of the two arrays, item by item or the substraction of each item of the array with the number.

 

This function has two parameters:
Array   An array, no matter the size.
Number   The number to substract at each item of the array

 

Example:

' This is an indicator
' It shows the difference between the simple and the exponential moving averages.
Sub Main()
  TArr = SMA(GetClose, 10)
  TArr2 = EMA(GetClose, 10)
  SetIndic(Substract(TArr, TArr2))
End Sub