Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Intrabar order generation - not recommended, but why?
I tried to search through previous threads to see if this has been discussed, but didn't find one. If I missed it I do apologize!
But anyways, when reading about strategies and whatnot, I see a common theme which is to not generate the orders inside of the bars. My question is.. why not? I understand that bars can "solidify" some information, but that information is essentially completely arbitrary based upon how one decides to form the bars. Is there a reason why a lot of strategies aim towards "wait for the close of the bar to see if the condition is met" rather than "as soon as the conditions are met get in on it NOW"? Is it just that it's easier to evaluate a strategy when one can determine that it follows their rules? Does the close provide some kind of "confirmation"? Honestly just looking for some opinions on this
Can you help answer these questions from other members on NexusFi?
Maybe you're confusing two things? Not sure but just a guess.
I'm usually entering a trade during a bar (i.e. buying on a stop above or selling on a stop below a bar). It's just that the decision to enter on the next bar is indicated by the close of that bar before.
So even in very strong breakouts I always wait for the bar to close before I decide to get in or out. By entering earlier you might get your occasional one, two or three ticks favor but at least once a day you can easily get trapped as well, especially on news events like FOMC.
Fat Tails
Berlin, Europe
Market Wizard
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102
When talking about generating intra-bar orders, it is important to distinguish
- between entry orders and exit orders
- between market orders, stop orders and limit orders
- between trading indicators signals and price action
Let us go through this step by step. I will start with exit orders.
Exit orders:
When you add a bracket to your existing position, you will typically add a profit target and a stop loss. The respective order types are a limit order and a stop order. These order types typically reside at the exchange and will be executed intra-bar. Why wouldn't you execute them intra-bar?
To avoid your stop from being triggered by stop hunters you may decide not to place a hard stop at the exchange but simulate the stop with a strategy which is running on your computer. In that case you may wait for a bar close beyond the stop value and then exit your position with a market order at the bar close.
This is something that works well with trailing stops such as the SuperTrend or the Chandelier Stop. Backtests will improve, if you do not use a hard stop, but wait that the stop is taken out by the close rather than intra-bar.
However, there is no point to wait until the bar close to take your profit. A profit target should always be set as a limit order which is triggered intra-bar.
Entry Orders:
Most indicators used by charting software are calculated from the bar close. Therefore all results that are shown on a historical chart rely on the bar close as input data for all chart indicators. In case you decide to enter intra-bar, your real-time performance will not be in line with the historical performance. This is particularly true, if you use market orders for entering your position.
However, this does not invalidate intra-bar entries in general. When trading breakouts, you may use a stop order to enter a position. When trading pullbacks you may use a limit order to enter a position. In both cases you would enter your positions intra-bar, when the stop order or the limit order has been hit. These entries are based on price action alone and there is no point to wait until the bar close.
In contrary, when your decision to enter a position depends on an indicator that generates a signal, you would rather wait until the bar close and then enter with a market order. Any indicator signal generated intra-bar may not persist and disappear when the bar closes. I would answer the question of entering intra-bar as
-> entries based on price action (limit or stop orders): should be generated intra-bar
-> entires based on indicator signals (market order): should be generated at the bar close
It is possible to overcome the first issue by adding a secondary bar series of 1-tick bars, while second issue can be fixed with special bar types such as Better Renko bars. Nevertheless, intra-bar market order are always a pain to deal with in a backtest, and I would refrain from using them. This is what is typically used for a backtest:
limit orders -> entry or exit at the limit price
stop orders -> entry or exit at the stop price plus/minus slippage
market orders -> entry or exit at the bar open plus/minus slippage
Based on these assumptions intra-bar market orders will harm any backtest - unless you complicate it with oversophistication and secondary bar series.
Summary:
Use market orders at the bar close, while limit and stop orders should be executed intra-bar. Market orders shall be used for indicator generated signals. Limit and stop orders are the tool of your choice when trading price action.
Wow....thanks!! I've been casually (and profitably) coding in EL/PL for .... oh geez.... 25 years? (Mmmm. .. Yeah. Oooof!! 25+ years. Ouch!! I've never said that out loud before) But back to the point. This is the first logical and actionable explanation I've ever run across of when to use, or not to use, intra bar order generation. Thanks!!