NEWCard payments are live · from $18/month, USDT also acceptedSee plans
COINPRED / STRATEGY LIBRARY

Triple EMA Trend Strategy for Bitcoin: ADX Filter with ATR Stops and Targets

An open-source (MPL 2.0) trend strategy by cyatophilum that only enters when three EMAs line up and ADX is above 43, with fixed ATR-based stops and targets. Includes the author’s BTC perpetual 4-hour chart, an inputs guide and setup steps. No invented backtest figures.

Illustrated guidesPine Script®Included with monthly & annual plans
← All strategies
cyatophilum · 2.0 · 2026-10-30 · Trend following
Triple EMA Trend Strategy for Bitcoin: ADX Filter with ATR Stops and Targets

The idea

This is a trend-following system that waits until a trend is already under way. Rather than calling tops and bottoms, it enters only once three EMAs are stacked in order and ADX confirms the move is strong. Stop-loss and take-profit levels are set from ATR at entry and are never moved afterwards.

Despite “Turtle” in the title, the script does not use the classic Turtle Donchian-channel breakout. Its core is EMA alignment filtered by ADX. It is a Pine Script v6 strategy(), so it runs straight in the Strategy Tester.

Author chart of the Triple EMA Trend strategy on the BTCUSDT perpetual 4-hour chart, with stop/target lines and an ADX pane
Author showcase: BINANCE:BTCUSDT.P (Binance BTC perpetual), 4-hour chart, taken from the publication page. Both long and short trades are enabled here, unlike the long-only default in the source. It shows what the signals and stop/target lines look like; it is not a Coinpred backtest.

Indicators

  • Three EMAs of the close: fast 30, mid 46 and slow 80.
  • ADX: the script computes DMI/ADX itself (RMA-smoothed +DI and −DI) over 14 bars. A trend only counts as strong when ADX is above 43, which is a demanding threshold, so expect relatively few trades.
  • ATR(14): used only on the entry bar to size the stop and target distances.

Entry rules

  • Long: ADX above 43, fast EMA > mid EMA > slow EMA, and the close above the fast EMA.
  • Short: ADX above 43, fast EMA < mid EMA < slow EMA, and the close below the fast EMA.
  • Only one trade at a time: no new entry until the current one has hit its stop or target.
  • Signals are confirmed on the bar close; with TradingView’s default fills, orders execute at the next bar’s open.

Exits and position sizing

  • Stop-loss: 1.8 × ATR from the signal bar’s close (below for longs, above for shorts).
  • Take-profit: 3.3 × ATR from the same close. With the defaults, the target sits about 1.8 times as far away as the stop. That is a parameter ratio, not a win rate or an expected return.
  • Both orders are placed once at entry through strategy.exit (stop and limit) and are not trailed.
  • Size: 5% of equity per trade, with 0.075% commission.

Inputs (source defaults)

InputDefaultPurpose
ADX Length14Lookback for DMI/ADX
ADX Threshold43Minimum ADX required to enter
EMA Fast / Mid / Slow30 / 46 / 80EMAs used to check alignment
ATR Length14Volatility basis for stop and target
Stop Loss ATR Multiplier1.8Stop distance = 1.8 × ATR
Take Profit ATR Multiplier3.3Target distance = 3.3 × ATR
Start / End Date2021-01-01 / 2030-07-20Backtest window (written in UTC+3)
Go Long / Go ShortOn / OffLong-only by default

Things to know before using it

  • It is long-only by default. The shorts in the author’s chart appear because Go Short was switched on.
  • With shorts switched off, the script still tracks a “virtual” short whenever a short setup appears, and it skips new long signals until that virtual trade reaches its own stop or target. That is how the current code behaves, so keep it in mind when reading backtests.
  • Stops and targets are anchored to the signal bar’s close, while the fill happens at the next open, so large gaps can push the two apart.
  • There is no request.security call and no external library. fill_orders_on_standard_ohlc is enabled, so fills use standard OHLC prices even on Heikin Ashi charts.
  • The author only shows the BTC perpetual on the 4-hour chart. Backtest other coins or timeframes on their own and consider re-tuning the ADX threshold first.

Installing it on TradingView

  1. Download the .pine file from Coinpred (active membership required, see below), or check the original page for the latest version.
  2. Open the Pine Editor on TradingView, create a blank script, paste in the full source and save.
  3. Click Add to chart. ADX appears in a separate pane, while the EMAs and stop/target lines are drawn on the price chart.
  4. Check the defaults against the table above, then adjust them for your market and timeframe.
  5. Study the signals and fills in the Strategy Tester before setting up alerts. Past results do not guarantee future returns.

About backtest figures

Source, license and version

  • Author: cyatophilum. Original title: Turtle Strategy - Triple EMA Trend with ADX and ATR. Version 2.0 (pine-facade).
  • License: Mozilla Public License 2.0 (MPL 2.0). Coinpred provides the full, unmodified source.
  • Original page: https://www.tradingview.com/script/vzXlqRCT-Turtle-Strategy-Triple-EMA-Trend-with-ADX-and-ATR/
  • Pine version: v6; script type: strategy().
  • Images come from the author’s publication page, are not covered by the MPL, and are captioned “Author showcase”.
  • Downloads are subject to Coinpred membership terms. If you modify the source file, the modified file must remain under MPL 2.0.

Source, license and version

Mozilla Public License 2.0 (MPL 2.0),© cyatophilum,依据源码头部许可声明。再分发须保留原版权与许可声明;如修改源码文件,修改后的文件仍须按 MPL 2.0 提供。Coinpred 未修改源码。 / Licensed under MPL 2.0 per the source header, © cyatophilum. Redistribution must keep the copyright and license notices; modified files must remain under MPL 2.0. Coinpred ships the unmodified source.

View original source ↗

Check the script license and your TradingView account features. Historical results do not guarantee future performance.