C++ API Help for Laser (Genesis)

Discussion in 'Automated Trading' started by LSEtrader, Feb 6, 2008.

  1. If anyone has experience coding in C++ for Laser, I'd really appreciate it if you could let me know. I'm having some minor issues with my code and have not had luck working out the bugs.

    Any help would be great.
  2. Post the code ... I have not worked with Genesis but it should be straight forward.
  3. I think it's a fairly Laser-specific problem. When I cancel & replace an order, it goes so fast that occasionally the cancel hasn't finished before the next order goes out. This causes it to go out to the wrong price if the old order turned into the best bid or offer.

    I have tried looking at the pendings, but the same thing happens with this. I need it to confirm that the previous order has indeed been confirmed cancelled before a new one is placed.
  4. Have you tried waiting for the server to send you a "Cancel confirmed" message for the order you are trying to cancel before sending your replacement order out?
  5. giggollo is right, usually you wait for a confirmation before palcing the new order. Some APIs do have a "change order" function.
  6. Sounds to me like they're not sending a cancel replace order, but rather a cancel and then a new order.

    If you use cancel replace, all the information [the new order and the info on the order to cancel] go in a single message.

    Here's some info from NYFIX Fixionary:

  7. promagma


    Yeas - unless using FIX - you send a separate cancel order followed by a new order. I put the new orders and cancels into a FIFO queue, implemented for each symbol. It only processes the front item in the queue, and only removes the front item when the order is confirmed as pending, or as cancelled.

    Then you can also handle rapid fire situations like this:

    (Front of queue)
    1. Cancel sell PCLN 100.00 - cancel sent, waiting for confirm
    2. Add sell PCLN 99.95
    3. Cancel sell PCLN 99.95 - when my app sends this, can remove both 2 & 3
    (Back of queue)
  8. Hmm that's true, I've never noticed that NASDAQ's protocols have no cancel replace...
  9. Yes, I am cancelling, and then sending a new order. I think I've got the cancels under control now, but I don't think its really the proper way to do it. Thanks for the help guys.

    I will probably have a few more minor issues that I will post here over the next few weeks. Help is always appreciated!

  10. do you still need help with this because I can help you. The problem here is that you are not including all the information correctly when sending the order. The C++ Laser API is extremely picky and you need to have everything specified and correct in order for it to work. If you post the code I'll be able to tell you what you need to add / change etc
    #10     Sep 27, 2008