Hi,
I am trying to send leveraged orders using kraken as Broker. Bur I get the following error:
Insufficient buying power to complete order
I tried to set:
self.UniverseSettings.Leverage = 2
and
self.Securities["BTCUSD"].SetLeverage(2)
But still doesn't work.
What I am doing wrong? Simple script attached.
Thank you.
Alexandre Catarino
Hi rob2505 ,
Please use the following code to set the security initializer in combination with the brokerage model:
Otherwise, the Security Initializer will overwrite the BrokerageModel settings, and use the default settings for cryptocurrencies which is the leverage of 1 using a cash buying power model. On the other hand, the Kraken Brokerage model used a margin buying power model with a leverage of 5.
We will make this “nuance” clear in the new docs.
Best regards,
Alex
Rob2505
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!