Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

D-BoT Alpha 'Short' SMA and RSI Strategy

A Pine Script v5 strategy built on SMA (close, 200) and RSI (close, 14). It has 4 order rules, 1 entry among them, and trades short 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 51.

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 'Short' SMA and RSI Strategy repaint?
No
No repainting patterns were found in the source, and a live tick-by-tick replay matched history on 11 of 11 trades.
How did D-BoT Alpha 'Short' SMA and RSI Strategy do on BTCUSDT 1D with default settings?
+6,662.78%
From 26 Jan 2024 to 21 Oct 2026, over 17 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Does D-BoT Alpha 'Short' SMA and RSI 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: 17 before, 11 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 'Short' SMA and RSI Strategy use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does D-BoT Alpha 'Short' SMA and RSI Strategy run in Zeal Terminal?
Yes
It compiles in 12 ms and runs 1,000 bars in 21 ms, in the browser.

BTCUSDT · 1D · default settings

  • 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)
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOct$676,345$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,662.78%
$666,278.00
Buy and hold
+102.5%
same period
Closed trades
17
8 won · 9 lost
Profitable
47.1%
of closed trades
Profit factor
1.90
gross profit ÷ gross loss
Max drawdown
5,480.51%
−$548,051.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 Level51intshortCondition
RSI Stop Level54intclose Sell line 28
RSI Take Profit Level32intclose Sell line 30

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 · 51rsi_stopRSI Stop Levelsetting · 54rsi_take_profitRSI Take Profit Levelsetting · 32sma_valueSMA→ sma_valuersi_valueRSI→ rsi_valuetrailingStop, lastLowtrailingStop · lastLow2 valuesshortConditionshortConditionconditionentry:SellOpen Sellstrategy.entryclose:SellClose Sellstrategy.closeplot:33plotplot

Order rules

OrderFires whenBy defaultLine
Open Sell short(shortCondition)On19
Close Sellnot na(trailingStop) and close > trailingStopOn27
Close Sell(rsi_value >= rsi_stop)On29
Close Sell(rsi_value <= rsi_take_profit)On31

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.

11/11trades 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+6,662.8%+102.5%1747%1.905,480.5%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h−1,952.5%+5.5%911%0.391,112.5%8 May 2026 – 21 Oct 2026
ETHUSDT 1D−806.6%+9.8%2119%0.30818.0%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h−20.4%+8.4%1338%0.8082.3%8 May 2026 – 21 Oct 2026
SOLUSDT 1D+22.6%+16.7%2442%1.6614.6%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h−0.2%+21.5%1331%0.975.2%8 May 2026 – 21 Oct 2026
BNBUSDT 1D+51.2%+148.3%2040%1.3597.7%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h+19.5%+17.1%1443%1.8014.1%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 +21,965.0% before 26 Dec 2025 and −1,201.8% after it, worse than the defaults' +9,753.9% after. Tuning on the past did not carry forward. 34% of the 64 combinations made money in-sample and 44% out-of-sample.

Before 26 Dec 2025 · in-sample
RSI Length ↓ · SMA Length →100120140170200240280340
7+21,965%+21,397%+14,409%+4,817%+5,526%+3,839%+3,559%+3,559%
8−3,022%−3,022%−10,010%−9,730%−6,749%−1,209%−1,489%−1,489%
10−2,485%−2,936%−9,924%−10,311%−5,732%+2,814%+3,200%+3,200%
12+5,671%+5,220%−1,768%−2,155%+742%+7,464%+7,850%+7,850%
14+14,183%+8,911%+1,923%+1,857%−3,091%−386%0%0%
17+4,143%−1,128%−1,862%−2,328%−2,208%−1,400%0%0%
20−2,237%−7,509%−8,243%−8,709%−8,589%−1,400%0%0%
24−2,237%−7,509%−8,243%−11,587%−11,467%−4,278%0%0%
From 26 Dec 2025 · out-of-sample
RSI Length ↓ · SMA Length →100120140170200240280340
7−1,202%−1,202%−1,202%−1,658%+1,880%+1,880%+1,880%+3,863%
8−6,083%−6,083%−7,967%−7,967%−4,430%−4,430%−4,430%−2,446%
10−8,171%−8,171%−8,171%−8,171%−4,634%−4,634%−4,634%−2,650%
12+4,799%+4,799%+4,799%+4,799%+4,799%+4,799%+4,799%+3,835%
14+9,754%+9,754%+9,754%+9,754%+9,754%+9,754%+9,754%+9,754%
17−788%−788%−788%−788%−788%−788%−788%−5,466%
20−11,305%−11,305%−11,305%−11,305%−11,305%−11,305%−11,305%−11,305%
24+3,860%+3,860%+3,860%+4,660%+4,660%+4,660%+4,660%+4,660%

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 market743%−$342,429.00
Falling market1050%$1,008,710.00

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

How bad could the drawdown be?

717,534.0%

The 95th percentile of the worst drawdown when the same 17 trades are reshuffled 5,000 times. The bar spans the 5th to 95th percentile, 100.8% to 717,534.0%; the tick is what actually happened, 4,208.6%. Order luck alone moves it this much.

0%825,164%
All 17 trades
SideEntryExitBarsP&L
short22 Aug 2024 61,156.0024 Aug 2024 64,037.202−$288,121.00
short14 Sep 2024 60,498.0015 Sep 2024 59,993.001$50,497.00
short18 Sep 2024 60,314.0019 Sep 2024 61,760.001−$144,599.00
short7 Oct 2024 62,819.9013 Oct 2024 63,206.206−$38,632.00
short13 Apr 2025 85,276.9017 Apr 2025 84,030.404$124,653.00
short18 Apr 2025 84,947.9020 Apr 2025 85,077.002−$12,908.00
short3 Jan 2026 89,995.104 Jan 2026 90,628.001−$63,287.00
short5 Mar 2026 72,666.8010 Mar 2026 68,432.205$423,461.00
short11 Mar 2026 69,948.6013 Mar 2026 70,541.302−$59,270.00
short24 Mar 2026 70,906.4031 Mar 2026 66,797.407$410,907.00
short8 Apr 2026 71,924.209 Apr 2026 71,069.901$85,429.00
short6 Jul 2026 63,650.0010 Jul 2026 63,230.004$42,000.00
short11 Jul 2026 64,161.7015 Jul 2026 65,044.004−$88,227.00
short27 Jul 2026 65,400.0029 Jul 2026 63,915.002$148,500.00
short31 Jul 2026 64,780.003 Aug 2026 63,570.003$121,002.00
short6 Aug 2026 64,665.208 Aug 2026 64,923.202−$25,796.00
short18 Aug 2026 64,532.1019 Aug 2026 64,725.401−$19,331.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 'Short' SMA and RSI Strategy this page—v5 strategy+6,662.8%175,480.5%
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 17 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(51, title="RSI Entry Level")+rsi_entry = input.int(51, title="RSI Entry Level")-rsi_stop = input(54, title="RSI Stop Level")+rsi_stop = input.int(54, title="RSI Stop Level")-rsi_take_profit = input(32, title="RSI Take Profit Level")+rsi_take_profit = input.int(32, 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: 17 before, 11 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 Short SMA and RSI Strategy", overlay=true, initial_capital=10000, default_qty_value=100)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 12 msYes 1,000 bars in 21 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 Short SMA and RSI 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(51, title="RSI Entry Level")rsi_stop = input(54, title="RSI Stop Level")rsi_take_profit = input(32, title="RSI Take Profit Level")// Indicatorssma_value = ta.sma(close, sma_length)rsi_value = ta.rsi(close, rsi_length)var float trailingStop = navar float lastLow = na// ConditionsshortCondition = ta.crossover(rsi_value, rsi_entry) and close < sma_valueif (shortCondition)    strategy.entry("Sell", strategy.short)    trailingStop := na    lastLow := naif (strategy.position_size < 0)    if (na(lastLow) or close < lastLow)        lastLow := close        trailingStop := closeif not na(trailingStop) and close > trailingStop    strategy.close("Sell")if (rsi_value >= rsi_stop)    strategy.close("Sell")if (rsi_value <= rsi_take_profit)    strategy.close("Sell")// Plotplot(sma_value, color=color.red, linewidth=2)