TRIX is a momentum oscillator that displays the percent rate of change of a triple exponentially smoothed moving average. It was developed in the early 1980's by Jack Hutson, an editor for Technical Analysis of Stocks and Commodities magazine. With its triple smoothing, TRIX is designed to filter insignificant price movements. Chartists can use TRIX to generate signals similar to MACD. A signal line can be applied to look for signal line crossovers. A directional bias can be determined with the absolute level. Bullish and bearish divergences can be used to anticipate reversals.
TRIX is the 1-period percentage rate-of-change for a triple smoothed exponential moving average (EMA), which is an EMA of an EMA of an EMA. Here is a breakdown of the steps involved for a 15 period TRIX.
1. Single-Smoothed EMA = 15-period EMA of the closing price
2. Double-Smoothed EMA = 15-period EMA of Single-Smoothed EMA
3. Triple-Smoothed EMA = 15-period EMA of Double-Smoothed EMA
4. TRIX = 1-period percent change in Triple-Smoothed EMA
TRIX (15,9) is quite similar to MACD (12,26,9). Both are momentum oscillators that fluctuate above and below the zero line. Both have signal lines based on a 9-day EMA. Most notably, both lines have similar shapes, signal line crossovers and centerline crosses. The biggest difference between TRIX and MACD is that TRIX is smoother than MACD. The TRIX lines are less jagged and tend to turn a bit later.
With the similarities outweighing the differences, signals applicable to MACD are also applicable to TRIX. There are three main signals to watch for. First, signal line crossovers are the most common signals. These indicate a change in direction for TRIX and price momentum. A cross above the signal line is the first bullish indication, while a cross below is the first negative implication. Second, centerline crossovers provide chartists with a general momentum bias. The triple-smoothed moving average is rising when TRIX is positive and falling when negative. Similarly, momentum favors the bulls when TRIX is positive and the bears when negative. Third, bullish and bearish divergences can alert chartists of a possible trend reversal.
Signal line crossovers are the most common TRIX signals. The signal line is a 9-day EMA of the TRIX. As a moving average of the indicator, it trails TRIX and makes it easier to spot turns. A bullish crossover occurs when TRIX turns up and crosses above the signal line. A bearish crossover occurs when TRIX turns down and crosses below the signal line. Crossovers can last a few days or a few weeks, it all depends on the strength of the move. Due diligence is required before relying on these frequent signals. Volatility in the underlying security can also increase the number of crossovers.
The centerline crossover indicates when the cup is half full (bullish) or half empty (bearish). Think of the centerline as the 50 yard line in a football game. The offense has the edge after crossing the 50 (mid point), while the defense has the edge as long as the ball remains beyond the 50. As with signal line crossovers, these centerline crossovers produce both good signals and bad signals. The key, as always, is to minimize losses on the bad signals and maximize gains with the good signals.
Bullish and bearish divergences form when the security and the indicator do not confirm one another. A bullish divergence forms when the security forges a lower low, but the indicator forms a higher low. This higher low shows less downside momentum that may foreshadow a bullish reversal. A bearish divergence forms when the security forges a higher low, but the indicator forms a lower high. This lower high shows waning upside momentum that can sometimes foreshadow a bearish reversal. Before looking at a successful divergence, note the BHP Billiton (BHP) chart with several unsuccessful divergences.
Bearish divergences do not work well in strong uptrends. Even though momentum seems to be waning because the indicator is producing lower highs, momentum still has a bullish bias as long as the indicator is above its centerline. Upward momentum may be less positive, but it is still positive as long as the cup is half full. The rise is just not as fast as before. The opposite is true for bullish divergences. These do not work well in strong downtrends. Even though the indicator shows less downside momentum with higher lows, downward momentum is still stronger than upward momentum as long as the indicator remains below its centerline.
When bullish and bearish divergences work, they do work great. The trick is separating the bad signals from the good signals. The chart below shows Ebay (EBAY) with a successful bullish divergence. The stock moved to a lower low in early July, but TRIX held well above its prior low and formed a bullish divergence. The first potential confirmation came when TRIX moved above its signal line. However, there were no confirmations on the chart at the time. These came a little later. The green arrows show EBAY breaking chart resistance with good volume and TRIX moving into positive territory. Even though confirmation occurred well off the low, there were enough signs of strength to validate the breakout.
TRIX is an indicator that combines trend with momentum. The triple smoothed moving average covers the trend, while the 1-period percentage change measures momentum. In this regard, TRIX is similar to MACD and PPO. The standard setting for TRIX is 15 for the triple smoothed EMA and 9 for the signal line. Chartists looking for more sensitivity should try a shorter timeframe (5 versus 15). This will make the indicator more volatile and better suited for centerline crossovers. Chartists looking for less sensitivity should try a longer timeframe (45 versus 15). This will smooth the indicator and make it better suited for signal line crossovers. As with all indicators, TRIX should be used in conjunction with other aspects of technical analysis, such as chart patterns.
//+------------------------------------------------------------------+ //| TRIX.mq4 | //| by Raff | //| | //+------------------------------------------------------------------+ #property copyright "Copyright © 2006, raff1410@o2.pl" //---- indicator settings #property indicator_separate_window #property indicator_buffers 6 //---- #property indicator_color1 Red #property indicator_color2 Green #property indicator_color3 Black #property indicator_color4 Aqua #property indicator_color5 DarkGray #property indicator_color6 DarkGray #property indicator_width1 1 #property indicator_width2 1 #property indicator_width3 0 #property indicator_width4 0 #property indicator_width5 1 #property indicator_width6 1 #property indicator_style1 STYLE_SOLID #property indicator_style2 STYLE_DOT #property indicator_style3 STYLE_SOLID #property indicator_style4 STYLE_SOLID #property indicator_style5 STYLE_SOLID #property indicator_style6 STYLE_SOLID #property indicator_level1 0 //---- indicator parameters extern int TRIX_Period =13; extern int Signal_Period =8; extern bool Signals =true; extern int CountBars =1500; //---- indicator buffers double ind_buffer1[]; double ind_buffer2[]; double ind_buffer3[]; double ind_buffer4[]; double ind_buffer5[]; double ind_buffer6[]; double ind_buffer7[]; //---- variables static bool TurnedUp=false; static bool TurnedDown=false; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- drawing settings IndicatorBuffers(7); SetIndexStyle(0,DRAW_LINE); SetIndexStyle(1,DRAW_LINE); SetIndexStyle(2,DRAW_ARROW); SetIndexArrow(2,233); SetIndexStyle(3,DRAW_ARROW); SetIndexArrow(3,234); SetIndexStyle(4,DRAW_LINE); SetIndexStyle(5,DRAW_HISTOGRAM); //---- indicator buffers mapping SetIndexBuffer(0,ind_buffer1); SetIndexBuffer(1,ind_buffer2); SetIndexBuffer(2,ind_buffer3); SetIndexBuffer(3,ind_buffer4); SetIndexBuffer(4,ind_buffer5); SetIndexBuffer(5,ind_buffer6); SetIndexBuffer(6,ind_buffer7); //---- name for DataWindow and indicator subwindow label IndicatorShortName("TRIX index | Period: "+TRIX_Period+", Signal Period: "+Signal_Period+" | "); SetIndexLabel(0,"TRIX"); SetIndexLabel(1,"Signal"); //---- initialization done return(0); } //+------------------------------------------------------------------+ //| TRIX | //+------------------------------------------------------------------+ int start() { if (TRIX_Period==Signal_Period) return(0); int i, limit=CountBars; if (limit>Bars) limit=Bars-1; //---- trix for(i=0; i<limit; i++) ind_buffer1[i]=iMA(NULL,0,TRIX_Period,0,MODE_SMMA,PRICE_CLOSE,i); for(i=0; i<limit; i++) ind_buffer2[i]=iMAOnArray(ind_buffer1,0,TRIX_Period,0,MODE_SMMA,i); for(i=0; i<limit; i++) ind_buffer7[i]=iMAOnArray(ind_buffer2,0,TRIX_Period,0,MODE_EMA,i); // for(i=0; i<limit-1; i++) ind_buffer1[i]=(ind_buffer7[i]-ind_buffer7[i+1])/ind_buffer7[i+1]; for(i=0; i<limit-1; i++) ind_buffer2[i]=iMAOnArray(ind_buffer1,0,Signal_Period,0,MODE_EMA,i); for(i=0; i<limit-1; i++) {ind_buffer5[i]=ind_buffer1[i]-ind_buffer2[i]; ind_buffer6[i]=ind_buffer5[i];} //---- signals i=limit-1; while(i>=0) { if (Signals==true) { if (ind_buffer2[i]<ind_buffer1[i] && ind_buffer2[i+1]>=ind_buffer1[i+1]) ind_buffer3[i]=ind_buffer2[i]-0.0001; if (ind_buffer2[i]>ind_buffer1[i] && ind_buffer2[i+1]<=ind_buffer1[i+1]) ind_buffer4[i]=ind_buffer2[i]+0.0001; if (ind_buffer3[0]==ind_buffer2[0]-0.0001 && TurnedUp==false) { Alert("Trix Buy: ",Symbol()," - ",Period()," at ", Close[0]," - ", TimeToStr(CurTime(),TIME_SECONDS)); TurnedDown=false; TurnedUp=true; } if (ind_buffer4[0]==ind_buffer2[0]+0.0001 && TurnedDown==false) { Alert("Trix SELL: ",Symbol()," - ",Period()," at ", Close[0]," - ", TimeToStr(CurTime(),TIME_SECONDS)); TurnedUp=false; TurnedDown=true; } } i--; } //---- done return(0); } //+------------------------------------------------------------------+
Comments