Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

Configurable BB+RSI+Aroon strategy backtest for binary options

A Pine Script v5 strategy built on Highestbars (high, Aroonish_length + 1), Lowestbars (low, Aroonish_length + 1) and RSI (close, 4). It has 5 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 commits 4000 in cash and pays no commission. 10 settings; defaults include Aroonish Lenght 4, Aroonish Confirmation Value 50 and RSI Lenght 4.

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 Configurable BB+RSI+Aroon strategy backtest for binary options repaint?
Yes
At least one pattern in the source can repaint: intrabar recalculation.
How did Configurable BB+RSI+Aroon strategy backtest for binary options 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 code limits trading to a date window, which can leave this period out. It closed no trades on the other markets either. A backtest, not investment advice.
Does Configurable BB+RSI+Aroon strategy backtest for binary options 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 Configurable BB+RSI+Aroon strategy backtest for binary options use a stop loss?
No
Every exit waits for a signal; nothing limits a losing trade before it fires.
Does Configurable BB+RSI+Aroon strategy backtest for binary options run in Zeal Terminal?
Yes
It compiles in 32 ms and runs 1,000 bars in 72 ms, in the browser.

BTCUSDT · 1D · default settings

  • Ar-B
  • Ar-S
  • RSI-B
  • RSI-S
  • Plot
  • Plot
  • BB-B
  • BB-S
  • 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 (10)
50,00075,000100,000125,000AprJulOct2025AprJulOct2026AprJulOct$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.
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
Aroonish Lenght4int · min 1Aroonish_upper Aroonish_lower
Aroonish Confirmation Value50int · min 0 · max 100 · step 25Aroonish_ConfLong Aroonish_ConfShrt
RSI Lenght4intRSI
RSI Oversold Limit20intConditionLong RSI-B
RSI Overbought Limit80intConditionShrt RSI-S
Bollinger Lenght20int · min 1BB_basis BB_dev
Bollinger Std Dev2.5float · min 0.1 · max 50 · step 0.1BB_dev
Bars to keep the operation open3int · min 1 · max 30close A22.L close A22.S line 58 line 62
Start DateStart date and time of backtesttimestamp('14 Sep 2022 06:00 +0100')timeinDateRange
End DateEnd date and time of backtesttimestamp('16 Sep 2022 16:00 +0100')timeinDateRange

What it calculates

  • Highestbarshigh, Aroonish_length + 1Aroonish_upper · line 11
  • Lowestbarslow, Aroonish_length + 1Aroonish_lower · line 12
  • RSIclose, RSI Lenght (4)RSI · line 24
  • SMAclose, Bollinger Lenght (20)BB_basis · line 32
  • Stdevclose, Bollinger Lenght (20)BB_dev · line 33

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.

highhighprice dataAroonish_lengthAroonish Lenghtsetting · 4lowlowprice dataclosecloseprice dataRSI_lengthRSI Lenghtsetting · 4BB_lengthBollinger Lenghtsetting · 20BB_multBollinger Std Devsetting · 2.5RSI_overBoughtRSI Overbought Limitsetting · 80RSI_overSoldRSI Oversold Limitsetting · 20timetimeprice dataiSDateStart Datesetting · timestamp('14 Sep 2…iFDateEnd Datesetting · timestamp('16 Sep 2…Aroonish_ConfValAroonish Confirmation V…setting · 50nBarsBars to keep the operat…setting · 3Aroonish_upperHighestbars→ Aroonish_upperAroonish_lowerLowestbars→ Aroonish_lowerRSIRSI→ RSIBB_basisSMA→ BB_basisBB_devStdev→ BB_devBB_upper, BB_lowerBB_upper · BB_lower2 valuesConditionShrtConditionShrtconditionConditionLongConditionLongconditioninDateRangeinDateRangeconditionAroonish_ConfLong, Aroonish_ConfShrtAroonish_ConfLong · Aro…2 conditionsentry:A22.LOpen A22.Lstrategy.entryclose:A22.LClose A22.Lstrategy.closeentry:A22.SOpen A22.Sstrategy.entryclose:A22.SClose A22.Sstrategy.closeclose_all:close_all strategy.close_allplotshape:17Ar-Bplotshapeplotshape:18Ar-Splotshapeplotshape:25RSI-Bplotshapeplotshape:26RSI-Splotshapeplot:36plotplotplot:37plotplotplotshape:45BB-Bplotshapeplotshape:46BB-Splotshape

Order rules

OrderFires whenBy defaultLine
Open A22.L longinDateRange and ConditionLongOn57
Close A22.LinDateRange and ConditionLong[nBars]On59
Open A22.S shortinDateRange and ConditionShrtOn61
Close A22.SinDateRange and ConditionShrt[nBars]On63
Close not inDateRangeOn65

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 dataThe script requests no other symbol or timeframe.
  • ClearFuture-bar referencesNo negative history offsets such as close[-1].
  • CheckIntrabar recalculationcalc_on_every_tick = true. 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

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 1D0.0%+102.5%00%—0.0%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h0.0%+5.5%00%—0.0%8 May 2026 – 21 Oct 2026
ETHUSDT 1D0.0%+9.8%00%—0.0%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h0.0%+8.4%00%—0.0%8 May 2026 – 21 Oct 2026
SOLUSDT 1D0.0%+16.7%00%—0.0%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h0.0%+21.5%00%—0.0%8 May 2026 – 21 Oct 2026
BNBUSDT 1D0.0%+148.3%00%—0.0%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h0.0%+17.1%00%—0.0%8 May 2026 – 21 Oct 2026

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

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
Configurable BB+RSI+Aroon strategy backtest for binary options this page—v5 strategy0.0%00.0%
Bollinger Bands And Aroon Scalping (by Coinrule) by Coinrulesma stdev highestbars lowestbarsv4 strategy−5.4%810.0%
Bottom catch strategy by footlzsma stdev rsiv4 strategy+3.9%37.1%
Madri by Mdemoiorsi sma stdevv4 strategy+25.0%436.4%
Bollinger Bands and RSI Short Selling (by Coinrule) by Coinrulesma stdev rsiv5 strategy+7.6%34.3%
Shorting when Bollinger Band Above Price with RSI (by Coinrule) by Coinrulesma stdev rsiv5 strategyNo trades on this market

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.

  • 3 settings use the untyped input() (line 21, 22, 23). 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

Not verified

Neither version placed a trade on any of the 8 markets, so there was nothing to compare.

  • Line 21: input() → input.int()
  • Line 22: input() → input.int()
  • Line 23: input() → input.int()
⋯// ====================================================================================-RSI_length = input(4, title='RSI Lenght')+RSI_length = input.int(4, title='RSI Lenght')-RSI_overSold = input(20, title='RSI Oversold Limit')+RSI_overSold = input.int(20, title='RSI Oversold Limit')-RSI_overBought = input(80, title='RSI Overbought Limit')+RSI_overBought = input.int(80, title='RSI Overbought Limit')RSI = ta.rsi(close, RSI_length)⋯

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.

⋯// CBRA for binary options (Configurable Bollinger Bands, RSI and Aroon)-//@version=5+//@version=6// ====================================================================================⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 32 msYes 1,000 bars in 72 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/// Developed by Marco Jarquin as part of Arkansas 22 Project for Binary Options// CBRA for binary options (Configurable Bollinger Bands, RSI and Aroon)//@version=5// ====================================================================================strategy('A22.CBRA.Strat', overlay=true, initial_capital=10000, currency='USD', calc_on_every_tick=true, default_qty_type=strategy.cash, default_qty_value=4000, commission_type=strategy.commission.cash_per_order, commission_value=0)// Aroonish Parameters// ====================================================================================Aroonish_length = input.int(4, minval=1, title='Aroonish Lenght')Aroonish_ConfVal = input.int(50, minval=0, maxval=100, step=25, title='Aroonish Confirmation Value')Aroonish_upper = 100 * (-ta.highestbars(high, Aroonish_length + 1) + Aroonish_length) / Aroonish_lengthAroonish_lower = 100 * (-ta.lowestbars(low, Aroonish_length + 1) + Aroonish_length) / Aroonish_length// Aroonish confirmations// ====================================================================================Aroonish_ConfLong = Aroonish_lower >= Aroonish_ConfVal and Aroonish_upper < Aroonish_lowerAroonish_ConfShrt = Aroonish_upper >= Aroonish_ConfVal and Aroonish_upper > Aroonish_lowerplotshape(ta.crossover(Aroonish_lower, Aroonish_upper), color=color.new(color.red, 0), style=shape.triangledown, location=location.abovebar, size=size.auto, title='Ar-B')plotshape(ta.crossover(Aroonish_upper, Aroonish_lower), color=color.new(color.green, 0), style=shape.triangleup, location=location.belowbar, size=size.auto, title='Ar-S')// RSI Parameters// ====================================================================================RSI_length = input(4, title='RSI Lenght')RSI_overSold = input(20, title='RSI Oversold Limit')RSI_overBought = input(80, title='RSI Overbought Limit')RSI = ta.rsi(close, RSI_length)plotshape(ta.crossover(RSI, RSI_overSold), color=color.new(color.orange, 0), style=shape.square, location=location.belowbar, size=size.auto, title='RSI-B')plotshape(ta.crossunder(RSI, RSI_overBought), color=color.new(color.orange, 0), style=shape.square, location=location.abovebar, size=size.auto, title='RSI-S')// Bollinger Parameters// ====================================================================================BB_length = input.int(20, minval=1, title='Bollinger Lenght')BB_mult = input.float(2.5, minval=0.1, maxval=50, step=0.1, title='Bollinger Std Dev')// BB_bars = input(3, minval=1, maxval=5, title="Check bars after crossing")BB_basis = ta.sma(close, BB_length)BB_dev = BB_mult * ta.stdev(close, BB_length)BB_upper = BB_basis + BB_devBB_lower = BB_basis - BB_devp1 = plot(BB_upper, color=color.new(color.blue, 0))p2 = plot(BB_lower, color=color.new(color.blue, 0))// Bars to have the operation open// ====================================================================================nBars = input.int(3, minval=1, maxval=30, title='Bars to keep the operation open')// Strategy condition short or long// ====================================================================================ConditionShrt = (ta.crossunder(close, BB_upper) or ta.crossunder(close[1], BB_upper[1])) and Aroonish_ConfShrt and (ta.crossunder(RSI, RSI_overBought) or ta.crossunder(RSI[1], RSI_overBought[1]))ConditionLong = (ta.crossover(close, BB_lower) or ta.crossover(close[1], BB_lower[1])) and Aroonish_ConfLong and (ta.crossover(RSI, RSI_overSold) or ta.crossover(RSI[1], RSI_overSold[1]))plotshape(ta.crossover(close, BB_lower), color=color.new(color.blue, 0), style=shape.circle, location=location.belowbar, size=size.auto, title='BB-B')plotshape(ta.crossunder(close, BB_upper), color=color.new(color.blue, 0), style=shape.circle, location=location.abovebar, size=size.auto, title='BB-S')// Make input options that configure backtest date range// ====================================================================================iSDate = input.time(title='Start Date', defval=timestamp('14 Sep 2022 06:00 +0100'), tooltip='Start date and time of backtest')iFDate = input.time(title='End Date', defval=timestamp('16 Sep 2022 16:00 +0100'), tooltip='End date and time of backtest')// Look if the close time of the current bar falls inside the date range// ====================================================================================inDateRange = time >= iSDate and time < iFDate// Evaluates conditions to enter short or long// ====================================================================================if inDateRange and ConditionLong    strategy.entry('A22.L', strategy.long)if inDateRange and ConditionLong[nBars]    strategy.close('A22.L', comment='A22.L Exit')if inDateRange and ConditionShrt    strategy.entry('A22.S', strategy.short)if inDateRange and ConditionShrt[nBars]    strategy.close('A22.S', comment='A22.S Exit')if not inDateRange    strategy.close_all()