Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
BarsSinceEntry()
Collapse
X
-
Second part to this question. If a strategy is placing a long limit order, it is my understanding that it places a new order at each bar if using OnBarUpdate. Will Bars since entry
work in this situation? I am looking to see if a limit order is completed within a certain number of candles, if not, then cancel the order.
Comment
-
Hello BrJessey,
Yes that would work with limit orders. BarsSinceEntry works with any type of entry order, it will only report a value once that entry order had filled. Just as an example if you submit a long limit order when you check BarsSinceEntry it will return -1 until that order has filled. Once that order fills it will report 0 on the bar where the entry filled and then for each addition bar the BarsSinceEntry will increment.
In regard to placing a new order on each bar with limit orders, a limit order can be kept alive for each new bar where it is not filled and where you call the order again, it won't place additional orders. For example if you submit a long limit order and it does not fill within the bar it will expire. If you call the long limit entry method again on that next bar instead of expiring it will persist the order so it can remain active. A new order would only be submitted if you were flat or used a different signal name when calling the order method.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
58 views
0 likes
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
143 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
161 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
97 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
276 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|

Comment