Back

Multi-currency support in strategy backtesting

Does Quantconnect backtesting support multi-currency instruments in a strategy? Example, I do a pair trading on 2 instruments, one quoted in USD and the other one in JPY. What is most important is obvisouly correctly converting the PnL on the JPY leg with proper historical rate so to show the strategy PnL in USD. is this possible?

Update Backtest








Equities, Options and Futures are in USD, therefore your question doesn't apply.

If our algorithm is trading CFDs, yes: Lean/QuantConnect supports multi-currency CDFs in a strategy.

When we are trading JP225JPY, for example, the engine will look for JPYUSD to get the conversion rate in order to use USD to buy/sell JP225JPY. Both currencies will be part of our cashbook. When it closes the position, there can be "left over" JPY that will remain in the cashbook. The same logic apply to two or more instruments.

0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Thank you for youyr answer.

My intent is to trade Forex and futures and maybe equities as well. May I know what is the source of this historical FX conversion? Is it from the FX proivder like Oanda?

Why should not this apply to equities, options and futures? Are you making the assumption that traders trade only in US markets with Lean? That is not my case. Besides, CME has a Nikkei futures quoted in Yen (and another one quoted in USD).

 

Thank you

0

We have forex data from FXCM (default) and Oanda and we can choose the one we prefer when we subscribe to the data:

// FXCM is the default
AddForex("EURUSD", Resolution.Minute);
// or explicitly
AddForex("EURUSD", Resolution.Minute, Market.FXCM);
// or Oanda
AddForex("EURUSD", Resolution.Minute, Market.Oanda);

Currently, our database only have equities, options and futures quoted in USD.
But if we trade assets from these classes in another currency, the conversion will be made.

0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed