-
November 25th, 2016, 11:58 AM
#1
MarketDepth with data source from database
Dear Forum,
Would any body share to me the Market Depth Demo Data Adapter Example that use the data source from sql ? I tried to do it but the simulator package is so confusing for me to replace it with the database access.
Thank you very much in advance,
Mario
-
November 28th, 2016, 11:55 AM
#2
Hi Mario,
The market orders simulator assumes to receive all buy and sell orders for a stock and match them in order to generate the market executions.
These orders can be generated by users through the demo client, but to generate more traffic the simulator creates orders randomly with different frequencies.
Now, in your specific scenario, we need to understand if from your db the adapter will extract raw orders or data already processed, with buy and sell lists ready to display.
In the former case you can mantain much of the structure of the adapter code.
In the latter, you can greatly simplify the code but will depends on how the data of the feed tables are structured.
Regards,
Giuseppe
-
November 29th, 2016, 09:53 AM
#3
Dear Mr Corti,
Thank you very much for your kind reply.
To simplify the code, the adapter will get the data that already processed. I prefer to provide the Query that can be executed by the Adapter to get the ready data.
I will use the MarketDepth example as my basic idea of my application. The application is almost the same as the MarketDepth, that is, using the COMMAND mode. The application is the monitoring application that displays the monitoring result of 5 objects (as fields) with flexible number of item of testing (the rows). The adapter will push the data every 2 seconds.
The data structure resulted by the query consists of 5 fields and flexible number of rows. Because of this flexible number of rows, the COMMAND mode is suitable for this application.
Thank you very much in advance for your kind advice.
Regards,
Mario
-
November 29th, 2016, 11:27 AM
#4
Hi Mario,
I got it, thank you for the further details. So in your scenario you can give up all the simulator part of the demo code.
Your adapter will simply need a thread that regularly queries the db; something not very different from what described here:
http://forums.lightstreamer.com/show...a-Adapter-Java
What is a bit more tricky is that you have to cross the query results with an image, maintained by the adapter, of the table in order to produce the single commands to be passed to Lightstreamer server.
- A ADD command for a newly added row.
- A DELETE command for a row eliminated from the db.
- An UPDATE command for row with at least one changed field.
However this should not be too hard to achieve at least if one of the fields already serves as a key for the row.
Regards,
Giuseppe
-
November 29th, 2016, 12:29 PM
#5
Dear Mr. Corti,
Thank you for your explanation. I will try your advice soon.
Regards,
Mario
Similar Threads
-
By carenot in forum Client SDKs
Replies: 4
Last Post: March 18th, 2016, 09:33 AM
-
By shabbirh in forum Client SDKs
Replies: 2
Last Post: September 28th, 2012, 11:00 AM
-
By Dr.Dran in forum Adapter SDKs
Replies: 0
Last Post: April 27th, 2009, 03:53 PM
-
By sarbao in forum General
Replies: 1
Last Post: April 16th, 2009, 09:59 AM
-
By devidasan in forum Adapter SDKs
Replies: 1
Last Post: March 17th, 2009, 12:00 PM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 07:40 AM.
Bookmarks