Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

D-Bot Alpha RSI Breakout Strategy

A Pine Script v5 strategy built on SMA (close, 200) and RSI (close, 14). It has 5 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 is 100 contracts and pays no commission. 5 settings; defaults include SMA Length 200, RSI Length 14 and RSI Entry Level 34.

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 D-Bot Alpha RSI Breakout 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 D-Bot Alpha RSI Breakout Strategy do on BTCUSDT 1D with default settings?
−6,771.83%
From 26 Jan 2024 to 21 Oct 2026, over 1 closed trade, against +102.5% for buy and hold. A backtest, not investment advice.
Does D-Bot Alpha RSI Breakout Strategy 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: 1 before, 1 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 D-Bot Alpha RSI Breakout Strategy use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does D-Bot Alpha RSI Breakout Strategy run in Zeal Terminal?
Yes
It compiles in 16 ms and runs 1,000 bars in 26 ms, in the browser.

BTCUSDT · 1D · default settings

  • Plot
  • Plot
  • 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 (5)
0.0050,000100,000AprJulOct2025AprJulOct2026AprJulOct$-667,178$20,253Equity from $10,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
−6,771.83%
−$677,183.00
Buy and hold
+102.5%
same period
Closed trades
1
0 won · 1 lost
Profitable
0.0%
of closed trades
Profit factor
0.00
gross profit ÷ gross loss
Max drawdown
17,664.00%
−$1,766,400.00

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

Settings

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

SettingDefaultType and rangeFeeds
SMA Length200intsma_value
RSI Length14intrsi_value
RSI Entry Level34intlongCondition
RSI Stop Loss Level30intclose Buy line 32
RSI Take Profit Level50intclose Buy close Buy line 28 line 34 line 36

What it calculates

  • SMAclose, SMA Length (200)sma_value · line 12
  • RSIclose, RSI Length (14)rsi_value · line 13

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 datasma_lengthSMA Lengthsetting · 200rsi_lengthRSI Lengthsetting · 14rsi_entryRSI Entry Levelsetting · 34rsi_stop_lossRSI Stop Loss Levelsetting · 30rsi_take_profitRSI Take Profit Levelsetting · 50sma_valueSMA→ sma_valuersi_valueRSI→ rsi_valuetrailingStop, lastClosetrailingStop · lastClose2 valueslongConditionlongConditionconditionentry:BuyOpen Buystrategy.entryclose:BuyClose Buystrategy.closeplot:39plotplotplot:40plotplot

Order rules

OrderFires whenBy defaultLine
Open Buy long(longCondition)On20
Close Buy(trailing_stop_activate and not na(trailingStop) and close < trailingStop)On31
Close Buy(rsi_value <= rsi_stop_loss)On33
Close Buy(not trailing_stop_activate and rsi_value >= rsi_take_profit)On35
Close Buy(trailing_stop_activate and rsi_value >= rsi_take_profit)On37

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 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−6,771.8%+102.5%10%0.0017,664.0%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h+2,802.8%+5.5%3100%—1,184.1%8 May 2026 – 21 Oct 2026
ETHUSDT 1D−274.3%+9.8%250%0.54152.5%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h+210.5%+8.4%3100%—20.4%8 May 2026 – 21 Oct 2026
SOLUSDT 1D+21.2%+16.7%2100%—19.4%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h+12.0%+21.5%683%4.802.7%8 May 2026 – 21 Oct 2026
BNBUSDT 1D+11.6%+148.3%367%1.09104.1%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h+14.2%+17.1%1100%—7.9%8 May 2026 – 21 Oct 2026

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

Settings heatmap

Two settings that feed the entry signal, moved around their defaults. The best in-sample pair (SMA Length 100, RSI Length 7) made +10,434.7% before 26 Dec 2025 and −3,177.9% after it, worse than the defaults' 0.0% after. Tuning on the past did not carry forward. 23% of the 64 combinations made money in-sample and 8% out-of-sample.

Before 26 Dec 2025 · in-sample
RSI Length ↓ · SMA Length →100120140170200240280340
7+10,435%−2,144%−4,394%−3,558%−1,196%+3,525%+3,525%+5,431%
8+5,985%−8,108%−9,624%−8,370%−5,367%−645%−645%−12,696%
10+4,012%+4,012%−11,662%−6,993%−3,990%+732%+732%−11,400%
120%0%−11,393%−2,756%−2,756%+5,427%+5,427%−3,864%
140%0%−6,772%−6,772%−6,772%−5,963%−5,963%−17,633%
170%0%−6,772%−6,772%−6,772%−6,772%−6,772%−6,772%
200%0%0%0%−788%−788%−788%−788%
240%0%0%0%+471%+471%+471%+471%
From 26 Dec 2025 · out-of-sample
RSI Length ↓ · SMA Length →100120140170200240280340
7−3,178%−3,178%−3,178%+1,138%+1,138%+1,138%+1,138%+1,138%
8−2,303%−2,303%−2,303%0%0%0%0%0%
100%0%0%0%0%0%0%0%
12−2,475%−2,475%0%0%0%0%0%0%
140%0%0%0%0%0%0%0%
170%0%0%0%0%0%0%0%
200%0%0%0%0%0%0%0%
240%0%0%0%0%0%0%0%

Net P&L of trades opened in each period, as a share of starting capital. marks the defaults and the best in-sample cell. Hover a cell for its trade count. Backtests are simulations on historical data and are not investment advice.

The trades

By market direction

At entry, last 90 barsTradesWonP&L
Rising market0—$0.00
Sideways market10%−$677,183.00
Falling market0—$0.00

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

How bad could the drawdown be?

6,771.8%

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

0%7,788%
All 1 trades
SideEntryExitBarsP&L
long3 Mar 2025 94,270.0025 Mar 2025 87,498.2022−$677,183.00

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
D-Bot Alpha RSI Breakout Strategy this page—v5 strategy−6,771.8%117,664.0%
SRJ RSI Outperformer Strategy by Sapt_Jashrsi smav5 strategy+0.6%82.4%
RSI SMA Crossover Strategy by reeesrsi smav5 strategy+39.8%4230.8%
Short In Downtrend Below MA100 (Coinrule) by Coinrulesma rsiv4 strategy−34.5%9945.4%
Simple RSI and SMA Long and Short (by Coinrule) by Coinrulersi smav5 strategy−3.0%217.7%
Maximized Moving Average Crossing (by Coinrule) by Coinrulesma rsiv4 strategy−6.6%913.3%

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.

  • 5 settings use the untyped input() (line 6, 7, 8, 9, 10). It still compiles in v6; input.int, input.float or input.source state the type.
  • No v6-only features. v6 is not needed to run this script.

Clean v5

VerifiedDownload the v5 script

Same 1 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()
⋯// Inputs-sma_length = input(200, title="SMA Length")+sma_length = input.int(200, title="SMA Length")-rsi_length = input(14, title="RSI Length")+rsi_length = input.int(14, title="RSI Length")-rsi_entry = input(34, title="RSI Entry Level")+rsi_entry = input.int(34, title="RSI Entry Level")-rsi_stop_loss = input(30, title="RSI Stop Loss Level")+rsi_stop_loss = input.int(30, title="RSI Stop Loss Level")-rsi_take_profit = input(50, title="RSI Take Profit Level")+rsi_take_profit = input.int(50, title="RSI Take Profit Level")// Indicators⋯

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

⋯// © abdllhatn-//@version=5+//@version=6strategy("Alpha RSI Breakout Strategy", overlay=true, initial_capital=10000, default_qty_value=100)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 16 msYes 1,000 bars in 26 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/// © abdllhatn//@version=5strategy("Alpha RSI Breakout Strategy", overlay=true, initial_capital=10000, default_qty_value=100)// Inputssma_length = input(200, title="SMA Length")rsi_length = input(14, title="RSI Length")rsi_entry = input(34, title="RSI Entry Level")rsi_stop_loss = input(30, title="RSI Stop Loss Level")rsi_take_profit = input(50, title="RSI Take Profit Level")// Indicatorssma_value = ta.sma(close, sma_length)rsi_value = ta.rsi(close, rsi_length)var bool trailing_stop_activate = falsevar float trailingStop = navar float lastClose = na// ConditionslongCondition = ta.crossover(rsi_value, rsi_entry) and close > sma_valueif (longCondition)    strategy.entry("Buy", strategy.long)    trailingStop := na    lastClose := na    trailing_stop_activate := falseif (strategy.position_size > 0)    if (na(lastClose) or close < lastClose)        lastClose := close        trailingStop := close    if (rsi_value >= rsi_take_profit)        trailing_stop_activate := trueif (trailing_stop_activate and not na(trailingStop) and close < trailingStop)    strategy.close("Buy")if (rsi_value <= rsi_stop_loss)    strategy.close("Buy")if (not trailing_stop_activate and rsi_value >= rsi_take_profit)    strategy.close("Buy")if (trailing_stop_activate and rsi_value >= rsi_take_profit)    strategy.close("Buy")// Plotplot(sma_value, color=color.red, linewidth=2)plot(rsi_value, color=color.blue, linewidth=2)