Skip to main content

TEMA Strategy

Discover our TEMA Strategy PineScript template, designed for traders seeking to use TEMA indicator. Easily backtest on TradingView and live execute this template on AlgoTest.
Adjusting inputs like TEMA Length, target points, and stop loss points to suit your trading preferences.

TEMA Indicator Pinescript

strategy("TEMA Strategy", overlay=true)

// Input parameters
length =, title="TEMA Length")
target_points =, title="Target Points")
stop_loss_points =, title="Stop Loss Points")

// Calculate TEMA
ema1 = ta.ema(close, length)
ema2 = ta.ema(ema1, length)
ema3 = ta.ema(ema2, length)
tema = 3 * ema1 - 3 * ema2 + ema3

// Strategy logic
long_condition = ta.crossover(close, tema)
short_condition = ta.crossunder(close, tema)

// Plot TEMA
plot(tema,, title="TEMA")

// Strategy entry
if long_condition
strategy.entry("Long", strategy.long)

if short_condition
strategy.entry("Short", strategy.short)

// Calculate target and stop loss levels
long_target = strategy.position_avg_price + target_points
long_stop_loss = strategy.position_avg_price - stop_loss_points
short_target = strategy.position_avg_price - target_points
short_stop_loss = strategy.position_avg_price + stop_loss_points

// Strategy exit
strategy.exit("Long Exit", "Long", limit=long_target, stop=long_stop_loss)
strategy.exit("Short Exit", "Short", limit=short_target, stop=short_stop_loss)

Understanding the TEMA Indicator

History of the TEMA Indicator:

The Triple Exponential Moving Average (TEMA) indicator was developed by Patrick G. Mulloy in 1994 as an enhancement to traditional exponential moving averages (EMAs). Mulloy aimed to reduce lag while maintaining smoothness by applying multiple exponential smoothing to the price data. TEMA is considered a significant advancement in moving average indicators, offering traders a more responsive tool for trend identification and analysis.

A Brief About TEMA Indicator:

The TEMA indicator is a type of moving average that applies triple exponential smoothing to price data. It provides a smoother representation of price movements compared to traditional EMAs while maintaining responsiveness to recent price changes. TEMA consists of three exponential moving averages, each with a different period, and the resulting line provides insights into the underlying trend direction.

How to Use the TEMA Indicator for Analysis:

  1. Identifying Trends: TEMA helps traders identify trends by smoothing out price fluctuations. When the TEMA line slopes upwards, it indicates an uptrend, while a downward slope suggests a downtrend.

  2. Signal Generation: Traders use TEMA crossovers with price or other moving averages to generate buy or sell signals. A bullish crossover occurs when the TEMA line crosses above the price or another moving average, signaling a potential buy opportunity. Conversely, a bearish crossover suggests a sell opportunity.

  3. Confirmation Tool: TEMA can be used as a confirmation tool in conjunction with other technical indicators or chart patterns. For example, traders may look for TEMA confirmation when identifying support or resistance levels or when analyzing chart patterns like triangles or wedges.

Best Use Cases for TEMA Indicator:

  1. Trend Trading: TEMA is highly effective in trend-following strategies, where traders aim to capitalize on sustained price movements in the direction of the trend.

  2. Volatility Analysis: TEMA's responsiveness to price changes makes it suitable for analyzing market volatility. Traders can use TEMA to identify periods of increased volatility or to filter out noise during choppy market conditions.

  3. Reversal Trading: TEMA crossovers can also be used to identify potential trend reversals. Traders may look for divergences between TEMA and price movements to anticipate trend changes.

FAQs about TEMA Indicator:

What is the TEMA indicator?

The TEMA indicator is a type of moving average that applies triple exponential smoothing to price data, providing a smoother representation of price movements.

How to read TEMA indicator?

Traders can interpret TEMA by analyzing its slope and crossovers with price or other moving averages to identify trends and potential trade opportunities.

What is a TEMA?

TEMA stands for Triple Exponential Moving Average, a technical indicator used by traders to analyze price trends and generate buy or sell signals.

What is the TEMA DEMA strategy?

The TEMA DEMA strategy combines the Triple Exponential Moving Average (TEMA) indicator with the Double Exponential Moving Average (DEMA) indicator to identify trend reversals and generate trading signals.

For more detailed strategies and settings, visit AlgoTest's Strategy Builder and Signals for practical applications of the Supertrend indicator in real market scenarios.