Jared Broad Jared Broad is the founder and CEO of QuantConnect - a web based algorithm trading platform, combining a powerful cloud with 15 years free financial data. Clone open-sourced trading algorithms from the community and trade them on your own brokerage account. Sign up for free at QuantConnect.com

Rotating Inversely Correlated Assets – NIFTY and USDINR

1 min read

Over the last 15 years the economy of India has boomed and it has been reflected in the NIFTY index. The NIFTY has grown 7x since 1998 as the country has grown its exports. According to the UN the one of the primary exports of India are high value services which contributes 30% to their GDP.

We developed a hypothesis that as the strength of the NIFTY grew, the strength of the currency would follow as it is a primarily export economy. As the INR strengthens the ratio to USD falls making it an almost ideally inversely correlated asset.

We first tested this hypothesis treating the USDINR FX pair as a hedge against the NIFTY, but found there were periods where they were positively correlated and the hedge did not work.

Pivoting slightly we experimented with rotating the holdings of the portfolio to focus on the peak performing asset. We used a fixed rolling window to determine the peak performance and then swapped our holdings to focus on that asset.

[wp_ad_camp_5]

 
We used the QuantConnect LEAN 2.0 backtesting engine which allowed us to import financial data from any source to run our analysis. The backtests were conducted over a 16 year period and were completed in 5-10 seconds. We saw phenomenal performance due to the strongly trending nature of the NIFTY and USDINR, achieving a Sharpe Ratio achieving 1.3 vs the NIFTY 0.7, and 42x returns vs 7x of the NIFTY.

[js] document.write(“[div class=\”qc-embed-frame\” style=\”display: inline-block; position: relative; width: 98%; min-height: 100px; min-width: 300px;\”][div class=\”qc-embed-dummy\” style=\”padding-top: 56.25%;\”][/div][div class=\”qc-embed-element\” style=\”position: absolute; top: 0; bottom: 0; left: 0; right: 0;\”][iframe class=\”qc-embed-backtest\” height=\”100%\” width=\”100%\” style=\”border: 1px solid #ccc; padding: 0px; margin: 0px;\” src=\”https://www.quantconnect.com/terminal/cache/embedded_backtest_c7e3f80567e6f6392c9e089d76281f08.html\”][/iframe][/div][/div]”);
[/js]

To test the resilience of the strategy we experimented with the rolling window period to determine if this was critical to the success of the strategy. We used a rotating window from 3 days up to a 30 day window to optimize the variable for the best performance:

The resulting Sharpe Ratio is fairly robust regardless of the precise value of the rotating window period.
We believe there are many potential future improvements to the strategy to be explored; such as using a dynamically determined rolling window to avoid curve fitting. You could also experiment with different portfolios of inversely correlated assets to pick the best basket of assets.

This post originally appeared on the QuantConnect Blog. QuantConnect is a free online back-testing solution, seeking to democratize finance and make algorithmic trading accessibly to all investors.

    Jared Broad Jared Broad is the founder and CEO of QuantConnect - a web based algorithm trading platform, combining a powerful cloud with 15 years free financial data. Clone open-sourced trading algorithms from the community and trade them on your own brokerage account. Sign up for free at QuantConnect.com

    Amibroker Vs Tradingview Vs Python Which One to Use…

    When choosing a platform for systematic trading, there are a few key factors to consider, including the features and capabilities of the platform, the...
    Rajandran R
    1 min read

    Finfolab Technologies developed API Solutions for Goodwill

    Finfolab Technologies developed Arrow API solutions for Goodwill. Our API solutions enable retail traders and Goodwill commodities partners to design and deploy advanced algorithmic...
    Rajandran R
    34 sec read

    How to Build a Winning Trading System

    Here is a practical guide to Building a Winning Trading System. It explains what a trading system is all about and what are the...
    Rajandran R
    21 sec read

    4 Replies to “Rotating Inversely Correlated Assets – NIFTY and USDINR”

      1. In simple terms it is like having a Portfolio of Nifty and USDINR future instruments (Inversely correlated Assets) and Rebalance it like a Mutual fund frequently to generate descent returns.

    1. Very interesting, however, I’m trying to figure out how you determined when to switch assets. Although I’m terrible at C#, from what I understood after reading your sourse code after importing it into QC v.2, you are determining which asset to trade based on MaxGain from today.Prices.Keys. Please correct me if I’m wrong.

      If that is indeed the case, would that be equivalent to looking into the future? I’m pretty sure it would be if you did that in Amibroker…

      1. Sorry for the delayed reply — we look at whatever asset has the best performance in the last x-period and move into that asset. It works because the NIFTY and INR are inversely correlated in their very nature — the stronger the indian economy gets the more buying power you have to the USD.

    Leave a Reply

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