Back

How to place a Stop-loss/Take-profit order?

Hi everyone, I'm new to QuantConnect and I'm making my first steps on the platform. To start I'm working on an algorithm to find Hammer price patterns and place order based on them. My problem is that when I found my price pattern (at least I hope) I would like to place an order with Stop-loss and Take-profit parameters. It's absolutely crucial for the price patterns method.
Am I losing something? How can a place an order with stop AND limit parameters?

Thanks!

Nic
Update Backtest








Welcome @Nic! We currently support limit, stop-market and market order types. We're rolling out the live trading now (to subscribers) but once the live trading is implemented we'll go back and extend the order types we support.

Its relatively simple to add an order fill type; if you're proficient at C# we'd welcome your help broadening the support! I'll add it to the Git issues list here: github.com/QuantConnect/Lean/issues
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.


This would be pretty easy to implement, however, a new property would need to be added to the Order class, or, some composite class which holds the stop and limit orders could be created. Once a stop is hit, the order is just a limit order. Any thoughts on a preferred implementation?
0

In Interactive Brokers this is called an OCA order - "one cancels all". An order which references other orders, and when one of them is filled the rest are cancelled.

Best this is implemented in stages @Jordan - I've put the first step here on Github :), lets do a stop limit order as a first step and continue implementation discussion there.
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