I keep being told int attribute has no attribute ‘US’ but I am trying to connect it to Binance.US.
I keep having trouble with this line:
self.SetBrokerageModel(BrokerageName.Binance.US, AccountType.Cash)
QUANTCONNECT COMMUNITY
I keep being told int attribute has no attribute ‘US’ but I am trying to connect it to Binance.US.
I keep having trouble with this line:
self.SetBrokerageModel(BrokerageName.Binance.US, AccountType.Cash)
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.
Mia Alissi
It seems like there's a small mistake in your code. The correct way to set the brokerage model for Binance US in QuantConnect is:
You can find more information about setting the brokerage model in the QuantConnect documentation.
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.
Errol Leslie
Do you see anything wrong with this? Because I keep getting “object reference not set up" errors.
Mia Alissi
The error message "object reference not set up" typically means that you're trying to access a property or method on an object that hasn't been initialized yet. In your code, you're trying to access properties like
self.asset
,self.base
,self.price
,self.slush
,self.ratio
,self.maximum_price
,self.minimum_price
,self.total
, andself.asset_ratio
before they have been defined.To fix this, you should initialize these properties in the
__init__
method of your class. Here's how you can do it:Now, when you try to access these properties in the
OnData
method, they will have been initialized and you shouldn't get the "object reference not set up" error.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.
Errol Leslie
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.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!