Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Changing Fill to Current Bar
Collapse
X
-
I apply a market order to be filled at cross, but I am getting order filled on the next bar open ?
-
-
sausaulius,
This is the nature of backtesting. You do not know that the cross happened till after you signal bar has closed. Because that signal bar is closed you cannot possibly trade on that bar so the next possible bar to trade on is the open of the next bar.Josh P.NinjaTrader Customer Service
Comment
-
Sorry, I don't know what are you talking about.I create strategy using wizard and was not able to find where it could be setted (calculate on bar close) Also in the backtesting window.. The Only place is As I said earlier is in the first window.
Could you say where it is ?
Comment
-
-
You do not know this in a backtest. In backtesting you already know the bars Close. You are given OHLC the whole time. This means there is no way you can act inside the bar. If you act inside the bar you are "cheating". Sure you can say the condition happened some time inside that bar, but then I pose to you the question how do you know what happened after that condition. Did the price go up or down within that bar? There is no way to know and so there is no possible fill price that can be chosen from within that bar.Josh P.NinjaTrader Customer Service
Comment
-
Comment
-
-
Sometimes, being able to enter with a market order using the open of the current bar is important. If you are calculating your moving average based on the open values of the bars, then the entry can be taken on the open of the bar for a moving average cross.
I love Ninja Trader, but this is probably the only thing causing trouble for me.. orders being filled on the next bar instead of the current bar. My systems are designed to know the values of the entry criteria at the open of the bar, so entries can be taken definitively on the open. Not being able to back-test this properly makes the development process much longer. To be fair, there might be a way around this that I am just not aware of.
I could calculate things on a tick-by-tick basis, but that uses an ENORMOUS amount of system resources and takes a long to run back-tests on if the strategies true time frame is (for example) 90 minutes and requires 100 days worth of data.
Comment
-
naifwonder,
There is no way to fill within your signal bar. You already know the close so the bar is already closed. Lets say you are using a CrossAbove condition to enter trades. How do you know when the CrossAbove happened within that bar? As far as anyone can discern from just OHLC the cross could have happened at the very last tick (the close). Even when you think about running it real-time. Your CrossAbove condition can switch between true and false many times within a bar. There is no way a simple OHLC can be used to deduce an even remotely realistic intrabar fill. This is why we use the open of the next bar. I understand your anxiety with this, but it is about choosing the lesser of the two evils. This is just the nature of backtesting in general which is why it is highly recommended you forward test your strategy too.Josh P.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
72 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
143 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
76 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
47 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
51 views
0 likes
|
Last Post
|

Comment