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
queue position.
Collapse
X
-
Originally posted by NinjaTrader_ChelseaB View PostHello JimB17,
From my understanding the queue position is not reported back for working orders from the brokerage to NinjaTrader.
Would you like to submit a feature request for NinjaTrader to estimate a queue position for a working order?
Comment
-
I don't think you can get a "REAL" queue position, but you could get a worst case scenario queue position. The reason why a real position is difficult to estimate is that once you are in queue, if someone cancels an order at your price level, you don't know if the order that was canceled was in front of your position or behind.
This is how I would estimate the queue:
1) When you place an order, check the state of the order. Once you get an event that says the order is working you need to check the depth (queue) of the price level you placed the order at. You could actually check the queue before, as you submit the order and then compare both results. You can average the before and after queues, or take the worst case scenario (after).
2) Then on OnMarketData you need to read all of the trades that happen at that price level and adjust your queue accordingly. You can also read if someone canceled an order at that price level, but you wouldn't know if that order was in front or not, so I would personally not adjust and assume worst case scenario.
I wouldn't mind building it if someone would try it live and tell me how accurate it is...
Cheers!
Comment
-
Originally posted by jortuzar View PostI don't think you can get a "REAL" queue position, but you could get a worst case scenario queue position. The reason why a real position is difficult to estimate is that once you are in queue, if someone cancels an order at your price level, you don't know if the order that was canceled was in front of your position or behind.
Cheers!
I've been working on other stuff but will get back to this sometime soon. It is pretty straightforward to implement already monitoring all the vital bits just need a touch o' logic.
Thanks again!
Comment
-
Originally posted by JimB17 View PostThanks for the reply. Yes I believe you are correct both with the approach and pitfalls of the suggested solution. Also believe sometimes the queue can be circumvented with fill priorities but at least the task can be approached as you suggest.
I've been working on other stuff but will get back to this sometime soon. It is pretty straightforward to implement already monitoring all the vital bits just need a touch o' logic.
Thanks again!
(4th bullet/fold on page)
Comment
-
Originally posted by NinjaTrader_ChelseaB View PostHello JimB17,
From my understanding the queue position is not reported back for working orders from the brokerage to NinjaTrader.
Would you like to submit a feature request for NinjaTrader to estimate a queue position for a working order?
Learn more about market by order (MBO) an order-based data feed which provides the ability to view individual queue position and more.
When Ninjatrader 8 will support that feature?
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by AdamDJ8, Today, 09:18 PM
|
0 responses
2 views
0 likes
|
Last Post
by AdamDJ8
Today, 09:18 PM
|
||
Started by knowmad, Today, 03:52 AM
|
2 responses
26 views
0 likes
|
Last Post
by knowmad
Today, 09:03 PM
|
||
Started by ETFVoyageur, Today, 07:05 PM
|
0 responses
10 views
0 likes
|
Last Post
by ETFVoyageur
Today, 07:05 PM
|
||
Started by Orion815, 05-02-2024, 08:39 AM
|
2 responses
18 views
0 likes
|
Last Post
by Orion815
Today, 06:24 PM
|
||
Started by suroot, 02-25-2017, 04:43 AM
|
11 responses
2,554 views
0 likes
|
Last Post
by Zilvercat
Today, 05:36 PM
|
Comment