Hi guys,
I am trying to backtest KeltnerChannel, after reading book “The Art and Science of Technical Analysis”. According to statistics from the book free bars for large-cap stocks is only 3.4% of the time. Free bar is a bar which is completely outside of the bands.
I wrote strategy using just OnData/OnOrderEvent where we enter in position when we get a free bar. However, I am setting limit order at the top/bottom of the last bar, and setting another LimitOrder to the bottom/top of the channel in the direction when order get's filled. It seems to be working fine and I even got positive results. Don't have much experience but I've decided to re-write code using AlgorithmFramework. Couldn't find any LimitOrderExecutionModel, so I wrote mine. Unfortunately, I do see some strange fillings, like -2 or +5 shares. Was wondering if anyone tried to write it's own execution model, especially with LimitOrders?
Nikolay Zdravkov
Here is the original code which I wrote, just trying to re-write it now with AlgorithmFramework
Louis Szeto
Hi Nikolay
Unfortunately we do not have prewritten execution model for limit order yet, but if you wish to set a limit order, you could take a look at the immediate execution model and change to limit order logic.
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.
Nikolay Zdravkov
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!