473,666 Members | 1,991 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Stock Quote Order Level Book

I'm going to be attempting my most challenging programming task to date
and was wondering if I could get some input on what would be the most
efficient way of working with stock price quote data for an entire
order book. I'm working with a raw text data stream that delivers
quotes in realtime for each price level with the quantity of shares,
the ID of the exchange that is honoring the quote, and the side of the
market it is on. For instance, a typical feed might look something like
this:

Symbol, Side, Price, Shares, ID

XYZ, S, 33.02, 100, ARCA
XYZ, B, 33.01, 200, NYSE
XYZ, B, 33, 1000, NYSE
XYZ, S, 33.02, 0, ARCA

A quote is deemed as having been removed from the book when a share
size of 0 is received, as in the last quote received above.

I'd like to have the data sorted into two containers (bidSide and
askSide) by price into an order book in realtime... but I'm having a
difficult time deciding on the best way to do this due to the fact that
it should be the most efficient design possible regarding speed. If
anyone has some experience with this type of data or could suggest a
possible route (lists, maps, or, etc.?), it would be hugely appreicated
as I'm definitely taking on a bit more than I can chew.

Many thanks,
Lorn Davies

Dec 8 '05 #1
1 3188
Lorn wrote:
I'm going to be attempting my most challenging programming task to date
and was wondering if I could get some input on what would be the most
efficient way of working with stock price quote data for an entire
order book. I'm working with a raw text data stream that delivers
quotes in realtime for each price level with the quantity of shares,
the ID of the exchange that is honoring the quote, and the side of the
market it is on. For instance, a typical feed might look something like
this:

Symbol, Side, Price, Shares, ID

XYZ, S, 33.02, 100, ARCA
XYZ, B, 33.01, 200, NYSE
XYZ, B, 33, 1000, NYSE
XYZ, S, 33.02, 0, ARCA

A quote is deemed as having been removed from the book when a share
size of 0 is received, as in the last quote received above.

I'd like to have the data sorted into two containers (bidSide and
askSide) by price into an order book in realtime... but I'm having a
difficult time deciding on the best way to do this due to the fact that
it should be the most efficient design possible regarding speed. If
anyone has some experience with this type of data or could suggest a
possible route (lists, maps, or, etc.?), it would be hugely appreicated
as I'm definitely taking on a bit more than I can chew.

Many thanks,
Lorn Davies


1. Since you don't have a question about C++ /per se/ posting in
news:comp.progr amming would be vastly more appropriate.

2. Given your description above, what happens if there are multiple
orders for the same price on the same exchange -- and *one* (no way to
know which one, eh?) gets zeroed out?

3. This is homework, isn't it?

4. Look up `priority queue'. GIYF.

HTH,
--ag
--
Artie Gold -- Austin, Texas
http://goldsays.blogspot.com (new post 8/5)
http://www.cafepress.com/goldsays
"If you have nothing to hide, you're not trying!"
Dec 8 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1942
by: Marion Slaughter | last post by:
----FA48570F00BB51C Content-Type: text/html; charset="iso-35B2-E" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled Document</title> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859=
9
5855
by: simon.harris | last post by:
I have a 'master' stock list with current stock levels (integer) and another table that contains transactions (i.e. item#, #items added/ removed, date, user etc). What I need is an update query that runs down the transaction table and modifies the 'master' stock level accordingly. I've created an 'update query' and put in the field. In the 'update to' slot I've got ! + ! Running the query comes up with the message 'updating n records'...
4
3076
by: peter | last post by:
In the sample northwind database when an order is sent the sent value come of the instock value. I can not work out how they have done this . I can see that it is an eventprocedure but can not understand it or relate it to my data base. I want to be able to say that some thing has been shipped in a sales table and deduct the value from the instock value in my products table.
0
343
by: Lorn | last post by:
I'm going to be attempting my most challenging programming task to date and was wondering if I could get some input on what would be the most efficient way of working with stock price quote data for an entire order book. I'm working with a raw text data stream that delivers quotes in realtime for each price level with the quantity of shares, the ID of the exchange that is honoring the quote, and the side of the market it is on. For...
3
1891
by: Zarf | last post by:
I search a book on how to program stock chart in vb net thank you.
37
3860
by: panjap | last post by:
hello I am currently working on a project for college, based on a shop and have created querues which allow me to total up new customer orders however i am currently sruggling on how to create a system which will update the stock level one a customer pruchases an item in the product table, and then a warning message should appear when the stock reaches the re order level do i create a new query for this or use the following below below are my...
1
2073
by: baker951 | last post by:
I have a problem that some companies in my supplier table deliver on more than one day in a week, is it possible to add more than one value to a single field or do i need seperate fields. Also i want a query that shows the companys details whenthe user has to type in the day of the week that the company delivers on. Can you help? Also i have created 2 update querys to try an update my stock levels. However the way i have got it is that it...
1
5784
by: asmusdk | last post by:
I am working on creating a stock management database for a small company. The company receives the merchandise from a handful of suppliers and stocks it before it is sent to the customers – retail outlets. The company works on a concession basis – i.e. the customers do not pay for the delivered goods but sell it on and then take a percentage of the sales. The goods delivered to the retailers can be considered to be “in stock” at the...
40
7975
by: sazd1 | last post by:
Hi Student2 I am working on similar kind of thing for stock calculation but could not find any solution to my problem even after putting my problem to different forums. I saw your post that you have solved this problem of stock calculation. i need help for that too. I am using vb express and MsAccess as database. I am trying to write a query for the calculation of Stock. My tables are as under: PurchaseTable(PTId, PDate,ItemId,...
0
8445
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8871
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8551
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8640
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7386
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5664
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4369
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2771
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.