I am struggling to get Accurate price levels for my Sell orders on TP2, the stoploss is above entry price same as the Take profit, My TP2 is using 9ema if it is a buying order when price breaks below 9ema the 1st candle below 9ema will be my TP2, same thing for sell orders the strategy is opposite when price breaks above 9ema 1st candle is TP2
Itumeleng Moreotlotlo
And Stoploss for Buy Orders is above entry price
Louis Szeto
Hi Itumeleng
For your stated questions, there are 2 things to mention:
There is also some code optimization and removal of redundant variables we've done to save time and space to run that. Please check the attached backtest addressing all the above statements. BTW we’ve seen you calling [1] in RollingWindow and use the length to call the last item of a List, remember that computer starts its count at 0, so you should use [0] in RollingWindow and [^1] in List to do so.
Best,
Louis Szeto
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.
Itumeleng Moreotlotlo
Hi Louis Szeto thanks for the changes, but why is my TP2 the same as entry price if not on the sells it is above sell price orders on the logs?
Louis Szeto
Hi Itumeleng
See this line here:
The above backtest was a rough example of how to update the stop price, here we've taken the filled price (current price at that moment) as the new stop. Please adjust according to custom needs.
Best
Louis Szeto
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.
Itumeleng Moreotlotlo
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!