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 the strategy for Nifty Futures in Amibroker
[wp_ad_camp_5]
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,
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 WVF strategy. Combining both VIX-WVF produce optimal results.
Dear Rajendran, Thanks a lot for this indicator….
very good
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.
Yes the trade goes minimal in second case thats what the strategy focuses.
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.
This strategy does not work with NiftyBEES ETF. It gives negative results with daily data. Strange that there is a huge difference in returns.
How about getting the signals in Nifty Futures and taking trades in Nifty BEES?
This could be one option. I still need to check this.
Hello!! It’s greats, how do i coloured the profit table with red and green profits??
thank you
Some body please help me to get this code, i am not finding it anywhere
Dear Rajendraji, please share the AFL as i am not finding it anywhere