Hello,
I'm trying the fading the gap strategy from bootcamp but I would like to set stops based on daily time frame indicators such as ATR/ADR.
For one, how can I enter with a limit order at the opening price (as soon as market opens) instead of waiting for a bar to complete?
Two, once position is entered, how can I make it immediately set profit target(limit) and stops(market).
Three, I want the stop to be based on say, 5 day ATR. So, say if 5 day ATR was 2.00 I want the stop to be 2.00 away from the opening price(entry price).
I just started learning the framework this week and I just do not understand how each method and object interact with each other for this framework. I wish I can see what's going on underneathe and test things out in a shell environment or something.
Shile Wen
Hi Python Trader,
It is not possible to enter a limit order at the opening price. We must wait for at least one bar to complete before we can submit any orders. To address this, I suggest using a granular resolution, such as Minute or Second.
To submit other orders as soon a position is entered, I suggest submitting the orders in OnOrderEvent or putting the order logic where the entry order is also placed.
I suggest storing a field that keeps track of the open/entry and using the ATR indicator.
Best,
Shile Wen
Python Trader
If I add equity with Second resolution, can I simply consolidate to daily resolution and store the ATR indicator, while using the second resolution for entry?
Thanks for the reply!
Shile Wen
Hi Python Trader,
This is certainly possible as OnData still operates on the non-consolidated timeframe. Furthermore, these docs show how to use consolidated data for indicators.
Best,
Shile Wen
Python Trader
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!