Coinbase has different market statuses for crypto pairs, including full-trading, limit-only, etc. For example, limit-only means only limit orders can be accepted for this pair. Is there a method in QC to get the market status of a given crypto pair, especially during live trading? It is important because otherwise if we send a market order for a limit-only pair, an error would occur. Alternatively, can we use some try-and-catch workaround: we try to send a market order, and if we receive an error due to its market status, we change it to a limit order or remove this pair from the universe? If that is possible, is there an example for something similar?
Ashutosh
Hey Haochuan LiÂ
QuantConnect does not support market statuses for crypto pairs but as you mentioned you can use a try-catch block to get around the exception.
I've attached a simple simulated code where the security is removed when the exception occurs.
Let me know if this helps.
Sample Log output:
Best,
Ashutosh
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.
Louis Szeto
Hi Haochuan
Lean will return a log of error if the order is invalid. You can check the error codes in here. You can also check a specific order's state in OnOrderEvent by
given you save the order ID.
Best
Louis
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.
Haochuan Li
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!