Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

Ultimate Ichimoku Cloud Strategy

A Pine Script v5 strategy built on Crossover (conversion_line, base_line) and Crossunder (conversion_line, base_line). It has 6 order rules, 2 entries among them, and trades long and short with the default settings. Exits use a stop loss and a profit target. Each trade commits 100% of equity and pays no commission. 35 settings; defaults include Conversion Period 9, Base Line Period 26 and Lagging Span Period 52.

Generated from the script's code by a template: every clause is a fact read from the source. Not written by a person or a model, and not taken from the author's description.

Does Ultimate Ichimoku Cloud Strategy repaint?
No
No repainting patterns were found in the source. The live replay was not measured: it had no trades to compare.
How did Ultimate Ichimoku Cloud Strategy do on BTCUSDT 1D with default settings?
Not measured
It closed no trades there from 26 Jan 2024 to 21 Oct 2026 with the default settings, so there is no result to report. Its code limits trading to a date window, which can leave this period out. It closed no trades on the other markets either. A backtest, not investment advice.
Does Ultimate Ichimoku Cloud Strategy run in Pine Script v6?
Not tested
Neither version placed a trade on any of the 8 markets, so there was nothing to compare. The v6 version is shown for reference and is not offered as a download.
Does Ultimate Ichimoku Cloud Strategy use a stop loss?
Yes
strategy.exit sets a stop on line 95, 101.
Does Ultimate Ichimoku Cloud Strategy run in Zeal Terminal?
Yes
It compiles in 48 ms and runs 1,000 bars in 124 ms, in the browser.

BTCUSDT · 1D · default settings

  • Conversion Line (Tenkan Sen)
  • Base Line (Kijun Sen)
  • Lagging Span (Chikou Span)
  • Leading Span A (Senkou Span A)
  • Leading Span B (Senkou Span B)
  • Winning trade
  • Losing trade
  • Equity
  • Buy and hold
Prerendered with the defaults. Change anything and run it here. The script runs in your browser.
Settings (35)
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOct$1,000,000$2,025,273Equity from $1,000,000
Binance BTCUSDT 1D candles, 26 Jan 2024 to 21 Oct 2026, 1,000 bars, default settings. Triangles mark entries; circles mark exits. Lines are what the script plots.
Net profit
0.00%
$0.00
Buy and hold
+102.5%
same period
Closed trades
0
0 won · 0 lost
Profitable
0.0%
of closed trades
Profit factor
—
gross profit ÷ gross loss
Max drawdown
0.00%
$0.00

One run with the author's default settings, $1,000,000 starting capital, commission as the script sets it. A single backtest says little about future results and is not a recommendation. Backtests are simulations on historical data and are not investment advice.

Review

What a careful reader of this script would point out, found by checking the source and the backtest.

  • Check

    No commission

    The backtest assumes free trading. Results on any real exchange will be lower.

  • Check

    Every trade uses all the equity

    default_qty_value is 100% of equity.

  • Note

    2 settings have no label

    In the settings dialog i_time_start (line 7), i_time_finish (line 8) show an empty name. The labels on this page come from the variable names.

  • Note

    No slippage

    Fills are assumed at the exact open price. Add slippage in the properties for a more realistic test.

Settings

Every input the script declares, with its default and what it feeds. Bounds are the ones the script enforces.

SettingDefaultType and rangeFeeds
Backtest Range
I time start (no label in the script)timestamp("2015-12-12T00:00:00")timeline 87
I time finish (no label in the script)timestamp("2022-12-12T00:00:00")timeline 87
Ichimoku Lines
Show Conversion Line (Tenkan Sen)falseboolConversion Line (Tenkan Sen)
Show Base Line (Kijun Sen)falseboolBase Line (Kijun Sen)
Show Lagging Span (Chikou Span)falseboolLagging Span (Chikou Span)
Show Leading Span A (Senkou Span A)falseboolLeading Span A (Senkou Span A)
Show Leading Span B (Senkou Span B)falseboolLeading Span B (Senkou Span B)
Show All LinestrueboolLeading Span A (Senkou Span A) Leading Span B (Senkou Span B) Conversion Line (Tenkan Sen) Base Line (Kijun Sen) Lagging Span (Chikou Span)
Ichimoku Periods
Conversion Period9intconversion_line
Base Line Period26intbase_line
Lagging Span Period52intleading_span_B
Displacement26intlong_entry short_entry long_exit short_exit Leading Span A (Senkou Span A) Leading Span B (Senkou Span B) Lagging Span (Chikou Span)
Ichimoku Long Conditions
Conversion Crosses Basetrueboollong_entry line 60
Conversion Above Basefalseboollong_entry line 60
Positive Cloudtrueboollong_entry line 60
Price Above Cloudtrueboollong_entry line 60
Positive Chikoutrueboollong_entry line 60
Price Above Conversiontrueboollong_entry line 60
Show Condititons Visuallyfalseboolbgcolor
Ichimoku Short Conditions
Base Crosses Conversiontrueboolshort_entry line 69
Base Above Conversionfalseboolshort_entry line 69
Negative Cloudtrueboolshort_entry line 69
Price Below Cloudtrueboolshort_entry line 69
Negative Chikoutrueboolshort_entry line 69
Price Below Basetrueboolshort_entry
Show Condititons Visuallyfalseboolbgcolor
Ichimoku Long Exit Conditions
Base Crosses Conversiontrueboollong_exit line 78
Negative Chikoufalseboollong_exit line 78
Show Condititons Visuallyfalseboolbgcolor
Ichimoku Short Exit Conditions
Conversion Crosses Basetrueboolshort_exit line 83
Positive Chikoufalseboolshort_exit line 83
Show Condititons Visuallyfalseboolbgcolor
Exits vs TP/SL
Use SL and TP Instead of Exitsfalseboolclose Long exit TP/SL close Short exit TP/SL line 92 line 94 line 98 line 100
Take Profit (%)2floatexit TP/SL
Stop Loss (%)1floatexit TP/SL

What it calculates

  • Crossoverconversion_line, base_linelong_entry · line 61
  • Crossunderconversion_line, base_lineshort_entry · line 70
  • Crossunderconversion_line, base_linelong_exit · line 79
  • Crossoverconversion_line, base_lineshort_exit · line 84

Signal flow

How price data and settings reach the orders. Each box is a name in the script, or several computed the same way; each arrow is a value one of them reads. Hover a box for its members.

closecloseprice datai_displacementDisplacementsetting · 26i_conversion_line_periodConversion Periodsetting · 9i_base_line_periodBase Line Periodsetting · 26i_leading_span_periodLagging Span Periodsetting · 52long_entryCrossover→ long_entryshort_entryCrossunder→ short_entrylong_exitCrossunder→ long_exitshort_exitCrossover→ short_exitconversion_lineconversion_linevaluebase_linebase_linevalueleading_span_Aleading_span_Avalueleading_span_Bleading_span_Bvalueentry:LongOpen Longstrategy.entryclose:LongClose Longstrategy.closeexit:TP/SLexit TP/SLstrategy.exitentry:ShortOpen Shortstrategy.entryclose:ShortClose Shortstrategy.closeplot:104Conversion Line (Tenkan…plotplot:105Base Line (Kijun Sen)plotplot:106Lagging Span (Chikou Sp…plotplot:107Leading Span A (Senkou …plotplot:108Leading Span B (Senkou …plotfill:109Fillfillbgcolor:110bgcolorbgcolorbgcolor:111bgcolorbgcolorbgcolor:112bgcolorbgcolorbgcolor:113bgcolorbgcolor

Order rules

OrderFires whenBy defaultLine
Open Long long(strategy.position_size <= 0 and long_entry and dateRange())On91
Close Long(long_exit and not i_use_SLTP)On93
Exit TP/SL stop and limit(i_use_SLTP)On95
Open Short short(strategy.position_size >= 0 and short_entry and dateRange())On97
Close Short(short_exit and not i_use_SLTP)On99
Exit TP/SL stop and limit(i_use_SLTP)On101

Each order is guarded by the setting shown. “Off” orders never fire unless that setting is switched on.

Does it repaint?

No

No repainting patterns in the source.

Not measuredNo trades to compareThe last 300 bars, from 26 Dec 2025, were fed to the engine as live ticks, but neither the live nor the historical run produced any trades in them, so the replay says nothing either way.
  • ClearHigher-timeframe dataThe script requests no other symbol or timeframe.
  • ClearFuture-bar referencesNo negative history offsets such as close[-1].
  • ClearIntrabar recalculationNo varip, calc_on_every_tick or realtime-only state. Orders are decided once per closed bar.
  • ClearOrder timingprocess_orders_on_close = true: orders fill at the signal bar's close.

The checks read the source; the replay runs it. Together they catch the common causes, not every possible one.

Other markets

The same script with default settings on 8 Binance markets. Each row is a separate backtest over the most recent 1,000 bars.

MarketNetBuy and holdTradesWonProfit factorMax drawdownPeriod
BTCUSDT 1D0.0%+102.5%00%—0.0%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h0.0%+5.5%00%—0.0%8 May 2026 – 21 Oct 2026
ETHUSDT 1D0.0%+9.8%00%—0.0%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h0.0%+8.4%00%—0.0%8 May 2026 – 21 Oct 2026
SOLUSDT 1D0.0%+16.7%00%—0.0%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h0.0%+21.5%00%—0.0%8 May 2026 – 21 Oct 2026
BNBUSDT 1D0.0%+148.3%00%—0.0%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h0.0%+17.1%00%—0.0%8 May 2026 – 21 Oct 2026

Backtests are simulations on historical data and are not investment advice.

Similar scripts

No other indicator or strategy here shares enough of its calculations.

Upgrade and export

Written in Pine Script v5. The clean-v5 step types the settings and moves when = into if blocks, which v6 requires; it is run before and after like any upgrade.

  • No v6-only features. v6 is not needed to run this script.

Clean v5

Verified

Nothing to change.

Does it run in Pine Script v6?

Not tested

Neither version placed a trade on any of the 8 markets, so there was nothing to compare. The v6 version is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.

⋯// © antondmt-//@version=5+//@version=6strategy("Ultimate Ichimoku Cloud Strategy", "UIC Strategy", true, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, process_orders_on_close = true)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 48 msYes 1,000 bars in 124 msNot measured
PineTSNot testedNot testedNot measured

“Matches TradingView” needs this script's own output exported from TradingView and compared bar by bar, which has not been done for this script. The engine is built on OpenPineScript, whose conformance results are in its conformance report.

Source

Copied verbatim from the author's published script, with its licence header intact. The author may have updated the original since this snapshot.

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/// © antondmt//@version=5strategy("Ultimate Ichimoku Cloud Strategy", "UIC Strategy", true, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, process_orders_on_close = true)// Inputs {// Backtest Rangei_time_start =              input.time(timestamp("2015-12-12T00:00:00"), "Start Date", group = "Backtest Range")i_time_finish =             input.time(timestamp("2022-12-12T00:00:00"), "Finish Date", group = "Backtest Range")// Ichimoku Linesi_show_conversion =         input.bool(false, "Show Conversion Line (Tenkan Sen)", group = "Ichimoku Lines")i_show_base =               input.bool(false, "Show Base Line (Kijun Sen)", group = "Ichimoku Lines")i_show_lagging =            input.bool(false, "Show Lagging Span (Chikou Span)", group = "Ichimoku Lines")i_show_span_A =             input.bool(false, "Show Leading Span A (Senkou Span A)", group = "Ichimoku Lines")i_show_span_B =             input.bool(false, "Show Leading Span B (Senkou Span B)", group = "Ichimoku Lines")i_show_all =                input.bool(true, "Show All Lines", group = "Ichimoku Lines")// Ichimoku Periodsi_conversion_line_period =  input.int(9, "Conversion Period", 1, group = "Ichimoku Periods")i_base_line_period =        input.int(26, "Base Line Period", 1, group = "Ichimoku Periods")i_leading_span_period =     input.int(52, "Lagging Span Period", 1, group = "Ichimoku Periods")i_displacement =            input.int(26, "Displacement", 1, group = "Ichimoku Periods")// Ichimoku Long Conditionsi_long_cond_1 =             input.bool(true, "Conversion Crosses Base", "Conversion line crosses up on base line.", group = "Ichimoku Long Conditions")i_long_cond_2 =             input.bool(false, "Conversion Above Base", "Conversion line is above base line", group = "Ichimoku Long Conditions")i_long_cond_3 =             input.bool(true, "Positive Cloud", "Cloud has to be positive. Span A > Span B.", group = "Ichimoku Long Conditions")i_long_cond_4 =             input.bool(true, "Price Above Cloud", "Price has to be above the clouds.", group = "Ichimoku Long Conditions")i_long_cond_5 =             input.bool(true, "Positive Chikou", "Lagging span has to be higher than price at displacement.", group = "Ichimoku Long Conditions")i_long_cond_6 =             input.bool(true, "Price Above Conversion", "Price has to be higher than conversion line.", group = "Ichimoku Long Conditions")i_long_cond_show =          input.bool(false, "Show Condititons Visually", "Draws lines when condition is true.", group = "Ichimoku Long Conditions")// Ichimoku Short Conditions i_short_cond_1 =            input.bool(true, "Base Crosses Conversion", "Base line crosses up on conversion line.", group = "Ichimoku Short Conditions")i_short_cond_2 =            input.bool(false, "Base Above Conversion", "Base line is above conversion line", group = "Ichimoku Short Conditions")i_short_cond_3 =            input.bool(true, "Negative Cloud", "Cloud has to be negative. Span B > Span A.", group = "Ichimoku Short Conditions")i_short_cond_4 =            input.bool(true, "Price Below Cloud", "Price has to be below the clouds.", group = "Ichimoku Short Conditions")i_short_cond_5 =            input.bool(true, "Negative Chikou", "Lagging span has to be lower than price at displacement.", group = "Ichimoku Short Conditions")i_short_cond_6 =            input.bool(true, "Price Below Base", "Price has to be lower than base line.", group = "Ichimoku Short Conditions")i_short_cond_show =         input.bool(false, "Show Condititons Visually", "Draws lines when condition is true.", group = "Ichimoku Short Conditions")// Ichimoku Long Exit Conditionsi_sell_long_cond_1 =        input.bool(true, "Base Crosses Conversion", "Base line crosses up on conversion line.", group = "Ichimoku Long Exit Conditions")i_sell_long_cond_2 =        input.bool(false, "Negative Chikou", "Lagging span is lower than price at displacement.", group = "Ichimoku Long Exit Conditions")i_sell_long_cond_show =     input.bool(false, "Show Condititons Visually", "Draws lines when condition is true.", group = "Ichimoku Long Exit Conditions")// Ichimoku Short Exit Conditionsi_sell_short_cond_1 =       input.bool(true, "Conversion Crosses Base", "Conversion line crosses up on base line.", group = "Ichimoku Short Exit Conditions")i_sell_short_cond_2 =       input.bool(false, "Positive Chikou", "Lagging span is higher than price at displacement.", group = "Ichimoku Short Exit Conditions")i_sell_short_cond_show =    input.bool(false, "Show Condititons Visually", "Draws lines when condition is true.", group = "Ichimoku Short Exit Conditions")// Exits vs TP/SLi_use_SLTP =                input.bool(false, "Use SL and TP Instead of Exits", group = "Exits vs TP/SL")i_TP =                      input.float(2, "Take Profit (%)", group = "Exits vs TP/SL")i_SL =                      input.float(1, "Stop Loss (%)", group = "Exits vs TP/SL")// }// Ichimoku Calculations {donchian(len) =>    math.avg(ta.lowest(len), ta.highest(len))conversion_line = donchian(i_conversion_line_period)base_line = donchian(i_base_line_period)leading_span_A = math.avg(conversion_line, base_line)leading_span_B = donchian(i_leading_span_period)// }// Entries and Exits Logic { long_entry = falseif(i_long_cond_1 or i_long_cond_2 or i_long_cond_3 or i_long_cond_4 or i_long_cond_5 or i_long_cond_6)    long_entry := (i_long_cond_1 ? ta.crossover(conversion_line, base_line) : true)          and (i_long_cond_2 ? conversion_line > base_line : true)         and (i_long_cond_3 ? leading_span_A[i_displacement - 1] > leading_span_B[i_displacement - 1] : true)          and (i_long_cond_4 ? close > leading_span_A[i_displacement - 1] and close > leading_span_B[i_displacement - 1] : true)          and (i_long_cond_5 ? close > nz(close[i_displacement + 1], close) : true)          and (i_long_cond_6 ? close > conversion_line : true)         short_entry = falseif(i_short_cond_1 or i_short_cond_2 or i_short_cond_3 or i_short_cond_4 or i_short_cond_5)    short_entry := (i_short_cond_1 ? ta.crossunder(conversion_line, base_line) : true)          and (i_short_cond_2 ? base_line > conversion_line : true)         and (i_short_cond_3 ? leading_span_A[i_displacement - 1] < leading_span_B[i_displacement - 1] : true)          and (i_short_cond_4 ? close < leading_span_A[i_displacement - 1] and close < leading_span_B[i_displacement - 1] : true)          and (i_short_cond_5 ? close < nz(close[i_displacement + 1], close) : true)          and (i_short_cond_6 ? close < base_line : true)         long_exit = falseif(i_sell_long_cond_1 or i_sell_long_cond_2)    long_exit := (i_sell_long_cond_1 ? ta.crossunder(conversion_line, base_line) : true)          and (i_sell_long_cond_2 ? close < nz(close[i_displacement + 1], close) : true)          short_exit = falseif(i_sell_short_cond_1 or i_sell_short_cond_2)    short_exit := (i_sell_short_cond_1 ? ta.crossover(conversion_line, base_line) : true)          and (i_sell_short_cond_2 ? close > nz(close[i_displacement + 1], close) : true) dateRange() =>     i_time_start <= time and time <= i_time_finish ? true : false// }// Entries and Exits {if(strategy.position_size <= 0 and long_entry and dateRange())    strategy.entry("Long", strategy.long)if(long_exit and not i_use_SLTP)    strategy.close("Long")else if(i_use_SLTP)    strategy.exit("TP/SL", "Long", stop = strategy.position_avg_price * (1 - i_SL / 100), limit = strategy.position_avg_price * (1 + i_TP / 100))if(strategy.position_size >= 0 and short_entry and dateRange())    strategy.entry("Short", strategy.short)if(short_exit and not i_use_SLTP)    strategy.close("Short")else if(i_use_SLTP)    strategy.exit("TP/SL", "Short", stop = strategy.position_avg_price * (1 + i_SL / 100), limit = strategy.position_avg_price * (1 - i_TP / 100))// }// Plots { plot(i_show_all or i_show_conversion ? conversion_line : na, "Conversion Line (Tenkan Sen)", color.new(#0496ff, 0), 2)plot(i_show_all or i_show_base ? base_line : na, "Base Line (Kijun Sen)", color.new(#991515, 0), 2)plot(i_show_all or i_show_lagging ? close : na, "Lagging Span (Chikou Span)", color.new(color.yellow, 0), 2, offset = -i_displacement + 1)span_A = plot(i_show_all or i_show_span_A ? leading_span_A : na, "Leading Span A (Senkou Span A)", color.new(color.green, 0), offset = i_displacement - 1)span_B = plot(i_show_all or i_show_span_B ? leading_span_B : na, "Leading Span B (Senkou Span B)", color.new(color.red, 0), offset = i_displacement - 1)fill(span_A, span_B, leading_span_A > leading_span_B ? color.new(color.green, 90) : color.new(color.red, 90), "Cloud Colors")bgcolor(i_long_cond_show and long_entry ? color.new(color.green, 40) : na)bgcolor(i_short_cond_show and short_entry ? color.new(color.red, 40) : na)bgcolor(i_sell_long_cond_show and long_exit ? color.new(color.purple, 40) : na)bgcolor(i_sell_short_cond_show and short_exit ? color.new(color.aqua, 40) : na)// }