hello Guys, i'm new here, i'm going to create a strategy using IA or others, i create a strategy and i backtested it, it works, if i go live with my API on bybit, it log in correct, but i got some errors about my orders, they are to small, or negative orders, at first i think it was because i use AddCrypto mode and not AddCryptoFutures, but this didn't relosve my issue, there are someone that can help me to create a correct code to send live?
Mia Alissi
Hello Alex, welcome to the community! It sounds like you're encountering issues with order sizes and possibly negative orders when attempting to go live with your strategy on Bybit using QuantConnect. Let's address these issues step by step.
1. Understanding Order Sizes and Negative Orders
Order Sizes Too Small: Bybit, like many exchanges, has minimum order size requirements. If your strategy generates orders that are below this minimum, the exchange will reject them. Ensure that your order sizes meet or exceed these minimums. You can usually find this information in the exchange's documentation or by querying the exchange's API for the minimum order sizes for the instruments you're trading.
Negative Orders: If you're seeing "negative orders," it might be related to how you're calculating the order quantities or values. Ensure that your logic for determining order sizes is correct. Negative values could be a sign of incorrect calculations or attempting to place orders that the exchange does not support (e.g., selling more of an asset than you own).
2. Using
AddCrypto
vs.AddCryptoFutures
AddCrypto: This method is used for spot market trading. If you're trading cryptocurrencies in the spot market, this is the correct method to use.
AddCryptoFutures: If you're trading futures contracts on cryptocurrencies, you should use this method. Futures contracts might have different requirements and behaviors compared to spot trading, including leverage, margin, and settlement.
3. Sample Code for Placing Orders
Here's a basic example of how you might structure your code to place an order with proper checks. This example assumes you're trading cryptocurrency futures:
4. Debugging and Logs
self.Debug()
to log useful information that can help you understand what's happening in your algorithm, especially around order creation.5. Testing
If you continue to face issues, consider sharing specific error messages or problematic parts of your code for more targeted advice.
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.
Roman
Hey, manÂ
Do you need a help ?
Can you share part of algo or symbols which do you use in it ?
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.
Alex Pierantoni
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!