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 SalmaTrader, 07-07-2026, 10:26 PM
|
0 responses
50 views
0 likes
|
Last Post
by SalmaTrader
07-07-2026, 10:26 PM
|
||
|
Started by CarlTrading, 07-05-2026, 01:16 PM
|
0 responses
22 views
0 likes
|
Last Post
by CarlTrading
07-05-2026, 01:16 PM
|
||
|
Started by CaptainJack, 06-17-2026, 10:32 AM
|
0 responses
16 views
0 likes
|
Last Post
by CaptainJack
06-17-2026, 10:32 AM
|
||
|
Started by kinfxhk, 06-17-2026, 04:15 AM
|
0 responses
22 views
0 likes
|
Last Post
by kinfxhk
06-17-2026, 04:15 AM
|
||
|
Started by kinfxhk, 06-17-2026, 04:06 AM
|
0 responses
23 views
0 likes
|
Last Post
by kinfxhk
06-17-2026, 04:06 AM
|

Comment