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

Ethereum Turtle Strategy: Dual Donchian Breakout with a 10-Bar Exit Channel

An open-source (MPL 2.0) Turtle-style breakout strategy from 3Commas. It enters on a 20-bar Donchian breakout confirmed by a second 20-bar channel shifted 20 bars, and trails the exit with a 10-bar channel. The author chart is ETHUSDT 4-hour. Optional percent take-profit is off by default. Rules follow the source; no invented backtest figures.

Illustrated guidesPine Script®Included with monthly & annual plans
← All strategies
3Commas · 1.0 · 2026-11-20 · Breakouts
Ethereum Turtle Strategy: Dual Donchian Breakout with a 10-Bar Exit Channel

The idea

This open-source strategy from 3Commas follows the Turtle playbook: trade in the direction of a channel breakout, then leave on a shorter exit channel. The script does not use a single Donchian. It builds two 20-bar channels, then shifts the second one 20 bars to the right. A trade is taken only when the faster channel breaks and the close is also beyond that slower, shifted channel.

The chart on the publication page is Binance ETHUSDT on the 4-hour timeframe, so this page is filed under ETH. The script is not hard-coded to one symbol and will load on others, but the walkthrough and the image stay with the author’s chart. Percent take-profit is optional and off by default. A later section can send 3Commas webhook alerts; those settings are not part of the entry math.

Author chart of the Turtle dual-channel breakout strategy on BINANCE:ETHUSDT 4-hour
Author chart: BINANCE:ETHUSDT, 4-hour timeframe, taken from the publication page. The image shows the strategy UI and trade marks; it only illustrates appearance and is not a Coinpred backtest.

Indicators

  • Channel 1 (default 20): the 20-bar high and low — a standard Donchian, via ta.highest(high, period) and ta.lowest(low, period).
  • Channel 2 (default length 20, offset 20): the same 20-bar high/low, then shifted 20 bars, used as confirmation.
  • Exit channel (default 10): a 10-bar high/low that ratchets only in the trade’s favor for longs and shorts.
  • Breakouts are evaluated on a closed bar: a long, for example, needs the close to cross above the prior bar’s Channel 1 upper band, with barstate.isconfirmed set, so a forming bar cannot fire early.

Entry rules

  • The default side is both long and short. The Strategy input can restrict that to long only, short only, or no orders at all.
  • Long: the close crosses above the previous Channel 1 upper band, the close is also above the previous Channel 2 upper band, and the script’s inbuy flag is still false.
  • Short: the close crosses below the previous Channel 1 lower band, the close is also below the previous Channel 2 lower band, and insel is still false.
  • If Use Custom Test Period is on, only signals inside that window reach the Strategy Tester. The input is off by default.
  • Tester orders are named Buy and Sell. The default size is 1% of equity, with 0.1% commission and a slippage setting of 5.

Exits and position sizing

  • The long exit line is the higher of its previous value and the current 10-bar lowest low, so it only tightens. The short exit line only moves down.
  • A confirmed close back through the long exit line closes Buy with strategy.close; a close through the short exit line closes Sell.
  • Percent take-profit is off unless you enable Take Profit %. The limit is then close × (1 ± percent) from the signal bar, default 20%, submitted with strategy.exit. The stop argument is explicitly na, so that exit does not also act as a stop.
  • The chart plots average entry, the exit line, and the optional target. The two Donchian plots are hidden by default (display.none); turn them on in the style panel if you want to see the channels.
  • The 3Commas Integration block can fire alert() messages for entries and exits. Leaving those fields blank does not change how the strategy places orders on the chart.

Inputs (source defaults)

InputDefaultPurpose
Period Channel 120Faster Donchian length used to trigger the breakout
Period Channel 220Length of the confirmation channel
Offset20Bars the confirmation channel is shifted
Period Exit10Length of the trailing exit channel
StrategyLong & ShortOrder direction: both, long only, short only, or none
Take Profit %Off / 20Optional percent target; disabled by default
Use Custom Test PeriodOffRestrict the tester to a date range
Test Start / End2013-01-02 / 2030-12-02Default window if the custom period is enabled
3Commas IntegrationOptionalAlert text and toggles for 3Commas webhooks; not an entry filter

Things to know before using it

  • The strategy sets calc_on_every_tick=true, and also enables use_bar_magnifier and fill_orders_on_standard_ohlc. Entries wait for barstate.isconfirmed, but tester fills can still differ from a close-only script.
  • inbuy and insel are script-side flags, cleared after an exit or a take-profit hit. They usually track strategy.position_size, but they are not the broker position.
  • The publication text sometimes calls this an indicator; the source uses strategy(). The channels are hidden by default, which can make the chart look like it has no bands.
  • The default size is 1% of equity, which is conservative for watching signals. Larger size scales up both swings and drawdowns.
  • This page explains the rules and inputs. It is not an assessment of 3Commas bots or any copy-trading service.

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 the full source and save.
  3. Click Add to chart. To match the author image, start with ETHUSDT on the 4-hour timeframe.
  4. Turn on Upper/Lower Channel 1 and Channel 2 if you want the bands visible, then decide whether to enable the percent target.
  5. Study signals and fills in the Strategy Tester before setting alerts. Past results do not guarantee future returns.

About backtest figures

Source, license and version

  • Source: https://www.tradingview.com/script/9qFCuXqF-3Commas-Turtle-Strategy/
  • Author: 3Commas. Source version 1.0 (Pine v6), scriptAccess=open_no_auth.
  • License: Mozilla Public License 2.0. Redistribution must keep the copyright and license notices; modified files must remain under MPL 2.0. Coinpred ships the unmodified full source.
  • Members can download the .pine file on this page to study the rules. Judge the risk yourself, and follow your venue’s rules.

Source, license and version

Mozilla Public License 2.0 (MPL 2.0),© 3Commas,依据源码头部许可声明。再分发须保留原版权与许可声明;如修改源码文件,修改后的文件仍须按 MPL 2.0 提供。Coinpred 未修改源码。 / Licensed under MPL 2.0 per the source header, © 3Commas. 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.