Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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.
Paul H.NinjaTrader Customer Service
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by kezyclaire, 12-01-2023, 09:37 AM
|
3 responses
151 views
0 likes
|
Last Post Today, 07:03 AM | ||
Started by volIQ, Yesterday, 04:28 PM
|
1 response
13 views
0 likes
|
Last Post Today, 06:55 AM | ||
Started by martini, Yesterday, 04:45 PM
|
1 response
10 views
0 likes
|
Last Post Today, 06:45 AM | ||
Started by proptradingshop, 03-21-2024, 09:50 AM
|
5 responses
26 views
0 likes
|
Last Post Today, 05:17 AM | ||
Started by MaupinFinche, Today, 05:08 AM
|
0 responses
7 views
0 likes
|
Last Post
by MaupinFinche
Today, 05:08 AM
|
Comment