Syntax
public static TRIX Series(DataSeries source, int period)
public TRIX(DataSeries source, int period, string description)
Parameter Description
source |
The source DataSeries |
period |
Indicator calculation period |
Description
TRIX displays the percentage Rate of Change,
ROC, of a triple exponentially-smoothed moving average,
EMA, over the specified Period. TRIX oscillates above and below the zero value. The indicator applies triple smoothing in an attempt to eliminate insignificant price movements within the trend that you're trying to isolate.
Interpretation
TRIX generates a signal when it changes direction (turns up or down). Alternately, you can create a signal line using a moving average and wait until TRIX crosses this signal line.
Example
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators;
namespace WealthLab.Strategies
{
public class MyStrategy : WealthScript
{
protected override void Execute()
{
/* Buy when TRIX turns up from below zero.
Sell when TRIX crosses above zero. */
int Per = 24;
DataSeries trix = TRIX.Series( Close, Per );
ChartPane TRIXPane = CreatePane( 25, true, true );
PlotSeries( TRIXPane, trix, Color.Brown, WealthLab.LineStyle.Solid, 2 );
for(int bar = 60; bar < Bars.Count; bar++)
{
if (!IsLastPositionActive)
{
if( TurnUp( bar, trix ) && ( trix[bar] < 0 ) )
BuyAtMarket( bar+1 );
}
else
{
if( CrossOver( bar, trix, 0 ) )
SellAtMarket( bar+1, LastPosition );
}
}
}
}
}