Hey Guys!
I am trying to get a deeper understanding of both the historical and live data and how it impacts limit orders.
If I set the equity I want to trade to minute resolution "self.AddEquity(self.ticker, Resolution.Minute)" and then I were to enter into long position with a limit order to take profit. Will this limit order be triggered when the new minute data bar closes on or above the limit order or would it be triggered on tick basis the moment the limit order is touched i.e. I assume with minute resolution, a bar is formed on the minute, every minute. Could the limit order be triggered say, 23seconds into a minute bar if at that point the limit order price is touched or would the limit order only be triggered when the minute bar closes on or above the limit order?
Hopefully that makes sense. Any help is hugely appreciated,
Seb
Rahul Chowdhury
Hey Sebastian,
The sell limit order will only fill if the close of the last bar is at or above the limit price. In order to act on more fine market movements, we need to use higher resolutions. For example, we can use second resolution data, which would allow our algorithm to execute our limit order at 23 seconds into the minute bar.
Best
Rahul
Sebastian Bunney
Hey Rahul,
Thanks a lot for your response. I really appreciate it. So my next question is hypothetically speaking if I were trading this algo live and I put in a limit order would that limit order not sat in the exhange waiting to be fulfilled the moment it is triggered, regardless of when my algo is recieving the updated data. Therefore even though I am running minute data that should be an issue? Or is that limit order only created within the algo itself and therefore is only updated on the resolution set.
Apologies if my question is basic. I am just trying to get to know how the system works.
Rahul Chowdhury
Hey Sebastian,
When you are live trading, the limit order is submitted to the brokerage and is filled when the order is triggered. Unlike backtesting, the limit order's execution is not restricted to the resolution of the algorithm. Instead the algorithm is updated with the latest data, such as the results of any orders, every time step.
Best
Rahul
Sebastian Bunney
Thanks Rahul. I felt like that was the case but thanks for confirming.
Sebastian Bunney
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!