TRIX With Moving Average - Didi's Needles setup
Nov 21, 2022

The TRIX With Moving Average - Didi indicator provides a momentum-based oscillator pre-configured for the "Didi's Needles" setup to identify trend changes and momentum shifts.
Usage
The Usage section describes how the script can be used to identify market momentum and potential entry points.
Didi's Needles Setup
This indicator is optimized for the "Agulhada do Didi" (Didi's Needles) strategy. Traders typically look for moments when the TRIX line and its Moving Average converge closely near the zero line and then "needle" or fan out. This expansion often precedes a strong directional move in price.
Trend Identification
The relationship between the TRIX line and the signal Moving Average helps determine the current short-term trend:
- Bullish Momentum: When the TRIX line crosses above the Moving Average and the area is filled with the TRIX color, it suggests increasing upward momentum.
- Bearish Momentum: When the TRIX line crosses below the Moving Average and the area is filled with the MA color, it indicates growing downward momentum.
Cross Alerts
The script includes visual markers (cross shapes) and built-in alerts for whenever the TRIX line intersects with the Moving Average, signaling potential reversals or trend continuations.
Details
The TRIX (Triple Exponential Average) is a momentum oscillator that displays the percent rate of change of a triple exponentially smoothed moving average. In this specific implementation, the script calculates the log of the closing price before applying the triple EMA smoothing, which helps in normalizing price fluctuations.
The indicator then calculates a secondary signal line (the Moving Average). By default, it uses a Simple Moving Average (SMA), but it can be toggled to an Exponential Moving Average (EMA) depending on the trader's preference for sensitivity. The "Fill" feature provides a visual representation of the distance between these two lines, making it easier to spot periods of high volatility or consolidation.
Settings
- TRIX Length: Determines the period used for the triple exponential smoothing of the price.
- Moving Average: Sets the period for the signal line applied to the TRIX value.
- Use Ema?: A toggle to switch the signal line calculation between a Simple Moving Average (False) and an Exponential Moving Average (True).
- Fill?: Enables or disables the background color fill between the TRIX line and the Moving Average.
- TRIX Color: Customizes the color of the TRIX line and its associated fill area.
- MA Color: Customizes the color of the Moving Average line and its associated fill area.
FAQ
How do I interpret the zero line in this indicator?
The zero line represents the point where the rate of change is neutral. TRIX values above zero generally indicate an uptrend, while values below zero indicate a downtrend.
What is the advantage of using the log price in TRIX?
Using the natural logarithm of the price helps to stabilize the variance in the oscillator, especially for assets with high price volatility or those that have experienced significant price growth over time.
How can I access this indicator?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.