I am using the above Sample Education Resource within my strategy, which adds a 1 minute secondary bar series to fill orders. The strategy enters the trade correctly, but exits the trade at the end of the day without hitting either the stop loss or profit target. I did replace my strategy code with an EMA crossover to see if my code was causing this problem, but I got the same result. Can you give me some hint on what direction to take to handle this problem? Thanks.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
SampleIntrabarBacktest - Premataure Exit at close of the day the trade was entered
Collapse
X
-
SampleIntrabarBacktest - Premataure Exit at close of the day the trade was entered
Hello:
I am using the above Sample Education Resource within my strategy, which adds a 1 minute secondary bar series to fill orders. The strategy enters the trade correctly, but exits the trade at the end of the day without hitting either the stop loss or profit target. I did replace my strategy code with an EMA crossover to see if my code was causing this problem, but I got the same result. Can you give me some hint on what direction to take to handle this problem? Thanks.Tags: None
-
SampleIntrabarBacktest - Premature trade exit at end of day
Hello:
Under "Order Handling", I unchecked the "cancel strategy orders on strategy termination" box and each existing order still exits on the close of the day the trade was entered.
The "Stop and target submission" is currently set to "Per entry execution". Should it be set to "By strategy position"? Just grasping at straws. Thanks.
Comment
-
SampleIntrabarBacktest - ExitOnClose = false;
Hello Ryan:
This also doesn't work. If no other suggestions are available, I guess I will create a new strategy with my trading code and gradually add the SampleIntrabarBacktest code to see where the problem is. As I like the idea of trading on the 1 minute bar data. Thanks.
Comment
-
SampleIntrabarBacktest - ExitOnClose = false; - Does it work in Strategy Analyzer?
Hello Ryan:
I kept the above code, added your change and added a small trading algorithm, and it works on a chart. However, when running the code on "Strategy Analyzer" it still exits at the close of each day. Is this code able to work in Strategy Analyzer? Thanks.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
560 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
325 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 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
547 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
547 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment