Rajandran R Creator of OpenAlgo Sketchmaker, RagZ. Building GenAI Applications. Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Now the recent curiosity on building Trading AI Agents.

Equity Returns after Extreme VIX and William VIX FIX Readings

1 min read

Was just going thro QUSMA blog on Equity Returns Following Extreme VIX and William VIX FIX Movements. And couple of peoples are throwing ideas on implementing the strategy with percentile rank function. The same discussion also happening in Quantopian Community which inspired me to code a strategy on extreme VIX and William VIX FIX readings for Nifty Futures in Amibroker

For Example if Percentile rank of VIX reads 98 with an 100 period lookback. It means the readings are extreme and never occurred in the last 98 bars out of 100 bars. Percentile rank will show a reading of 98-100 range if there is a sharp spike in VIX or William VIX Fix (WCF) readings. So thought of trying out a strategy on it.

The Strategy goes like this,

OpenAlgo: one API for 35+ Indian brokers

FREE AND OPEN SOURCE

OpenAlgo: one API for 35+ Indian brokers

Self-hosted algo trading platform. Send orders from Python, AmiBroker, TradingView, Excel or a no-code flow through one consistent API.

  • Unified REST and WebSocket API
  • Works with AmiBroker, TradingView, ChartInk and Excel
  • Sandbox mode to test before going live
Get OpenAlgo →by Marketcalls

Buy at the next day close if either of the VIX Percentile rank(VIXrank) or William VIX FIX Percentile rank (WVFrank) reads above 98 and also either of the readings VIXrank or WVFrank reads above 99. And Exit 4 days later at the days close.

What are the data we need collect?
Indian VIX Historical data and Nifty Futures EOD data. The real challenge is VIX data starts from 2008 onwards and NSEindia website had data from Mar 2009 onwards. So Able to backtest the strategy right from 1st Jan 2010 onwards to till date.

VIX-WVF Percentile Rank – Amibroker AFL Code
https://gist.github.com/marketcalls/53046e0784946b036b93

Backtest Considerations

4 lots of Nifty futures with 150 rs per leg as commissions + Slippages (Rs 300 Commission for two legs Buy and Sell). Rollovers charges and premium are not considered(has to be calculated manually). Another best alternative to avoid rollover is try this strategy with NiftyBEES ETF. I leave it as exercise to you people.

Equity Curve

View the Complete backtest results here.

If we try to do only with VIXpercentile rank the results are good with same winning ratio however with a little lower net profit compared to the combined VIX-WVF percentile rank strategy. However the strategy doesnt works well with standalone William VIX FIX readings. Combining both VIX-WVF produce optimal results.

Marketcalls Elite Traders Club

MEMBERSHIP

Marketcalls Elite Traders Club

Every Marketcalls course and live mentorship in one membership: 127 courses and 2,500+ hours of learning.

  • Market Profile, Orderflow, AFL, Pine Script and Python
  • Live mentorship and TradEdge trading room
  • Premium tools and the Elite Slack community

Learn by watching: free videos every week

Market Profile, order flow, Python, AI and OpenAlgo tutorials on YouTube.

Rajandran R Creator of OpenAlgo Sketchmaker, RagZ. Building GenAI Applications. Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Now the recent curiosity on building Trading AI Agents.

11 Replies to “Equity Returns after Extreme VIX and William VIX FIX…”

  1. were u meant to write either VIXrank or wvf rank above 98 then buy. . ?t
    if it is (VIXrank > 98 OR WVFrank > 98) is sufficient

    or do you wanna say one has to be ateast 98 and other 99 or above.
    then (VIXrank >= 98 AND WVFrank >= 99) OR (VIXrank >= 98 OR WVFrank >= 99) should suffice.

    in second case the results vary a lot and no of trades goes too minimal.

      1. But your afl says buy when
        (VIXrank >= 98 OR WVFrank >= 98) AND (VIXrank >= 99 OR WVFrank >= 99);
        which is same as (VIXrank > 98 OR WVFrank > 98) . which means either one has to be above 98.

        if we say both has to be above 98 then we need to use
        (VIXrank >= 98 AND WVFrank >= 99) OR (VIXrank >= 98 AND WVFrank >= 99);

        where the trades in the same time period will come down from 48 to 13. same as goes profitiablity.

        I meant the formula is different from what you are saying.

  2. This strategy does not work with NiftyBEES ETF. It gives negative results with daily data. Strange that there is a huge difference in returns.

  3. Hello!! It’s greats, how do i coloured the profit table with red and green profits??

    thank you

  4. Some body please help me to get this code, i am not finding it anywhere

Leave a Reply

Get Notifications, Alerts on Market Updates, Trading Tools, Automation & More