NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 11-29-2010, 02:19 AM   #1
telbentel
Member
 
Join Date: May 2009
Posts: 68
Thanks: 0
Thanked 0 times in 0 posts
Default Matching orders

Hi everybody,

I have a doubt and maybe you can solve it or give me some help. Here is my question:

Letīs suppose there is an ask price X an in that price there is a volume to be satisficed of 30 contracts due to 30 limit orders of 1 contract each, and in that moment, a single market buy order of 20 contracts arrives. This last order will be completely and immediately executed at the ask price X, filling 20 of pending orders.

In that moment, what I would receive in OnMarketData 20 events type last of volume 1 and price x, or 1 event type last with volume 20 and price x, or maybe both. If none, how can I know that the market order that arrived filled the 20 pending orders.

Thanks for any help.
Last edited by telbentel; 11-29-2010 at 02:42 AM.
telbentel is offline  
Reply With Quote
Old 11-29-2010, 07:29 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,413
Thanks: 252
Thanked 976 times in 959 posts
Default

telbentel, I guess I'm not really clear what type of feedback you're looking for from the OnMarketDate(), it will transmit every Level 1 change (bid, ask, last) - in your scenario you would likely see a combination of events, as it would also depend on how your provider aggregates the data they sent out. If you look for a direct fill confirmation of your market order, try checking the IOrder fillstates returned -

http://www.ninjatrader-support.com/H...V6/IOrder.html
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 11-29-2010, 09:20 AM   #3
telbentel
Member
 
Join Date: May 2009
Posts: 68
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi again,

I will try to clarify more what I'm looking for.

First of all, these won't be my orders. Orders will pending in the bid or the ask queue, as bid or ask volume available at a certain price due to limit orders placed before, and then, a big market order will arrive to the market and this big order gets filled with part of the volume available at that price.

IOrder is not useful, because orders have not been placed by me.

What happens when the big market order arrives. If it get filled with pending orders in the queue (let's say pending limit sell orders and a big buy market order arrives) what events onmarketdata or onmarketdepth will everybody receive, a single OMD event, type last, at the price the big order got filled with the volume of the big order, or several events of type last (one for each small pending order) with the same price and with the volume of each small pending order, or maybe both messages (the one with the big volume and the ones with the small volumes).

I want to know if the decrese in the bid or the ask is due to a single order or to more than one order.

thanks in advance
telbentel is offline  
Reply With Quote
Old 11-29-2010, 09:54 AM   #4
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,413
Thanks: 252
Thanked 976 times in 959 posts
Default

telbentel, you could unfortunately not dissect how the providers sends their data out, if it's aggregated it could appear as one block, if not you would see the individual trades printing as on the time and sales. You need to study your data received to analyze which conclusions to draw from it.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 11-29-2010, 10:34 AM   #5
telbentel
Member
 
Join Date: May 2009
Posts: 68
Thanks: 0
Thanked 0 times in 0 posts
Default

I'm using zenfire as data provider, any idea how they provide this info?
telbentel is offline  
Reply With Quote
Old 11-29-2010, 10:56 AM   #6
NinjaTrader_Brett
NinjaTrader Customer Service
 
NinjaTrader_Brett's Avatar
 
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
Default

Hello,

Zenfire provides this information tick by tick.

Let me know if I can be of further assistance.
NinjaTrader_Brett is offline  
Reply With Quote
Old 11-29-2010, 11:06 AM   #7
telbentel
Member
 
Join Date: May 2009
Posts: 68
Thanks: 0
Thanked 0 times in 0 posts
Default

but in the example I use before, using zenfire, that order will be reflected as only one event type last with the whole volume, or several events (one for each order pending filled with the volume of that order that was pending)?
telbentel is offline  
Reply With Quote
Old 11-29-2010, 11:22 AM   #8
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,413
Thanks: 252
Thanked 976 times in 959 posts
Default

I would believe you see all trades non-aggregated with ZenFire, provided you're on latest NT7 RC1 (B23) and have resetup the ZenFire connection fresh to use the most up to date server points.

Thanks,
NinjaTrader_Bertrand is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Non matching chart data mr_dees Miscellaneous Support 2 09-15-2010 08:48 PM
Matching Background Color marketmasher Charting 1 07-24-2009 06:45 AM
My charts are not Matching up... mdsvtr Miscellaneous Support 3 12-17-2008 04:38 AM
Matching data to broker's symbols baboon123 Connecting 1 07-07-2008 08:23 AM
Positions matching IB danceswil Automated Trading 2 06-03-2008 09:25 AM


All times are GMT -6. The time now is 05:28 AM.