Zeal Terminal Open in Zeal Terminal

Pine Script v4 · Strategy

8 Day Extended Runs

A Pine Script v4 strategy built on SMA (close, 5). It has 4 order rules, 2 entries among them, and trades long and short with the default settings. Exits wait for a signal; there is no stop loss. Each trade is one contract and pays no commission. It has no settings.

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 8 Day Extended Runs repaint?
No
No repainting patterns were found in the source, and a live tick-by-tick replay matched history on 5 of 5 trades.
How did 8 Day Extended Runs do on BTCUSDT 1D with default settings?
+25.11%
From 26 Jan 2024 to 21 Oct 2026, over 18 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Can 8 Day Extended Runs be converted to Pine Script v5?
Yes
The upgrade takes 1 step, from v4; each was run before and after on the same candles with identical results, and the v5 script can be downloaded below.
Does 8 Day Extended Runs use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does 8 Day Extended Runs run in Zeal Terminal?
Yes
It compiles in 10 ms and runs 1,000 bars in 23 ms, in the browser.

BTCUSDT · 1D · default settings

  • SMA
  • 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 (0)
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOct$125,102$202,527Equity from $100,000
Binance BTCUSDT 1D candles, 26 Jan 2024 to 21 Oct 2026, 1,000 bars, default settings. Triangles mark entries; circles mark exits. The script plots nothing itself; the lines and the lower pane are its own calculations, drawn for reference.
Net profit
+25.11%
$25,105.00
Buy and hold
+102.5%
same period
Closed trades
18
12 won · 6 lost
Profitable
66.7%
of closed trades
Profit factor
1.58
gross profit ÷ gross loss
Max drawdown
26.95%
−$37,350.10

One run with the author's default settings, $100,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 stop loss

    Every exit waits for a signal. Nothing limits a losing trade before the exit condition fires.

  • Check

    No commission

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

  • Note

    No slippage

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

  • Note

    Uses an argument v6 removed

    when = on line 13, 14, 20, 21. The upgraded version below moves each call inside an if block.

Upgrade and export

Written in Pine Script v4. The upgrade to v5 takes 1 step, one per version, each applied to the result of the one before. A last clean-v5 pass then types the settings and moves when = into if blocks, which v6 requires. Every step runs before and after on the same candles in Zeal Terminal's engine; a step whose results differ is shown but not offered as a download. Upgrades preserve behaviour: bugs are fixed in the Review, never silently here.

  • Upgrading to v5 renames sma → ta.sma, barssince → ta.barssince.
  • 4 strategy calls use the when = argument (line 13, 14, 20, 21). It is deprecated in v5 and removed in v6, where each call moves inside an if block.

v4 → v5

Verified

Same 18 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.

  • Line 3: //@version=4 → //@version=5
  • Line 7: sma → ta.sma
  • Line 11: barssince → ta.barssince
  • Line 14: barssince → ta.barssince
  • Line 18: barssince → ta.barssince
  • Line 21: barssince → ta.barssince
⋯// © Marcuscor-//@version=4+//@version=5// Inpsired by Linda Bradford Raschke: a strategy  for the T-note futures (ZN1!) that finds 8 day extended runs above/ below the 5sma and buys/ sells the first pullback below/ above the 5sma⋯strategy("8DayRun", overlay=true)-SMA = sma(close,5)+SMA = ta.sma(close,5)TrendUp = close > SMA⋯//logic to long-TriggerBuy = barssince(close < SMA) > 8+TriggerBuy = ta.barssince(close < SMA) > 8Buy = TriggerBuy[1] and TrendDownstrategy.entry("EL", strategy.long, when = Buy)-strategy.close(id = "EL", when = barssince(Buy) >10)+strategy.close(id = "EL", when = ta.barssince(Buy) >10)bgcolor(TriggerBuy ? color.red : na)⋯// logic to short -TriggerSell = barssince(close > SMA) > 8+TriggerSell = ta.barssince(close > SMA) > 8Sell = TriggerSell[1] and TrendUpstrategy.entry("ES", strategy.short, when = Sell)-strategy.close(id = "ES", when = barssince(Sell) > 10)+strategy.close(id = "ES", when = ta.barssince(Sell) > 10)bgcolor(TriggerSell ? color.white : na)⋯

Clean v5

VerifiedDownload the v5 script

Same 18 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.

  • Line 13: when = Buy → if block
  • Line 14: when = ta.barssince(Buy) >10 → if block
  • Line 20: when = Sell → if block
  • Line 21: when = ta.barssince(Sell) > 10 → if block
⋯Buy = TriggerBuy[1] and TrendDown-strategy.entry("EL", strategy.long, when = Buy)+if Buy+    strategy.entry("EL", strategy.long)-strategy.close(id = "EL", when = ta.barssince(Buy) >10)+if ta.barssince(Buy) >10+    strategy.close(id = "EL")bgcolor(TriggerBuy ? color.red : na)⋯Sell = TriggerSell[1] and TrendUp-strategy.entry("ES", strategy.short, when = Sell)+if Sell+    strategy.entry("ES", strategy.short)-strategy.close(id = "ES", when = ta.barssince(Sell) > 10)+if ta.barssince(Sell) > 10+    strategy.close(id = "ES")bgcolor(TriggerSell ? color.white : na)⋯

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: 18 before, 18 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.

⋯// © Marcuscor-//@version=5+//@version=6// Inpsired by Linda Bradford Raschke: a strategy  for the T-note futures (ZN1!) that finds 8 day extended runs above/ below the 5sma and buys/ sells the first pullback below/ above the 5sma⋯

Settings

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

The script declares no settings.

What it calculates

  • SMA (sma, ta.sma in v5)close, 5SMA · line 7

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 dataSMASMA→ SMABuyBuyconditionSellSellconditionTrendUp, TrendDown, TriggerBuy, TriggerSellTrendUp · TrendDown +24 conditionsentry:ELOpen ELstrategy.entryclose:ELClose ELstrategy.closeentry:ESOpen ESstrategy.entryclose:ESClose ESstrategy.closebgcolor:15bgcolorbgcolorbgcolor:16bgcolorbgcolorbgcolor:22bgcolorbgcolorbgcolor:23bgcolorbgcolor

Order rules

OrderFires whenBy defaultLine
Open EL longBuyTriggerBuy[1] and TrendDownOn13
Close ELbarssince(Buy) >10On14
Open ES shortSellTriggerSell[1] and TrendUpOn20
Close ESbarssince(Sell) > 10On21

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.

5/5trades identical when replayed liveThe last 300 bars, from 26 Dec 2025, were fed to the engine as live ticks, four per bar, and compared with the historical run. Orders are decided once per closed bar, so nothing can change mid-bar.
  • 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 timingOrders fill at the next bar's open, after the signal bar has closed.

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 1D+25.1%+102.5%1867%1.5826.9%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h−3.8%+5.5%2129%0.789.3%8 May 2026 – 21 Oct 2026
ETHUSDT 1D−0.1%+9.8%1839%0.942.2%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h−0.2%+8.4%1822%0.670.4%8 May 2026 – 21 Oct 2026
SOLUSDT 1D+0.0%+16.7%2148%1.180.1%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h−0.0%+21.5%2035%0.300.0%8 May 2026 – 21 Oct 2026
BNBUSDT 1D+0.4%+148.3%1953%2.400.2%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h−0.0%+17.1%1735%0.800.1%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 barsTradesWonP&L
Rising market3100%$18,920.60
Sideways market1164%−$10,837.30
Falling market450%$17,021.60

Rising and falling mean the market moved more than 15% over the 90 bars before entry.

How bad could the drawdown be?

24.7%

The 95th percentile of the worst drawdown when the same 18 trades are reshuffled 5,000 times. The bar spans the 5th to 95th percentile, 11.7% to 24.7%; the tick is what actually happened, 23.5%. Order luck alone moves it this much.

0%28%
All 18 trades
SideEntryExitBarsP&L
long20 Feb 2024 51,774.702 Mar 2024 62,387.9011$10,613.20
long6 Mar 2024 63,724.0017 Mar 2024 65,300.6011$1,576.63
short18 Jun 2024 66,504.309 Jul 2024 56,714.6021$9,789.72
long24 Jul 2024 65,936.004 Aug 2024 60,698.0011−$5,238.01
short9 Aug 2024 61,686.0020 Aug 2024 59,438.5011$2,247.50
long22 Oct 2024 67,377.502 Nov 2024 69,496.0011$2,118.50
long26 Nov 2024 93,010.007 Dec 2024 99,740.8011$6,730.83
short11 Feb 2025 97,430.8022 Feb 2025 96,182.0011$1,248.83
long28 Apr 2025 93,749.309 May 2025 103,262.0011$9,512.32
long15 Aug 2025 118,295.0026 Aug 2025 110,112.0011−$8,183.11
short29 Sep 2025 112,164.008 Oct 2025 121,333.009−$9,169.00
long8 Oct 2025 121,333.0019 Oct 2025 107,185.0011−$14,148.00
short25 Nov 2025 88,300.006 Dec 2025 89,330.0011−$1,030.03
short28 Jan 2026 89,250.008 Feb 2026 69,289.4011$19,960.60
short9 Feb 2026 70,330.4020 Feb 2026 67,003.7011$3,326.65
long19 Mar 2026 71,246.6030 Mar 2026 66,010.9011−$5,235.62
short8 Jun 2026 63,332.0019 Jun 2026 62,958.0011$374.00
long29 Aug 2026 77,845.909 Sep 2026 78,455.8011$609.92

Similar scripts

Indicators and strategies built from the same calculations, run on BTCUSDT 1D with their own defaults so they can be compared directly.

ScriptSharesTypeNetTradesMax drawdown
8 Day Extended Runs this page—v4 strategy+25.1%1826.9%
Follow the Crypto Shorts by xtradernetsmav4 strategyNo trades on this market
buy down and sell high trend 200 sma and ma cross by willi130503smav4 strategyNo trades on this market
Mayer Multiple Strategy by xtradernetsmav4 strategyNo trades on this market
Moving Average Cross Strategy early Closing by Geduldtradersmav4 strategy+73.8%20151.5%
MFI Simple Strategy by OztheWozsmav5 strategy−0.2%283.2%

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 10 msYes 1,000 bars in 23 msNot measured
PineTSNo v5 and v6 only—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. PineTS runs Pine Script v5 and v6 only.

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/// © Marcuscor//@version=4// Inpsired by Linda Bradford Raschke: a strategy  for the T-note futures (ZN1!) that finds 8 day extended runs above/ below the 5sma and buys/ sells the first pullback below/ above the 5sma// as of 01/10/2021 the t-test score is 4.06strategy("8DayRun", overlay=true)SMA = sma(close,5)TrendUp = close > SMATrendDown = close < SMA//logic to longTriggerBuy = barssince(close < SMA) > 8Buy = TriggerBuy[1] and TrendDownstrategy.entry("EL", strategy.long, when = Buy)strategy.close(id = "EL", when = barssince(Buy) >10)bgcolor(TriggerBuy ? color.red : na)bgcolor(Buy ? color.blue : na)// logic to short TriggerSell = barssince(close > SMA) > 8Sell = TriggerSell[1] and TrendUpstrategy.entry("ES", strategy.short, when = Sell)strategy.close(id = "ES", when = barssince(Sell) > 10)bgcolor(TriggerSell ? color.white : na)bgcolor(Sell ? color.fuchsia : na)