Appearance

Personalize your experience

Mode
Accent Color
Direction
MarketplacestrategiesBook RSI Reversal
QuaScript

Book RSI Reversal

Free

Fades oversold price when the order book RSI shows strong bid support

0.0(0)
0 installs 0 0 comments
Q
433 listings

The QuaTick team's QuaScript analyses, run by the native C++ engine.

View Profile
quascriptstrategyorder-bookrsireversal
Free
Backtest this strategy Open in QuaCode Edit in IDE
Version
Updated
Compatible

Live engine preview

QuaScriptQuaScript

The QuaScript engine's own output on the chart the terminal uses. Change the settings or edit the code and press Run to recompute it.

Book RSI Reversalengine result
Loading the engine result…
quatick-charts · QuaScript engine on synthetic 1-minute bars · drag to pan · scroll to zoom · Run executes the script on the engine (⌘/Ctrl+Enter while editing)

About

Buys when price RSI is oversold while the order book RSI shows bids building (the book disagrees with the selling), sells the mirror. Exit at the RSI midline or an ATR stop. Needs the order book (L2): trades only on bars with a recorded book.


Settings

Band around mid (%): 0.25

Stop (ATR): 1.5


Backtest it yourself

Open it on the backtesting page to run it on any symbol, interval and date range, then use Monte Carlo, optimisation, walk-forward and robustness tests.

Strategy Rules

Entry Conditions

    Exit Conditions

      Source Code

      Edit in IDE
      quascript
      1strategy "Book RSI Reversal" {
      2 overlay = true
      3 capital = 100000
      4 commission = 0.05
      5 slippage = 1
      6 sizing = risk_percent
      7 size = 1
      8 max_leverage = 1
      9}
      10/// Buys when price RSI is oversold while the order book RSI shows bids building (the book disagrees
      11/// with the selling), sells the mirror. Exit at the RSI midline or an ATR stop.
      12/// Needs the order book (L2): trades only on bars with a recorded book.
      13pct = param.float(0.25, title = "Band around mid (%)", min = 0.02, max = 5, step = 0.01)
      14stopk = param.float(1.5, title = "Stop (ATR)", min = 0.2, max = 10, step = 0.1)
      15b = book.liquidity(pct, book.bid_side)
      16a_ = book.liquidity(pct, book.ask_side)
      17d = math.coalesce((b - b[1]) - (a_ - a_[1]), 0)
      18brsi = 100 - 100 / (1 + ta.rma(math.max(d, 0), 14) / math.max(ta.rma(math.max(-d, 0), 14), 1e-12))
      19r = ta.rsi(close, 14)
      20a = ta.atr(14)
      21flat = position.size == 0
      22if flat and r < 30 and brsi > 55 and not math.is_na(a) and not math.is_na(b) {
      23 order.market("L", side.long)
      24 exit.bracket("L stop", entry = "L", stop = close - stopk * a)
      25}
      26if flat and r > 70 and brsi < 45 and not math.is_na(a) and not math.is_na(b) {
      27 order.market("S", side.short)
      28 exit.bracket("S stop", entry = "S", stop = close + stopk * a)
      29}
      30if position.size > 0 and r > 50 { exit.close_all() }
      31if position.size < 0 and r < 50 { exit.close_all() }
      32risk.max_drawdown(25)
      33 
      Read-only preview. Open in QuaCode to edit and deploy.

      Reviews

      No reviews yet. Be the first to review this listing.

      Discussion

      Sign in to join the discussion. Your posts and replies show up on your profile.