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
- 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.
| Setting | Default | Type and range | Feeds |
|---|---|---|---|
| SMA Length | 200 | int | sma_value |
| RSI Length | 14 | int | rsi_value |
| RSI Entry Level | 34 | int | longCondition |
| RSI Stop Loss Level | 30 | int | close Buy line 32 |
| RSI Take Profit Level | 50 | int | close 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.
Order rules
| Order | Fires when | By default | Line |
|---|---|---|---|
| Open Buy long | (longCondition) | On | 20 |
| Close Buy | (trailing_stop_activate and not na(trailingStop) and close < trailingStop) | On | 31 |
| Close Buy | (rsi_value <= rsi_stop_loss) | On | 33 |
| Close Buy | (not trailing_stop_activate and rsi_value >= rsi_take_profit) | On | 35 |
| Close Buy | (trailing_stop_activate and rsi_value >= rsi_take_profit) | On | 37 |
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.
- 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.
| Market | Net | Buy and hold | Trades | Won | Profit factor | Max drawdown | Period |
|---|---|---|---|---|---|---|---|
| BTCUSDT 1D | −6,771.8% | +102.5% | 1 | 0% | 0.00 | 17,664.0% | 26 Jan 2024 – 21 Oct 2026 |
| BTCUSDT 4h | +2,802.8% | +5.5% | 3 | 100% | — | 1,184.1% | 8 May 2026 – 21 Oct 2026 |
| ETHUSDT 1D | −274.3% | +9.8% | 2 | 50% | 0.54 | 152.5% | 26 Jan 2024 – 21 Oct 2026 |
| ETHUSDT 4h | +210.5% | +8.4% | 3 | 100% | — | 20.4% | 8 May 2026 – 21 Oct 2026 |
| SOLUSDT 1D | +21.2% | +16.7% | 2 | 100% | — | 19.4% | 26 Jan 2024 – 21 Oct 2026 |
| SOLUSDT 4h | +12.0% | +21.5% | 6 | 83% | 4.80 | 2.7% | 8 May 2026 – 21 Oct 2026 |
| BNBUSDT 1D | +11.6% | +148.3% | 3 | 67% | 1.09 | 104.1% | 26 Jan 2024 – 21 Oct 2026 |
| BNBUSDT 4h | +14.2% | +17.1% | 1 | 100% | — | 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.
| RSI Length ↓ · SMA Length → | 100 | 120 | 140 | 170 | 200 | 240 | 280 | 340 |
|---|---|---|---|---|---|---|---|---|
| 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% |
| 12 | 0% | 0% | −11,393% | −2,756% | −2,756% | +5,427% | +5,427% | −3,864% |
| 14 | 0% | 0% | −6,772% | −6,772% | −6,772% | −5,963% | −5,963% | −17,633% |
| 17 | 0% | 0% | −6,772% | −6,772% | −6,772% | −6,772% | −6,772% | −6,772% |
| 20 | 0% | 0% | 0% | 0% | −788% | −788% | −788% | −788% |
| 24 | 0% | 0% | 0% | 0% | +471% | +471% | +471% | +471% |
| RSI Length ↓ · SMA Length → | 100 | 120 | 140 | 170 | 200 | 240 | 280 | 340 |
|---|---|---|---|---|---|---|---|---|
| 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% |
| 10 | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% |
| 12 | −2,475% | −2,475% | 0% | 0% | 0% | 0% | 0% | 0% |
| 14 | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% |
| 17 | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% |
| 20 | 0% | 0% | 0% | 0% | 0% | 0% | 0% | 0% |
| 24 | 0% | 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 bars | Trades | Won | P&L |
|---|---|---|---|
| Rising market | 0 | — | $0.00 |
| Sideways market | 1 | 0% | −$677,183.00 |
| Falling market | 0 | — | $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.
All 1 trades
| Side | Entry | Exit | Bars | P&L |
|---|---|---|---|---|
| long | 3 Mar 2025 94,270.00 | 25 Mar 2025 87,498.20 | 22 | −$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.
| Script | Shares | Type | Net | Trades | Max drawdown |
|---|---|---|---|---|---|
| D-Bot Alpha RSI Breakout Strategy this page | — | v5 strategy | −6,771.8% | 1 | 17,664.0% |
| SRJ RSI Outperformer Strategy by Sapt_Jash | rsi sma | v5 strategy | +0.6% | 8 | 2.4% |
| RSI SMA Crossover Strategy by reees | rsi sma | v5 strategy | +39.8% | 42 | 30.8% |
| Short In Downtrend Below MA100 (Coinrule) by Coinrule | sma rsi | v4 strategy | −34.5% | 99 | 45.4% |
| Simple RSI and SMA Long and Short (by Coinrule) by Coinrule | rsi sma | v5 strategy | −3.0% | 2 | 17.7% |
| Maximized Moving Average Crossing (by Coinrule) by Coinrule | sma rsi | v4 strategy | −6.6% | 9 | 13.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.
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
| Engine | Compiles | Runs | Matches TradingView |
|---|---|---|---|
| Zeal Terminal · OpenPineScript v2 | Yes 16 ms | Yes 1,000 bars in 26 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.
// 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)