NexusFi: Find Your Edge


Home Menu

 





Intrabar order generation - not recommended, but why?


Discussion in Traders Hideout

Updated
      Top Posters
    1. looks_one Quick Summary with 1 posts (0 thanks)
    2. looks_two wldman with 1 posts (1 thanks)
    3. looks_3 Pa Dax with 1 posts (0 thanks)
    4. looks_4 abev with 1 posts (0 thanks)
    1. trending_up 4,199 views
    2. thumb_up 20 thanks given
    3. group 8 followers
    1. forum 7 posts
    2. attach_file 0 attachments




 
 

Intrabar order generation - not recommended, but why?

 
 technoloG 
Walnut Creek, CA/USA
 
Experience: Beginner
Platform: Tradestation
Broker: Tradestation
Trading: Interest Rate Futures
Posts: 6 since Sep 2018
Thanks Given: 3
Thanks Received: 1

Hi all,

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

Started this thread

Can you help answer these questions
from other members on NexusFi?
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Exit Strategy
NinjaTrader
Are there any eval firms that allow you to sink to your …
Traders Hideout
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
38 thanks
NexusFi site changelog and issues/problem reporting
27 thanks
GFIs1 1 DAX trade per day journal
18 thanks
The Program
18 thanks
 
 kevinkdog   is a Vendor
 
Posts: 3,646 since Jul 2012
Thanks Given: 1,890
Thanks Received: 7,338



technoloG View Post
Hi all,

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

You can't backtest accurately with IBOG.

Follow me on Twitter
Thanked by:
 
 
Pa Dax's Avatar
 Pa Dax 
Netherlands
Price Action Scientist
 
Experience: Advanced
Platform: NinjaTrader, IB TWS
Broker: InteractiveBrokers, CQG
Trading: ES
Posts: 1,236 since Oct 2017
Thanks Given: 2,006
Thanks Received: 6,318


technoloG View Post
Hi all,

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

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.

Visit my NexusFi Trade Journal
 
 
Fat Tails's Avatar
 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


technoloG View Post
Hi all,

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


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


Backtesting:

I have done backtesting with NinjaTrader, and there are two main factors that will invalidate almost any back test

- intra-bar market orders
- renko bars

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.

 
 
wldman's Avatar
 wldman 
Chicago Illinois USA
Legendary Market Wizard
 
Experience: Advanced
Broker: IB, ToS
Trading: /ES, US Equities/Options
Frequency: Several times daily
Duration: Hours
Posts: 3,507 since Aug 2011
Thanks Given: 2,046
Thanks Received: 9,491

@Fat Tails

I love everything you post.

Visit my NexusFi Trade Journal
Thanked by:
 
BoomGoesDynamite
Denver, Colorado, United States
 
Posts: 1 since Jun 2020
Thanks Given: 1
Thanks Received: 0

This was immensely helpful, thank you FatTails.


Fat Tails View Post
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


Backtesting:

I have done backtesting with NinjaTrader, and there are two main factors that will invalidate almost any back test

- intra-bar market orders
- renko bars

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.


 
abev
seattle washington
 
Posts: 75 since Feb 2019
Thanks Given: 11
Thanks Received: 29


Fat Tails View Post
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.
.
.
.
.
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!!


 



Last Updated on July 24, 2022


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts