I have been backtesting a recently develoiped strategy when I ran across an unusuall occurence. I had an order entry and yet the Position.MarketPosition was flat. The entry and exit occured on the same bar with the same entry and exit time. I have attached pics. Can anyone please explain to me what happened and how to avoid this in the future? Any help would be greatly appreciated. Thank you very much.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Entry at Incorrect Time
Collapse
X
-
Entry at Incorrect Time
Hi,
I have been backtesting a recently develoiped strategy when I ran across an unusuall occurence. I had an order entry and yet the Position.MarketPosition was flat. The entry and exit occured on the same bar with the same entry and exit time. I have attached pics. Can anyone please explain to me what happened and how to avoid this in the future? Any help would be greatly appreciated. Thank you very much.Tags: None
-
Hi Zeos6,
There's nothing unexpected here. If the stop loss can be filled on the entry bar, then it will be filled. The only time known for the bar is the bar time stamp so you see entry and exit time the same.
In order to work around this, you would have to move away from set statements, work with a multiseries script, and submit ExitLongStop, ExitShortStop to a smaller series than the primary. This gives you increased granularity on the sequence from entry > exit.
You can also run your strategy against market replay data to simulate live trading conditions.Ryan M.NinjaTrader Customer Service
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
648 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
369 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
108 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
572 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
573 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment