Pine Script v5 · Strategy
Ichimoku Breakout Kumo SWING TRADER (By Insert Cheese)
A Pine Script v5 strategy built on Crossover (close, ss_high) and Crossunder (close, ss_low). It has 5 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 0.05% commission. 16 settings; defaults include Tenkan-Sen 9, Kijun-Sen 26 and Senkou-Span B 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 Ichimoku Breakout Kumo SWING TRADER (By Insert Cheese) repaint?
- No
- No repainting patterns were found in the source, and a live tick-by-tick replay matched history on 7 of 7 trades.
- How did Ichimoku Breakout Kumo SWING TRADER (By Insert Cheese) do on BTCUSDT 1D with default settings?
- +34.12%
- From 26 Jan 2024 to 21 Oct 2026, over 27 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
- Does Ichimoku Breakout Kumo SWING TRADER (By Insert Cheese) run in Pine Script v6?
- No
- The v6 version runs in Zeal Terminal's engine, but its results differ from the v5 version: Trades differ: 27 before, 43 after on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine. It is shown for reference and is not offered as a download.
- Does Ichimoku Breakout Kumo SWING TRADER (By Insert Cheese) use a stop loss?
- Yes
- strategy.exit sets a stop on line 84.
- Does Ichimoku Breakout Kumo SWING TRADER (By Insert Cheese) run in Zeal Terminal?
- Yes
- It compiles in 34 ms and runs 1,000 bars in 92 ms, in the browser.
BTCUSDT · 1D · default settings
- Tenkan-Sen
- Kijun-Sen
- Chikou-Span
- Senkou-Span A
- Senkou-Span B
- Plot
- Plot
- Plot
- Winning trade
- Losing trade
- Equity
- Buy and hold
- Net profit
- +34.12%
- $170.58
- Buy and hold
- +102.5%
- same period
- Closed trades
- 27
- 8 won · 19 lost
- Profitable
- 29.6%
- of closed trades
- Profit factor
- 1.38
- gross profit ÷ gross loss
- Max drawdown
- 41.78%
- −$208.91
One run with the author's default settings, $500 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
Every trade uses all the equity
default_qty_value is 100% of equity.
-
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.
| Setting | Default | Type and range | Feeds |
|---|---|---|---|
| Parámetros Ichimoku | |||
| Tenkan-Sen | 9 | int · min 1 | tenkan |
| Kijun-Sen | 26 | int · min 1 | kijun |
| Senkou-Span B | 52 | int · min 1 | senkouB |
| Chikou-Span | 26 | int · min 1 | Chikou-Span |
| Senkou-Span A | 26 | int · min 1 | Senkou-Span A Senkou-Span B ss_high ss_low |
| Backtest Operativa | |||
| Entradas Largo | true | bool | entry Buy close Buy line 64 line 68 |
| Entradas Corto | true | bool | entry Sell close Buy line 70 line 75 |
| Backtest rango de fechas | |||
| Desde Mes | 1 | int · min 1 · max 12 | inDataRange |
| Desde Año | 2000 | int · min 1970 | inDataRange |
| Desde Día | 1 | int · min 1 · max 31 | inDataRange |
| Hasta Día | 1 | int · min 1 · max 31 | inDataRange |
| Hasta Mes | 1 | int · min 1 · max 12 | inDataRange |
| Hasta Año | 2099 | int · min 1970 | inDataRange |
| SL y TP metodo | true | bool | line 81 |
| Take Profit $$ | 100.0 | float · min 0.1 · step 10.0 | pp exit Close plot |
| Stop Loss $$ | 100.0 | float · min 0.1 · step 10.0 | lp exit Close plot |
What it calculates
- Crossoverclose, ss_high
price_cross_above_kumo · line 56 - Crossunderclose, ss_low
price_cross_below_kumo · line 57
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.
Order rules
| Order | Fires when | By default | Line |
|---|---|---|---|
| Open Buy long | ( not comprado and bullish and inDataRange and long_entry_enable) | On | 66 |
| Close Buy | (comprado and bearish and inDataRange and long_entry_enable) | On | 69 |
| Open Sell short | ( not vendido and bearish and inDataRange and short_entry_enable) | On | 72 |
| Close Buy | (vendido and bullish and inDataRange and short_entry_enable) | On | 76 |
| Exit Close stop and limit | every bar | On | 84 |
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, and the live replay matched history.
- 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.
| Market | Net | Buy and hold | Trades | Won | Profit factor | Max drawdown | Period |
|---|---|---|---|---|---|---|---|
| BTCUSDT 1D | +34.1% | +102.5% | 27 | 30% | 1.38 | 41.8% | 26 Jan 2024 – 21 Oct 2026 |
| BTCUSDT 4h | +14.7% | +5.5% | 20 | 40% | 1.42 | 15.5% | 8 May 2026 – 21 Oct 2026 |
| ETHUSDT 1D | +32.3% | +9.8% | 25 | 36% | 1.22 | 38.5% | 26 Jan 2024 – 21 Oct 2026 |
| ETHUSDT 4h | −6.6% | +8.4% | 31 | 19% | 0.91 | 31.3% | 8 May 2026 – 21 Oct 2026 |
| SOLUSDT 1D | +16.0% | +16.7% | 26 | 31% | 1.13 | 71.7% | 26 Jan 2024 – 21 Oct 2026 |
| SOLUSDT 4h | +33.3% | +21.5% | 20 | 30% | 1.75 | 16.7% | 8 May 2026 – 21 Oct 2026 |
| BNBUSDT 1D | +108.8% | +148.3% | 24 | 50% | 1.99 | 33.0% | 26 Jan 2024 – 21 Oct 2026 |
| BNBUSDT 4h | −26.0% | +17.1% | 33 | 18% | 0.41 | 28.8% | 8 May 2026 – 21 Oct 2026 |
Backtests are simulations on historical data and are not investment advice.
The trades
By market direction
| At entry, last 90 bars | Trades | Won | P&L |
|---|---|---|---|
| Rising market | 7 | 29% | −$116.15 |
| Sideways market | 15 | 27% | $138.22 |
| Falling market | 5 | 40% | $148.51 |
Rising and falling mean the market moved more than 15% over the 90 bars before entry.
How bad could the drawdown be?
49.1%
The 95th percentile of the worst drawdown when the same 27 trades are reshuffled 5,000 times. The bar spans the 5th to 95th percentile, 24.0% to 49.1%; the tick is what actually happened, 38.4%. Order luck alone moves it this much.
All 27 trades
| Side | Entry | Exit | Bars | P&L |
|---|---|---|---|---|
| long | 14 Apr 2024 65,661.80 | 30 Apr 2024 60,672.00 | 16 | −$38.46 |
| short | 30 Apr 2024 60,672.00 | 17 May 2024 67,024.00 | 17 | −$48.81 |
| long | 17 May 2024 67,024.00 | 21 Jun 2024 64,143.60 | 35 | −$18.14 |
| short | 21 Jun 2024 64,143.60 | 19 Jul 2024 66,660.00 | 28 | −$15.88 |
| long | 19 Jul 2024 66,660.00 | 4 Aug 2024 58,161.00 | 16 | −$48.64 |
| short | 4 Aug 2024 58,161.00 | 13 Sep 2024 60,498.00 | 40 | −$13.60 |
| long | 13 Sep 2024 60,498.00 | 15 Sep 2024 59,132.00 | 2 | −$7.46 |
| short | 15 Sep 2024 59,132.00 | 17 Sep 2024 60,314.00 | 2 | −$6.49 |
| long | 17 Sep 2024 60,314.00 | 10 Nov 2024 80,250.70 | 54 | $99.65 |
| long | 2 Jan 2025 96,984.80 | 2 Feb 2025 97,700.60 | 31 | $2.56 |
| short | 2 Feb 2025 97,700.60 | 3 Feb 2025 101,329.00 | 1 | −$15.44 |
| long | 3 Feb 2025 101,329.00 | 4 Feb 2025 97,763.10 | 1 | −$14.08 |
| short | 4 Feb 2025 97,763.10 | 22 Apr 2025 93,443.00 | 77 | $16.21 |
| long | 22 Apr 2025 93,443.00 | 11 Jul 2025 117,317.00 | 80 | $99.56 |
| long | 22 Aug 2025 116,936.00 | 25 Aug 2025 110,112.00 | 3 | −$29.11 |
| short | 25 Aug 2025 110,112.00 | 18 Sep 2025 117,074.00 | 24 | −$29.68 |
| long | 18 Sep 2025 117,074.00 | 22 Sep 2025 112,651.00 | 4 | −$16.75 |
| short | 22 Sep 2025 112,651.00 | 1 Oct 2025 118,595.00 | 9 | −$22.35 |
| long | 1 Oct 2025 118,595.00 | 10 Oct 2025 112,775.00 | 9 | −$19.68 |
| short | 10 Oct 2025 112,775.00 | 21 Nov 2025 82,573.70 | 42 | $99.68 |
| long | 14 Jan 2026 96,951.80 | 25 Jan 2026 86,670.40 | 11 | −$50.59 |
| short | 25 Jan 2026 86,670.40 | 5 Feb 2026 66,156.60 | 11 | $99.63 |
| short | 18 Mar 2026 71,246.50 | 15 Apr 2026 74,810.00 | 28 | −$26.64 |
| long | 15 Apr 2026 74,810.00 | 31 May 2026 73,674.40 | 46 | −$8.01 |
| short | 31 May 2026 73,674.40 | 25 Jun 2026 58,561.00 | 25 | $99.56 |
| short | 15 Aug 2026 63,086.00 | 18 Aug 2026 64,725.40 | 3 | −$15.84 |
| long | 18 Aug 2026 64,725.40 | 21 Aug 2026 76,056.70 | 3 | $99.38 |
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
VerifiedNothing to change.
Does it run in Pine Script v6?
No
The v6 version runs in Zeal Terminal's engine, but its results differ from the v5 version: Trades differ: 27 before, 43 after on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine. It is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.
-//@version=5+//@version=6// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/⋯Where it runs
| Engine | Compiles | Runs | Matches TradingView |
|---|---|---|---|
| Zeal Terminal · OpenPineScript v2 | Yes 34 ms | Yes 1,000 bars in 92 ms | Not measured |
| PineTS | Not tested | Not tested | Not 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.
//@version=5// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/// © moneyofthegame// Basado en estrategias con el indicador ICHIMOKU KINKO HIYO// El tiempo es oro colega :)//@version=5strategy('Ichimoku Cloud Estrategia Ruptura Nubes SWING TRADER (By Insert Cheese)', shorttitle='Ichimoku Cloud Estrategia Ruptura Nubes SWING TRADER (By Insert Cheese)', overlay=true, initial_capital=500, process_orders_on_close=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent, commission_value=0.05, currency=currency.NONE) // Inputs: Ichimoku parametrosts_bars = input.int(9, minval=1, title='Tenkan-Sen ', group='Parámetros Ichimoku')ks_bars = input.int(26, minval=1, title='Kijun-Sen ', group='Parámetros Ichimoku')ssb_bars = input.int(52, minval=1, title='Senkou-Span B ', group='Parámetros Ichimoku')cs_offset = input.int(26, minval=1, title='Chikou-Span', group='Parámetros Ichimoku')ss_offset = input.int(26, minval=1, title='Senkou-Span A', group='Parámetros Ichimoku')middle(len) => // LONGITITUD Ichimoku (SenkouB) math.avg(ta.lowest(len), ta.highest(len))// Ichimoku Componentestenkan = middle (ts_bars)kijun = middle (ks_bars)senkouA = math.avg(tenkan, kijun)senkouB = middle (ssb_bars)// Plot Ichimoku Kinko Hyoplot(tenkan, color=color.rgb(171, 128, 0), title="Tenkan-Sen", display = display.none)plot(kijun, color=color.rgb(39, 0, 112), title="Kijun-Sen", display = display.none)plot(close, offset=-cs_offset+1, color=color.rgb(224, 200, 251), title="Chikou-Span", display = display.none)sa=plot(senkouA, offset=ss_offset-1, color=color.rgb(68, 128, 0), title="Senkou-Span A", display = display.none)sb=plot(senkouB, offset=ss_offset-1, color=color.rgb(131, 0, 120), title="Senkou-Span B", display = display.none)fill(sa, sb, color = senkouA > senkouB ? color.rgb(0, 211, 11, 82) : color.rgb(75, 0, 126, 82), title="Cloud color")// Calculating ss_high = math.max(senkouA[ss_offset - 1], senkouB[ss_offset - 1]) //parte alta de la nubess_low = math.min(senkouA[ss_offset - 1], senkouB[ss_offset - 1]) //parte baja de la nubess_medium = ss_low + (ss_high - ss_low) / 2 //parte intermedia// Input para seleccionar largos o cortoslong_entry_enable = input.bool(true, title='Entradas Largo', group='Backtest Operativa', inline='SP20')short_entry_enable = input.bool(true, title='Entradas Corto', group='Backtest Operativa', inline='SP20')// Input backtest rango de fechas fromMonth = input.int (defval=1, title='Desde Mes', minval=1, maxval=12, group='Backtest rango de fechas')fromYear = input.int (defval=2000, title='Desde Año', minval=1970, group='Backtest rango de fechas')fromDay = input.int (defval=1, title='Desde Día', minval=1, maxval=31, group='Backtest rango de fechas')thruDay = input.int (defval=1, title='Hasta Día', minval=1, maxval=31, group='Backtest rango de fechas')thruMonth = input.int (defval=1, title='Hasta Mes', minval=1, maxval=12, group='Backtest rango de fechas')thruYear = input.int (defval=2099, title='Hasta Año', minval=1970, group='Backtest rango de fechas')inDataRange = time >= timestamp(syminfo.timezone, fromYear, fromMonth, fromDay, 0, 0) and time < timestamp(syminfo.timezone, thruYear, thruMonth, thruDay, 0, 0)//Estrategia// Señales de entrada y salidaprice_above_kumo = close > ss_high // precio cierra arriba de la nubeprice_below_kumo = close < ss_low // precio cierra abajo de la nubeprice_cross_above_kumo = ta.crossover (close , ss_high ) //precio cruza la nube parte altaprice_cross_below_kumo = ta.crossunder (close , ss_low ) // precio cruza la nube parte bajabullish = (price_above_kumo and price_cross_above_kumo)bearish = (price_below_kumo and price_cross_below_kumo)comprado = strategy.position_size > 0vendido = strategy.position_size < 0sl_long = price_above_kumosl_short = price_below_kumoif ( not comprado and bullish and inDataRange and long_entry_enable)//realizar compra strategy.entry("Buy", strategy.long)//realizar salida longif (comprado and bearish and inDataRange and long_entry_enable) strategy.close ("Buy", comment = "cerrado")if ( not vendido and bearish and inDataRange and short_entry_enable)//realizar venta strategy.entry("Sell", strategy.short) //realizar salida longif (vendido and bullish and inDataRange and short_entry_enable) strategy.close ("Buy", comment = "cerrado")// Función Calcular TP y SL// Inputs para SL y TPtpenable = input.bool(true, title = "SL y TP metodo")moneyToSLPoints(money) => strategy.position_size !=0 and tpenable ? (money / syminfo.pointvalue / math.abs (strategy.position_size)) / syminfo.mintick : nap = moneyToSLPoints(input.float( 100.0, minval=0.1, step=10.0, title = "Take Profit $$"))l = moneyToSLPoints(input.float( 100.0, minval=0.1, step=10.0, title = "Stop Loss $$"))strategy.exit("Close", profit = p, loss = l)// debug plots for visualize SL & TP levelspointsToPrice(pp) => na(pp) ? na : strategy.position_avg_price + pp * math.sign(strategy.position_size) * syminfo.mintick pp = plot(pointsToPrice(p),color = color.rgb(76, 175, 79, 96), style = plot.style_linebr )lp = plot(pointsToPrice(-l),color = color.rgb(76, 175, 79, 96), style = plot.style_linebr )avg = plot( strategy.position_avg_price, color = color.rgb(76, 175, 79, 96), style = plot.style_linebr )fill(pp, avg, color = color.rgb(76, 175, 79, 96))fill(avg, lp, color = color.rgb(255, 82, 82, 97))