Results 1 to 2 of 2
  1. #1

    Smile Full Market Depth with Lightstreamer, Delete Command

    Hi
    in the below link, Full Market Depth with Lightstreamer Is Presented.
    http://blog.lightstreamer.com/2015/04/market-depth-with-lightstreamer.html
    But i have a Problem with Delete Command.

    According to our messages' document ,our Trade engine publish three kind of delete message .
    I want to know is it possible to implement them with Lightstreamer?
    These message are:
    1- Deletion of a precise order (the order specified in the message).
    2- Deletion of all previous orders in the specified side (all better orders from the specified order in the message according to FIFO).
    3- Deletion of all orders (both sides).


    Thanks.

  2. #2
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    716
    Hi javadhemati,

    1) In our demo the orders are grouped by price levels. So deleting a precise single order implies check its price, we assume is X, and act on that level of the order book. This could result in:
    - a "DELETE" command for the key X (the "qty" field is not present) if the order was the only one present at that price level
    - otherwise an "UPDATE" command for the key X with "qty" field appropriately reduced by the amount of the order;
    But please consider that you might want to organize your book not grouped by price levels but list every single order explicitly.
    In this case the key field for the COMMAND mode is not the price but will be an "order id " unique assigned to each order. The deletion of a precise order now is simply a "DELETE" command with the key field containing the id of the order.

    2) In this case are valid all the considerations made in the previous point. But consider that in order to clear all levels for better prices, the Adapter implementation needs to keep an ordered data structure, and generate an update of type "DELETE" for every order to be deleted.

    3) An operation of this type is shown in the demo, and can be easily achieved with Lightstreamer. Please check out the endOfDay method of DataAdapter; in this case we simulate the end of a trading day and we want to delete all existing orders.


    The trick is carried out by a call to smartClearSnapshot method of ItemEventListener interface. Our demo is organized with two Items for each stock, one for each side of the book and so are just need two calls of smartClearSnapshot.

    Please let me know if you need any further clarifications.

    Regards,
    Giuseppe

 

 

Similar Threads

  1. Command Mode Delete Processing Question
    By wwatts in forum Client SDKs
    Replies: 1
    Last Post: March 13th, 2012, 10:47 AM
  2. Replies: 2
    Last Post: March 1st, 2012, 02:53 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 10:46 AM.