Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How to determine how many bars an order has been open?
Collapse
X
-
Hello boreland,
Thanks for your post.
You can use the method BarsSinceEntryExecution(). Please see the help guide for key details and example: https://ninjatrader.com/support/help...yexecution.htm
Alternatively, if you are placing market orders which usually fill immediately, you can create an integer counter that is set to zero when you place the order and then you increment it on each new bar. Otherwise if using limit orders that may not fill right away you can check to see if the order is filled in OnOrderUpdate(), OnExecutionUpdate(), or OnPositionUpdate() and reset the class level variable integer counter there.
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
62 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
134 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
75 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
45 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
50 views
0 likes
|
Last Post
|

Comment