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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
47 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
23 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
33 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
51 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
42 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment