Appearance

Personalize your experience

Mode
Accent Color
Direction
MarketplacestrategiesVIDYA Range Fade
QuaScript

VIDYA Range Fade

Free

Fades rejections of VIDYA bands while volatility index indicates range regime

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
quascriptstrategyvidyarangemean-reversion
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.

VIDYA Range Fadeengine 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

Fades rejections of the VIDYA bands while VIDYA is flat (a range), targeting VIDYA itself.


Settings

Length: 20

Band (ATR): 1.5

Stop beyond band (ATR): 1


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 "VIDYA Range Fade" {
      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/// Fades rejections of the VIDYA bands while VIDYA is flat (a range), targeting VIDYA itself.
      11len = param.int(20, title = "Length", min = 2, max = 500)
      12mult = param.float(1.5, title = "Band (ATR)", min = 0.2, max = 10, step = 0.1)
      13stopk = param.float(1.0, title = "Stop beyond band (ATR)", min = 0.1, max = 10, step = 0.1)
      14v = ta.vidya(close, len, 9)
      15a = ta.atr(14)
      16flat_v = math.abs(v - v[5]) / math.max(a, 1e-12) < 0.5
      17up = v + mult * a
      18dn = v - mult * a
      19flat = position.size == 0
      20if flat and flat_v and high > up and close < up and not math.is_na(a) {
      21 order.market("S", side.short)
      22 exit.bracket("S exit", entry = "S", stop = up + stopk * a, target = v)
      23}
      24if flat and flat_v and low < dn and close > dn and not math.is_na(a) {
      25 order.market("L", side.long)
      26 exit.bracket("L exit", entry = "L", stop = dn - stopk * a, target = v)
      27}
      28risk.max_drawdown(25)
      29pu = render.line(up, "Upper", color = color.translucent(color.violet.300, 40), width = 1)
      30render.line(v, "VIDYA", color = color.amber.300, width = 1.5)
      31pd = render.line(dn, "Lower", color = color.translucent(color.violet.300, 40), width = 1)
      32render.band(pu, pd, color = color.violet.500, opacity = 0.06, title = "Band")
      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.