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

BTC Ichimoku: Enter a Trend long on a conversion-line cross above the cloud, or a Pamp long on a cloud break, then trail with ATR by default

An open-source trend strategy by mikul_se (MPL 2.0), published as "mikul's Ichimoku Cloud Strategy v 2.0". It is long-only. A Trend entry needs the conversion line to cross above the base line while both lines sit above the cloud; a Pamp entry needs price above the cloud plus just-triggered break conditions. The default exit is an ATR trail from the recent swing low. The author's chart is BINANCE:BTCUSDT on the 4-hour timeframe. The rules follow the source; this page invents no backtest figures.

Illustrated guidesPine Script®Included with monthly & annual plans
← All strategies
mikul_se · 1.0 · 2026-12-01 · Trend following
BTC Ichimoku: Enter a Trend long on a conversion-line cross above the cloud, or a Pamp long on a cloud break, then trail with ATR by default

The idea

This is mikul_se's open-source script, published as "mikul's Ichimoku Cloud Strategy v 2.0". It uses a standard Ichimoku set for long entries, but it splits those entries into two order names: Trend and Pamp. The script never opens a short. By default it also does not exit on classic Ichimoku reversals; it trails with ATR, and the Ichimoku exit has to be switched on in the inputs.

The author's published chart is BINANCE:BTCUSDT on the 4-hour timeframe, so this page lists it as a BTC strategy. The script does not hard-code a symbol. Several inputs use confirm=true, so TradingView may show a confirmation dialog the first time you add it to a chart.

Author chart of mikul_se's Ichimoku strategy on BINANCE:BTCUSDT 4-hour
Author chart: BINANCE:BTCUSDT, 4-hour, from the script's publication page. The image shows the conversion line, base line, cloud, and trade markers. It is only a visual example, not a performance record.

How the lines are built

  • The conversion line is the midpoint of the highest high and lowest low over conversionPeriods (default 9). The base line uses basePeriods (default 26). That is the script's donchian() helper.
  • Leading span A is the midpoint of the conversion and base lines. Leading span B is the midpoint of the high-low range over laggingSpan2Periods (default 52).
  • The uppercloud and bottomcloud values compared with price are leading spans A and B from displacement-1 bars ago (25 bars at the default). That is roughly the cloud drawn on the current bar.
  • The lagging span is plotted by shifting close left by -displacement+1 bars. In the exit calculations, lagging_span is simply the current close.
  • The moving-average filter is off by default. When enabled, it can be EMA, SMA, WMA, HMA, VWMA, or VWAP (default 200-period EMA), and the close must be above that average before an entry is allowed.
  • The default trail uses a 14-period ATR times 1.0 against the lowest low of the last 7 bars for a long.

Entries

  • Longs only, and only when the strategy is flat (strategy.position_size == 0). If Trend and Pamp are both true on the same bar, the source uses trend ? "Trend" : "Pamp", so only a Trend order is placed.
  • Trend: close is above the close from displacement bars ago; close is above both the current uppercloud and bottomcloud and is a bullish candle (close > open); the conversion line has just crossed above the base line, and both lines are above both edges of that cloud. If the MA filter is on, close must also be above the filter average.
  • Pamp: close is above the uppercloud and bottomcloud from an extra displacement bars back, and above the high from displacement bars ago; close is also above both current cloud edges and is a bullish candle; leading span A is above leading span B; and the conversion line is above the base line. On top of that, at least one of these "just happened" checks must be true: the previous close was not yet above the further-displaced cloud, or the current close is not above the high from displacement+1 bars ago; the previous close was not yet above the then-current cloud; or leading span A was not above leading span B on the previous bar. The MA filter works the same way as for Trend.
  • On entry the script clears trailPrice, then rebuilds the stop from the exit rules below.

Exits and sizing

  • The default Exit method is ATR and Exit source is Lows/Highs: the next long stop is the lowest low over swingLookback bars (default 7) minus ATR times the multiplier. The stored trailPrice only ratchets up when the new stop is higher, or when trailPrice is still na.
  • If you change Exit source to Close or Open, the ATR stop is taken from that price minus ATR. If Exit method is Percent, Trailing percent (default 10%) is applied to the same source.
  • Use take profit is off by default. When enabled, the limit is the average entry price plus Take profit percentage (default 25%), sent together with the trail in strategy.exit.
  • If Exit method is Ichi exit, or Add ichimoku exit is enabled, the script also market-closes Trend and Pamp when short_signal is true. That condition packs a close crossing under displaced hlc3 and a base-line cross above the conversion line with price under the leading spans into one line; and binds tighter than or, so the logic may not match a casual reading of the sentence. Default inputs do not take this branch.
  • Orders are 10% of equity, with initial capital 10,000 and a 0.075% commission. At the end of the script, a trailPrice = 0 assignment when flat is a local variable and does not clear the outer trailPrice.

Inputs (defaults in the source)

InputDefaultWhat it does
Exit source / Exit methodLows/Highs / ATRPrice source and formula for the trailing stop; default is swing low minus ATR
Trailing percent10Used only when Exit method is Percent
Lookback / ATR period / ATR multiplier7 / 14 / 1.0Swing lookback, ATR length, and ATR multiple
Add ichimoku exit / Use take profitfalse / falseWhether to add the Ichimoku exit on top of ATR or percent; whether to use a percent take-profit
Take profit percentage25Take-profit versus average entry; unused by default
Use moving average filter / type / lengthfalse / EMA / 200Optional trend filter, off by default
Conversion / Base / Leading span B / Lagging span / Delta9 / 26 / 52 / 26 / 26Ichimoku lengths and displacement

Caveats

  • This is a long-only trend strategy. In chop or a sharp drop, the trailing stop may not get out quickly.
  • Some Pamp checks use the cloud and high shifted by another displacement bars, which is not exactly the cloud drawn on the current candle. Read those conditions from the source when you compare them with the chart.
  • The default path does not flatten on an Ichimoku cross. If you switch to Ichi exit, expand the source condition with Pine's operator precedence rather than relying on the input tooltip alone.
  • Each order is 10% of equity, with a 0.075% commission and 10,000 of initial capital. Live fee schedules, contract multipliers, and quote currencies often differ, so tester results are not exchange fills.
  • The script does not hard-code a symbol or timeframe. The author showed 4-hour BTC; the same defaults may not fit a much shorter timeframe or a thinner market.

Install it on TradingView

  1. Download the .pine file from Coinpred (a current membership is required; see the page) or check the original publication for a newer revision.
  2. Open the symbol and timeframe you want in TradingView, open the Pine Editor, paste the source, and add it to the chart.
  3. If a confirmation dialog appears the first time you add it, accept the defaults first, then change inputs for your market and timeframe.
  4. The order size, margin, and commission in the source apply to the strategy tester only. Live order routing has to be set separately.
  5. Crypto trades around the clock. The tester's timezone and session settings may differ from your venue by several hours.

About backtest figures

Source, license, and version

  • Source: https://www.tradingview.com/script/1WGNT8Jl-mikul-s-Ichimoku-Cloud-Strategy-v-2-0/
  • Author: mikul_se (header © mikul_se)
  • License: Mozilla Public License 2.0. Redistribution must keep the original copyright and license notices; if you modify the source file, the modified file must remain under MPL 2.0. Coinpred ships the unmodified source.
  • Version: 1.0 in the publication record and pine-facade; the script title says v 2.0. scriptAccess is open_no_auth.

Source, license and version

Licensed under MPL 2.0 per the source header, © mikul_se. 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.

More strategies

All strategies →