Trix(Period) as Array

Trix returns an array containing the Trix indicator of the selected period.

 

This function has one parameter:
Period   Enter the period to calculate the Trix indicator

 

Example:

' This is a system based on the Trix indicator
Sub Main()
  TrArr = Trix(12)
  TrArrSMA = SMA(TrArr, 9)
  For CurrentBar = BeginBar to EndBar
    If Cross(TrArr, TrArrSMA, CurrentBar) then
      Buy(CurrentBar)
    End If
    If Cross(TrArrSMA, TrArr, CurrentBar) then
      Sell(CurrentBar)
    End If
  Next
End Sub