Back

These models are currently unsuitable for Cash Modeled brokerages

I just tried to implement an algorithm based on the new QCAlgorithmFramework. 

The exception: "These models are currently unsuitable for Cash Modeled brokerages" informed me that I cannot use it yet for my cash account.

Is support for cash accounts coming in the next few weeks? I'm asking, because I need to decide whether I want to wait or implement my idea "the old way".

PS: I love the idea of the new framework btw! :-) 

  

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.


Thanks Fabian! I recommend for crypto for now you write custom models or use the old system. We had to disable crypto as it was nearly impossible to automatically execute with the current accounting system we're using. No traditional brokerages use cash-settled-fx so its been a bit of a learning curve for us.

We're doing some research into how we can model and account for crypto portfolios in a way which meshes with the existing portfolio systems of LEAN. This is a "hard problem" which we can't rush and will take more than a few weeks. 

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.


Hi Jared, thanks for the info! I'll stay with the old system for the moment.

0

Is there any headway on this? I'm new to QC and I only have a cash account at IB - am I wasting my time developing on this platform?

0

Hi Jake, cash accounts work fine just not crypto which doesnt follow same portfolio modeling patterns.

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.


Is there something I need to code for in my scripts? I'm getting this error when the only security I've specified is "CRON".

 

Successfully sent backtest request for 'Crawling Brown Zebra', (Compile Id: c5da803d81965a481889f452f46b2a3c-460f2daf1fe02f4f0a76a83c72905885)
164 | 23:46:49:
These models are currently unsuitable for Cash Modeled brokerages (e.g. GDAX) and may result in unexpected trades. To prevent possible user error we've restricted them to Margin trading. You can select margin account types with SetBrokerage( ... AccountType.Margin)

 

0

Hi Jake,

CRON isn't a currency supported by either GDAX or Bitfinex, which are our two data vendors for crypto. The error you are receiving, however, doesn't stem from using an unsupported symbol but rather that GDAX doesn't support margin trading, and so you need to specify AccountType.Cash in the SetBrokerageModel call in the Initialize method (you can see more information on this in this community forum post). Bitfinex, however, does support margin trading and so you can use this brokerage instead if you want to trade using margin.

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.


My problem is the opposite of what you mention; but along the same lines I suppose? My account with IB is a Cash account. So originally I had set:

self.SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage, AccountType.Cash)

Which resulted in:

"These models are currently unsuitable for Cash Modeled brokerages (e.g. GDAX) and may result in unexpected trades. To prevent possible user error we've restricted them to Margin trading"

(opposite of what you said are the restrictions)

So I had to change it to the following in order to keep developing my algo:

self.SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage, AccountType.Margin)

Which is not my real account status. By setting it this way I'm able to view CRON (though it's the US market and not Canada. But I suppose my IB account can pass my Canadian market data to QC, no?). I don't quite understand the reason for the restriction on Cash trading however.

0

The restriction on Cash trading is done on our end, and only specifically for Framework Algorithms, which you can see here. Cash modeling poses several unique problems with respect to the algorithm framework. One constant issue is that our primary cash brokerage, GDAX, doesn't support the concept of virtual positions (this is GDAX specific since they don't support margin trading, but we've applied the restriction across all brokerages, including IB). Another issue is the very concept of a virtual position. In cash modeling, there are no virtual positions, just currencies. In this model, an issue is how do we phrase portfolio targets. For example, if I emit a target of 10 BTC/USD but don't own USD, what does that mean? I might have millions of dollars of LTC, but since I don't own any USD I won't be able to execute on BTC/USD. A smart algorithm might sell some LTC for BTC instead. At this point, we're getting into the nitty-gritty of an individual algorithm and how that algorithm might transition between various currencies. The framework absolutely supports these types of things, but it requires agreement between the portfolio construction model and the execution model as to exactly what a target is describing.

Cash Account support for Framework Algorithms is something we're looking into but we can't provide a timeline of when this might be implemented. In the meantime, you can mimic using a cash account in backtesting by setting security leverage to 1. This can be done by adding a line in the security initialization function in StandardAlgorithm.py

def SetSecurities(self, security):
security.SetDataNormalizationMode(DataNormalizationMode.Raw)
security.SetLeverage(1)

We don't support any equities in Canadian markets right now, i.e. CRON on the Toronto exchange, and so I can't tell you for certain whether or not IB would be able to accommodate this if you tried their ticker for CRON in Toronto (I think it would be CRON.TO or something similar).

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