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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
67 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
36 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
60 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
62 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
53 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment