TrixAvg | Mastock Help

Short Name: TrixAvg

Definition: Array of values representing the smoothed line of the Trix indicator (triple exponential average)

Usage: trixAvg(15,9)

Objective:
  • Retrieve the Trix average values
  • Returns an array of values.

Note:
  • Usual parameter values are 15 and 9

Examples:
  • trix(15,9)
  • Trix Trend:
  • premier0 = trix(15,9)
  • premier1 = shiftedRight(premier0,1)
  • premier2 = shiftedRight(premier0,2)
  • dummy = (premier2 - premier1) / (premier1 - premier0)
  • testPlus = (dummy < 0) & (premier2 > premier1)
  • testMoins = (dummy < 0) & (premier2 < premier1)
  • buy = crossAbove(choose(testPlus,100,0),50)
  • sell = crossAbove(choose(testMoins,100,0),50)
  • notifyresult(buy,sell)