I am trying to automatically attach essentially a limit stop loss order after every buy signal thats recieved. Functions are at line 102 and 111. From my thought process, after the condition of the Buy Signal runs, the Sell Singal should then apply the specified parameters to the open holding.
Can anyone please advise?
Derek Melchin
Hi Axist,
It's correct that the `buySignal` and `sellSignal` methods are called sequentially, but the algorithm above doesn't place any orders. The underlying issue is that `self.superTrend.atrUp.IsReady` is always false. See the attached backtest logs for reference.
Also note that `buySignal` and `sellSignal` are scheduled to run at the market open (9:30AM). Since we subscribed to hourly data, orders that are placed at the market open will be filled with stale data.
For further assistance setting TP and SL orders, refer to this thread.
Best,
Derek Melchin
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.
Axist
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!