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 NullPointStrategies, Today, 05:17 AM
|
0 responses
39 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
124 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
64 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
41 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|

Comment