Zeal Terminal Open in Zeal Terminal

Pine Script v1 · Strategy

Legacy

Multi Time Frame Buy the Dips (by Coinrule)

A Pine Script v1 strategy with no technical-analysis calculation. It has 2 order rules, 1 entry among them, and trades long only with the default settings. Exits wait for a signal; there is no stop loss. Each trade commits 30% of equity and pays 0.1% commission. 13 settings; defaults include From Month 1, From Day 10 and From Year 2020.

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 Multi Time Frame Buy the Dips (by Coinrule) repaint?
No
No repainting patterns were found in the source, and a live tick-by-tick replay matched history on 12 of 12 trades.
How did Multi Time Frame Buy the Dips (by Coinrule) do on BTCUSDT 1D with default settings?
−4.17%
From 26 Jan 2024 to 21 Oct 2026, over 38 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Can Multi Time Frame Buy the Dips (by Coinrule) be converted to Pine Script v5?
No
The automatic step from v1 to v2 changes the results, so no v2 download is offered; the edits are shown below.
Does Multi Time Frame Buy the Dips (by Coinrule) use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does Multi Time Frame Buy the Dips (by Coinrule) run in Zeal Terminal?
Yes
It compiles in 13 ms and runs 1,000 bars in 42 ms, in the browser.

BTCUSDT · 1D · default settings

  • 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 (13)
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOct$958$2,025Equity from $1,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. Zeal Terminal's engine currently reads an order side written as long = true as a short, whatever it says; this page passes the same side as strategy.long or strategy.short (line 27) so the engine trades the way the script says.
Net profit
−4.17%
−$41.66
Buy and hold
+102.5%
same period
Closed trades
38
17 won · 21 lost
Profitable
44.7%
of closed trades
Profit factor
0.86
gross profit ÷ gross loss
Max drawdown
12.75%
−$133.75

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

    1 setting does nothing

    “Show Date Range” is declared but never read.

  • Check

    No stop loss

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

  • Note

    4 settings have no label

    In the settings dialog dip (line 25), increase (line 26), Stop_loss (line 29), Take_profit (line 30) 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.

  • Note

    Uses an argument v6 removed

    when = on line 27, 33. The upgraded version below moves each call inside an if block.

Upgrade and export

Written in Pine Script v1. The upgrade to v5 takes 4 steps, 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.

  • 2 strategy calls use the when = argument (line 27, 33). It is deprecated in v5 and removed in v6, where each call moves inside an if block.

v1 → v2

Differs

Trades differ: 38 before, 38 after on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.

  • Line 3: //@version=1 → //@version=2
⋯// © Coinrule-//@version=1+//@version=2strategy(shorttitle='Multi Time Frame Buy the Dips',title='Multi Time Frame Buy the Dips (by Coinrule)', overlay=true, initial_capital = 1000, default_qty_type = strategy.percent_of_equity, default_qty_value = 30, commission_type=strategy.commission.percent, commission_value=0.1)⋯

v2 → v3

Verified

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

  • Line 3: //@version=2 → //@version=3
⋯// © Coinrule-//@version=2+//@version=3strategy(shorttitle='Multi Time Frame Buy the Dips',title='Multi Time Frame Buy the Dips (by Coinrule)', overlay=true, initial_capital = 1000, default_qty_type = strategy.percent_of_equity, default_qty_value = 30, commission_type=strategy.commission.percent, commission_value=0.1)⋯

v3 → v4

Differs

Trades differ: 38 before, 38 after on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.

  • Line 3: //@version=3 → //@version=4
⋯// © Coinrule-//@version=3+//@version=4strategy(shorttitle='Multi Time Frame Buy the Dips',title='Multi Time Frame Buy the Dips (by Coinrule)', overlay=true, initial_capital = 1000, default_qty_type = strategy.percent_of_equity, default_qty_value = 30, commission_type=strategy.commission.percent, commission_value=0.1)⋯

v4 → v5

Verified

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

  • Line 3: //@version=4 → //@version=5
  • Line 27: long = true → direction = strategy.long
⋯// © Coinrule-//@version=4+//@version=5strategy(shorttitle='Multi Time Frame Buy the Dips',title='Multi Time Frame Buy the Dips (by Coinrule)', overlay=true, initial_capital = 1000, default_qty_type = strategy.percent_of_equity, default_qty_value = 30, commission_type=strategy.commission.percent, commission_value=0.1)⋯increase= (input(3))-strategy.entry(id="long", long = true, when = overall > increase and overall_2 < dip and window()) +strategy.entry(id="long", direction = strategy.long, when = overall > increase and overall_2 < dip and window()) //Exit⋯

Clean v5

Verified

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

  • Line 6: input() → input.int()
  • Line 7: input() → input.int()
  • Line 8: input() → input.int()
  • Line 9: input() → input.int()
  • Line 10: input() → input.int()
  • Line 11: input() → input.int()
9 more edits
  • Line 12: input() → input.bool()
  • Line 16: input() → input.int()
  • Line 17: input() → input.int()
  • Line 25: input() → input.int()
  • Line 26: input() → input.int()
  • Line 27: when = overall > increase and overall_2 < dip and window() → if block
  • Line 29: input() → input.int()
  • Line 30: input() → input.int()
  • Line 33: when = close < longStopPrice or close > longTakeProfit and window() → if block
⋯//Backtest dates-fromMonth = input(defval = 1,  title = "From Month")     +fromMonth = input.int(defval = 1,  title = "From Month")     -fromDay   = input(defval = 10,    title = "From Day")       +fromDay   = input.int(defval = 10,    title = "From Day")       -fromYear  = input(defval = 2020, title = "From Year")       +fromYear  = input.int(defval = 2020, title = "From Year")       -thruMonth = input(defval = 1,    title = "Thru Month")     +thruMonth = input.int(defval = 1,    title = "Thru Month")     -thruDay   = input(defval = 1,    title = "Thru Day")     +thruDay   = input.int(defval = 1,    title = "Thru Day")     -thruYear  = input(defval = 2112, title = "Thru Year")       +thruYear  = input.int(defval = 2112, title = "Thru Year")       -showDate  = input(defval = true, title = "Show Date Range")+showDate  = input.bool(defval = true, title = "Show Date Range")start     = timestamp(fromYear, fromMonth, fromDay, 00, 00)        // backtest start window⋯window()  => time >= start and time <= finish ? true : false       // create function "within window of time"-inp_lkb = input(12, title='Lookback Long Period')+inp_lkb = input.int(12, title='Lookback Long Period')-inp_lkb_2 = input(2, title='Lookback Short Period')+inp_lkb_2 = input.int(2, title='Lookback Short Period') ⋯//Entry-dip= -(input(1))+dip= -(input.int(1))-increase= (input(3))+increase= (input.int(3))-strategy.entry(id="long", direction = strategy.long, when = overall > increase and overall_2 < dip and window()) +if overall > increase and overall_2 < dip and window()+    strategy.entry(id="long", direction = strategy.long) //Exit-Stop_loss= ((input (3))/100)+Stop_loss= ((input.int (3))/100)-Take_profit= ((input (4))/100)+Take_profit= ((input.int (4))/100)longStopPrice  = strategy.position_avg_price * (1 - Stop_loss)longTakeProfit = strategy.position_avg_price * (1 + Take_profit)-strategy.close("long", when = close < longStopPrice or close > longTakeProfit and window())+if close < longStopPrice or close > longTakeProfit and window()+    strategy.close("long")

Does it run in Pine Script v6?

No

Same 38 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine. The v6 version matches the upgraded v5 version, but the upgrade from the original already changed the results, so it is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.

⋯// © Coinrule-//@version=5+//@version=6strategy(shorttitle='Multi Time Frame Buy the Dips',title='Multi Time Frame Buy the Dips (by Coinrule)', overlay=true, initial_capital = 1000, default_qty_type = strategy.percent_of_equity, default_qty_value = 30, commission_type=strategy.commission.percent, commission_value=0.1)⋯

Settings

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

SettingDefaultType and rangeFeeds
From Month1intstart
From Day10intstart
From Year2020intstart
Thru Month1intfinish
Thru Day1intfinish
Thru Year2112intfinish
Show Date Rangetrueboolunused
Lookback Long Period12intoverall
Lookback Short Period2intoverall_2
Dip (no label in the script)1intentry long
Increase (no label in the script)3intentry long
Stop loss (no label in the script)3intlongStopPrice
Take profit (no label in the script)4intlongTakeProfit

What it calculates

No technical-analysis calculation: the script works on prices and settings directly.

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.

fromYearFrom Yearsetting · 2020fromMonthFrom Monthsetting · 1fromDayFrom Daysetting · 10thruYearThru Yearsetting · 2112thruMonthThru Monthsetting · 1thruDayThru Daysetting · 1closecloseprice datainp_lkbLookback Long Periodsetting · 12inp_lkb_2Lookback Short Periodsetting · 2Stop_lossStop losssetting · 3Take_profitTake profitsetting · 4increaseIncreasesetting · 3dipDipsetting · 1startstartvaluefinishfinishvalueoverall_changeoverall_changevalueoveralloverallvalueoverall_2overall_2valuelongStopPricelongStopPricevaluelongTakeProfitlongTakeProfitvalueentry:longOpen longstrategy.entryclose:longClose longstrategy.close

Order rules

OrderFires whenBy defaultLine
Open long longoverall > increase and overall_2 < dip and window()On27
Close longclose < longStopPrice or close > longTakeProfit and window()On33

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.

12/12trades 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 calc_on_every_tick. 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−4.2%+102.5%3845%0.8612.8%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h−1.3%+5.5%633%0.682.7%8 May 2026 – 21 Oct 2026
ETHUSDT 1D−3.6%+9.8%4643%0.9215.3%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h+2.0%+8.4%850%1.482.9%8 May 2026 – 21 Oct 2026
SOLUSDT 1D−3.2%+16.7%7142%0.9516.1%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h+0.7%+21.5%1443%1.094.3%8 May 2026 – 21 Oct 2026
BNBUSDT 1D−3.8%+148.3%4745%0.9113.2%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h+0.1%+17.1%650%1.042.5%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 market1644%−$23.67
Sideways market1540%−$41.59
Falling market757%$23.60

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

How bad could the drawdown be?

15.0%

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

0%17%
All 38 trades
SideEntryExitBarsP&L
long23 Feb 2024 51,288.4027 Feb 2024 54,476.504$18.03
long7 Mar 2024 66,074.0011 Mar 2024 68,955.904$12.70
long16 Mar 2024 69,499.8017 Mar 2024 65,300.601−$19.28
long18 Mar 2024 68,393.5020 Mar 2024 61,937.402−$29.22
long4 Apr 2024 65,963.307 Apr 2024 68,896.003$12.50
long20 May 2024 66,274.0021 May 2024 71,446.601$22.67
long23 May 2024 69,166.6014 Jun 2024 66,773.0022−$11.16
long19 Jul 2024 63,987.9020 Jul 2024 66,660.001$11.99
long24 Jul 2024 65,936.003 Aug 2024 61,498.3010−$21.15
long27 Aug 2024 62,834.0028 Aug 2024 59,415.001−$16.86
long22 Oct 2024 67,377.5030 Oct 2024 72,736.408$22.78
long18 Nov 2024 89,856.0021 Nov 2024 94,286.603$14.22
long25 Nov 2024 97,900.1026 Nov 2024 93,010.001−$15.84
long27 Nov 2024 91,965.2028 Nov 2024 95,863.101$12.12
long20 Jan 2025 101,332.0022 Jan 2025 106,144.002$13.82
long24 Jan 2025 103,910.002 Feb 2025 100,636.009−$10.32
long22 Mar 2025 84,088.8025 Mar 2025 87,498.203$11.75
long13 May 2025 102,791.0022 May 2025 109,644.009$19.94
long24 May 2025 107,318.0031 May 2025 103,985.007−$10.39
long12 Jun 2025 108,645.0018 Jun 2025 104,551.006−$12.35
long16 Jul 2025 117,758.002 Aug 2025 113,298.0017−$12.26
long15 Aug 2025 118,295.0020 Aug 2025 112,873.005−$14.53
long21 Sep 2025 115,686.0024 Sep 2025 111,999.003−$10.14
long8 Oct 2025 121,333.0011 Oct 2025 112,774.003−$21.50
long29 Oct 2025 112,898.0031 Oct 2025 108,323.002−$12.33
long14 Dec 2025 90,240.0016 Dec 2025 86,432.102−$12.65
long8 Jan 2026 91,364.2014 Jan 2026 95,414.006$11.96
long17 Jan 2026 95,550.9020 Jan 2026 92,631.003−$9.31
long18 Feb 2026 67,503.5024 Feb 2026 64,656.006−$12.52
long8 Mar 2026 67,262.9012 Mar 2026 70,191.904$11.61
long19 Mar 2026 71,246.6022 Mar 2026 68,918.103−$9.82
long13 Apr 2026 70,741.6014 Apr 2026 74,418.001$13.99
long8 May 2026 80,006.0018 May 2026 77,457.7010−$9.62
long18 Jun 2026 64,509.4025 Jun 2026 61,078.007−$15.53
long9 Jul 2026 62,290.0015 Jul 2026 65,044.006$11.68
long26 Jul 2026 64,375.0020 Aug 2026 69,334.8025$21.03
long29 Aug 2026 77,845.904 Sep 2026 81,270.406$12.03
long24 Sep 2026 84,397.609 Oct 2026 81,754.5015−$9.67

Similar scripts

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

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 13 msWith a workaround 1,000 bars in 42 msNot measured
PineTSNo v5 and v6 only—Not measured

Zeal Terminal's engine currently reads an order side written as long = true as a short, whatever it says; this page passes the same side as strategy.long or strategy.short (line 27) so the engine trades the way the script says.

“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/// © Coinrule//@version=1strategy(shorttitle='Multi Time Frame Buy the Dips',title='Multi Time Frame Buy the Dips (by Coinrule)', overlay=true, initial_capital = 1000, default_qty_type = strategy.percent_of_equity, default_qty_value = 30, commission_type=strategy.commission.percent, commission_value=0.1)//Backtest datesfromMonth = input(defval = 1,  title = "From Month")     fromDay   = input(defval = 10,    title = "From Day")       fromYear  = input(defval = 2020, title = "From Year")       thruMonth = input(defval = 1,    title = "Thru Month")     thruDay   = input(defval = 1,    title = "Thru Day")     thruYear  = input(defval = 2112, title = "Thru Year")       showDate  = input(defval = true, title = "Show Date Range")start     = timestamp(fromYear, fromMonth, fromDay, 00, 00)        // backtest start windowfinish    = timestamp(thruYear, thruMonth, thruDay, 23, 59)        // backtest finish windowwindow()  => time >= start and time <= finish ? true : false       // create function "within window of time"inp_lkb = input(12, title='Lookback Long Period')inp_lkb_2 = input(2, title='Lookback Short Period') perc_change(lkb) =>    overall_change = ((close[0] - close[lkb]) / close[lkb]) * 100// Call the function    overall = perc_change(inp_lkb)overall_2 = perc_change(inp_lkb_2)//Entrydip= -(input(1))increase= (input(3))strategy.entry(id="long", long = true, when = overall > increase and overall_2 < dip and window()) //ExitStop_loss= ((input (3))/100)Take_profit= ((input (4))/100)longStopPrice  = strategy.position_avg_price * (1 - Stop_loss)longTakeProfit = strategy.position_avg_price * (1 + Take_profit)strategy.close("long", when = close < longStopPrice or close > longTakeProfit and window())