Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

MTF Diagonally Layered RSI - 1 minute Bitcoin Bot [wbburgin]

A Pine Script v5 strategy built on RSI (close, 7), RMA (u, len * time_mult) and Crossunder (rsi, 80). 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. 11 settings; defaults include RSI Length 7, HT 1 3 and HT 2 5.

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 MTF Diagonally Layered RSI - 1 minute Bitcoin Bot [wbburgin] repaint?
Yes
At least one pattern in the source can repaint: intrabar recalculation.
How did MTF Diagonally Layered RSI - 1 minute Bitcoin Bot [wbburgin] do on BTCUSDT 1D with default settings?
Not measured
It closed no trades there from 26 Jan 2024 to 21 Oct 2026 with the default settings, so there is no result to report. Its entry conditions never all held on this data. It closed no trades on the other markets either. A backtest, not investment advice.
Does MTF Diagonally Layered RSI - 1 minute Bitcoin Bot [wbburgin] run in Pine Script v6?
Not tested
Neither version placed a trade on any of the 8 markets, so there was nothing to compare. The v6 version is shown for reference and is not offered as a download.
Does MTF Diagonally Layered RSI - 1 minute Bitcoin Bot [wbburgin] use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does MTF Diagonally Layered RSI - 1 minute Bitcoin Bot [wbburgin] run in Zeal Terminal?
Yes
It compiles in 30 ms and runs 1,000 bars in 74 ms, in the browser.

BTCUSDT · 1D · default settings

  • RSI Current TF
  • Oversold
  • Overbought
  • Winning trade
  • Losing trade
  • Equity
  • Buy and hold
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOctRSI Current TF$10,000$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. The engine's host API cannot yet declare a chart's symbol and timeframe, so this page sets them on the engine directly for each market. The live re-run is not offered here: the script requests BINANCE:BTCUSDT 3, BINANCE:BTCUSDT 5, which this page cannot load in your browser.

Needs BINANCE:BTCUSDT 3 data, not available: a lower timeframe than the chart; the engine does not evaluate intrabar data Needs BINANCE:BTCUSDT 5 data, not available: a lower timeframe than the chart; the engine does not evaluate intrabar data Values that depend on it are empty on this chart.

Net profit
0.00%
$0.00
Buy and hold
+102.5%
same period
Closed trades
0
0 won · 0 lost
Profitable
0.0%
of closed trades
Profit factor
—
gross profit ÷ gross loss
Max drawdown
0.00%
$0.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
Config
RSI Length7intrsi rsi2_man rsi3_man
HT 13timeframersi2_sec ht1_int
HT 25timeframersi3_sec ht2_int
Overbought Level80intOverbought sellSig htCross_short shortEntry
Oversold Level20intOversold htCross buySig shortExit
Calc TypeManual calculation is a way to stop repaint without using request.security().Manual Calculationstring · options ["Security Function","Manual Calculation"]rsi2 rsi3
Allow Shorts?Long-onlystring · options ["Long-only","Long and Short"]entry Short line 91
Risk Management
Use EMA Filterfalseboolfilter shortfilter
EMA Length200intema200
Use % Stop Lossfalseboolinitiate_stoploss_long initiate_stoploss_short
Stop Loss (%)0.5floatstoplosslevel_long stoplosslevel_short

What it calculates

  • RSIclose, RSI Length (7)rsi · line 17
  • RMAu, len * time_multrs · line 57
  • Crossunderrsi, Overbought Level (80)sellSig · line 74
  • Crossoverrsi, Oversold Level (20)shortExit · line 78
  • EMAclose, EMA Length (200)ema200 · line 80
  • Crossunderclose, stoplosslevel_longinitiate_stoploss_long · line 85
  • Crossoverclose, stoplosslevel_shortinitiate_stoploss_short · line 86

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 datalengthRSI Lengthsetting · 7obOverbought Levelsetting · 80osOversold Levelsetting · 20emaLenEMA Lengthsetting · 200tf2HT 1setting · 3tf3HT 2setting · 5calcTypeCalc Typesetting · Manual CalculationstoplosspercentStop Loss (%)setting · 0.5tradeTypeAllow Shorts?setting · Long-onlyrsiRSI→ rsirsRMA→ rssellSigCrossunder→ sellSigshortExitCrossover→ shortExitema200EMA→ ema200initiate_stoploss_longCrossunder→ initiate_stoploss_longinitiate_stoploss_shortCrossover→ initiate_stoploss_shortindexHighTF, indexCurrTF, currentTFindexHighTF · indexCurr…3 valuesrsi2_secrsi2_secvaluersi3_secrsi3_secvaluect_intct_intvalueht1_intht1_intvalueht2_intht2_intvalueht1_multht1_multvalueht2_multht2_multvaluehtclosehtclosevalueu, du · d2 valuesresresvaluersi2_manrsi2_manvaluersi3_manrsi3_manvaluersi2rsi2valuersi3rsi3valuefilter, shortfilterfilter · shortfilter2 valuesbuySigbuySigconditionshortEntryshortEntryconditionhtCrosshtCrossconditionhtCross_shorthtCross_shortconditionstoplosslevel_longstoplosslevel_longconditionstoplosslevel_shortstoplosslevel_shortconditionentry:LongOpen Longstrategy.entryclose:LongClose Longstrategy.closeentry:ShortOpen Shortstrategy.entryclose:ShortClose Shortstrategy.closeplot:64RSI Current TFplotplot:65RSI HT1plotplot:66RSI HT2plothline:67Oversoldhlinehline:68Overboughthlinefill:69Fillfillplotshape:95Buysigplotshapeplotshape:96Sellsigplotshape

Order rules

OrderFires whenBy defaultLine
Open Long longbuySig and filterOn88
Close LongsellSig or initiate_stoploss_longOn90
Open Short shortshortEntry and shortfilter and tradeType == "Long and Short"On92
Close ShortshortExit or initiate_stoploss_shortOn94

Each order is guarded by the setting shown. “Off” orders never fire unless that setting is switched on.

Does it repaint?

Yes

At least one pattern in the source can repaint; it is marked Check below.

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 data2 request.security call(s), none with lookahead on.
  • ClearFuture-bar referencesNo negative history offsets such as close[-1].
  • CheckIntrabar recalculationreads realtime-only state. Live values can differ from history.
  • 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

Not run on other markets: the script requests BINANCE:BTCUSDT 3, BINANCE:BTCUSDT 5, and that data is not available here (a lower timeframe than the chart; the engine does not evaluate intrabar data; a lower timeframe than the chart; the engine does not evaluate intrabar data). Its results would rest on empty values.

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
MTF Diagonally Layered RSI - 1 minute Bitcoin Bot [wbburgin] this page—v5 strategy0.0%00.0%
Take Profit On Trend v2 (by BHD_Trade_Bot) by BHD_Trade_Botema rsi rmav5 strategy+9.4%624.0%
Hulk Strategy x35 Leverage 5m chart w-Alerts by npietronuto1rsi rma emav5 strategyNo trades on this market
Kahlman HullMA - WT Cross Strategy by pigsqema rsi rmav5 strategy+1.0%5433.3%
RSI Cross [xaurr] by livetrendrsi emav4 strategy+24.4%5335.3%
Bitpanda Coinrule Template by joshuajcoop01rsi emav5 strategy−2.8%44.6%

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.

  • No v6-only features. v6 is not needed to run this script.

Clean v5

Verified

Nothing to change.

Does it run in Pine Script v6?

Not tested

Neither version placed a trade on any of the 8 markets, so there was nothing to compare. The v6 version is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.

⋯// © wbburgin-//@version=5+//@version=6strategy("MTF Layered RSI - Bitcoin Bot [wbburgin]",overlay=false, initial_capital=10000, pyramiding=2)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 30 msWith a workaround 1,000 bars in 74 msNot measured
PineTSNot testedNot testedNot measured

The engine's host API cannot yet declare a chart's symbol and timeframe, so this page sets them on the engine directly for each market.

“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/// © wbburgin//@version=5strategy("MTF Layered RSI - Bitcoin Bot [wbburgin]",overlay=false, initial_capital=10000, pyramiding=2)length = input.int(7,"RSI Length",group="Config")tf2 = input.timeframe("3",title="HT 1",group="Config")tf3 = input.timeframe("5",title="HT 2",group="Config")ob = input.int(80,"Overbought Level",group="Config")os = input.int(20,"Oversold Level",group="Config")calcType = input.string("Manual Calculation",options=["Security Function","Manual Calculation"],title="Calc Type", tooltip="Manual calculation is a way to stop repaint without using request.security().")use200ma = input.bool(false,"Use EMA Filter",group="Risk Management")emaLen = input.int(200,"EMA Length",group="Risk Management")stoploss = input.bool(false,"Use % Stop Loss",group="Risk Management")stoplosspercent = input.float(0.5,title="Stop Loss (%)",group="Risk Management")tradeType = input.string("Long-only",options=["Long-only","Long and Short"],title="Allow Shorts?")rsi = ta.rsi(close,length)// Security RSI Calculation ____________________________________________________________________________________________indexHighTF = barstate.isrealtime ? 1 : 0indexCurrTF = barstate.isrealtime ? 0 : 1rsi2_sec = request.security(syminfo.tickerid, tf2, rsi[indexHighTF])[indexCurrTF]rsi3_sec = request.security(syminfo.tickerid, tf3, rsi[indexHighTF])[indexCurrTF]//Aligns with Tradingview's method of non-repainting: https://www.tradingview.com/pine-script-docs/en/v5/concepts/Repainting.html// Manual RSI Calculation ______________________________________________________________________________________________currentTF = timeframe.periodtf_to_int(timeframe)=>     switch        timeframe == "1S" => 1        timeframe == "5S" => 5        timeframe == "10S"=> 10        timeframe == "15S"=> 15        timeframe == "30S"=> 30        timeframe == "1"  => 60        timeframe == "3"  => 180        timeframe == "5"  => 300        timeframe == "15" => 900        timeframe == "30" => 1800        timeframe == "45" => 2700        timeframe == "60" => 3600 // 1 hour        timeframe == "120"=> 7200 // 2 hours        timeframe == "180"=> 10800 // 3 hours        timeframe == "240"=> 14400 // 4 hours        timeframe == "480"=> 28800 // 8 hours        timeframe == "720"=> 43200 // 12 hours        timeframe == "D"  => 86400 // 1 day        timeframe == "W"  => 604800 // 1 week        timeframe == "M"  => 2595000 // 1 monthct_int = tf_to_int(currentTF)ht1_int = tf_to_int(tf2)ht2_int = tf_to_int(tf3)ht1_mult = int(ht1_int / ct_int)ht2_mult = int(ht2_int / ct_int)manualRSI(time_mult, len)=>    htclose = close    u = math.max(htclose - htclose[time_mult], 0) // upward ta.change    d = math.max(htclose[time_mult] - htclose, 0) // downward ta.change    rs = ta.rma(u, len * time_mult) / ta.rma(d, len * time_mult)    res = 100 - 100 / (1 + rs)    resrsi2_man = manualRSI(ht1_mult, length)rsi3_man = manualRSI(ht2_mult, length)rsi2 = calcType == "Security Function" ? rsi2_sec : rsi2_manrsi3 = calcType == "Security Function" ? rsi3_sec : rsi3_manplot(rsi,color=color.yellow,title="RSI Current TF")plot(rsi2,color=color.new(color.yellow,50),title="RSI HT1")plot(rsi3,color=color.new(color.yellow,75),title="RSI HT2")lm=hline(os,title="Oversold")hm=hline(ob,title="Overbought")fill(hm,lm,color=color.new(color.blue,95))// Long SettingshtCross = (ta.crossover(rsi2,os) and rsi3>os and rsi>os)  or (ta.crossover(rsi3,os) and rsi2>os and rsi>os)buySig = (ta.crossover(rsi,os) and rsi2 < os and rsi3 < os) or htCrosssellSig = ta.crossunder(rsi,ob)// Short SettingshtCross_short = (ta.crossunder(rsi2,ob) and rsi3<ob and rsi<ob) or (ta.crossunder(rsi3,ob) and rsi2<ob and rsi<ob)shortEntry = (ta.crossunder(rsi,ob) and rsi2 > ob and rsi3 > ob) or htCross_shortshortExit = ta.crossover(rsi,os)//Risk Settingsema200 = ta.ema(close,emaLen)filter = use200ma ? close>ema200 ? true : false : trueshortfilter = use200ma ? close<ema200 ? true : false : truestoplosslevel_long = (1-(stoplosspercent/100)) * ta.valuewhen(buySig and filter,close,0)stoplosslevel_short = (1+(stoplosspercent/100)) * ta.valuewhen(shortEntry and shortfilter,close,0)initiate_stoploss_long = stoploss ? ta.crossunder(close,stoplosslevel_long) : nainitiate_stoploss_short = stoploss ? ta.crossover(close,stoplosslevel_short) : naif buySig and filter    strategy.entry("Long",strategy.long)if sellSig or initiate_stoploss_long    strategy.close("Long")if shortEntry and shortfilter and tradeType == "Long and Short"    strategy.entry("Short",strategy.short)if shortExit or initiate_stoploss_short    strategy.close("Short")plotshape(buySig and filter,title="Buysig",style=shape.triangleup,location=location.bottom,color=color.green,size=size.tiny)plotshape(sellSig or initiate_stoploss_long,title="Sellsig",style=shape.triangledown,location=location.top,color=color.red,size=size.tiny)