• Relationship between the FIX Protocol's OrdID, ClOrdID, OrigClOrdID?


    A quick note about usages of fields. My experience is that many who implement FIX do it slightly differently. So be aware that though I am trying to explain correct usage you may find that there are differences between implementations. When I connect to a new broker I get a FIX specification which details exactly how they use the protocol. I have to be very careful to make sure where they have deviated from other implementations.

    That said I will give you a rundown of what you have asked for.

    There are more complicated orders but NewOrderSingle is the one most used. It allows you to create a trade for any asset. You will need to create a new order using this object / msg type. Then you will send it through your session using the method sendToTarget(). You can modify the message after this point through the toApp() method, assuming your application implements the quickfix.Application interface.

    The broker (or whoever you are connected to) will send you a reply in the form of and Execution report. Using quickfix that reply will enter your application through the fromApp() callback. From there the best thing to do is to implement your app inheriting from the MessageCracker class (or implement it elsewhere) using the crack method from MessageCracker it will then call back a relevant onMessage() method call. You will need to implement a number of these onMessage() methods (it depends on specifically what you are doing as to which methods you will need), the main one being onMessage(ExecutionReport msg, SessionID session). This method will be called by message cracker when you receive and Execution report from the broker. This is the standard reply to a new order.

    From there you handle the reply as required.

    Some orders do not get filled immediately like Limit orders. They can be changed. For that you will need the CancelReplaceRequest. Your broker will give you details of how to do this specifically for them (again there are differences and not everyone does it the same). You will have to have done a NewOrderSingle first and then you will use this MsgType to update it.

    1.ClOrdID is an ID that the client uses to identify the order. It is sent with the NewOrderSingle and returned in the ExecutionReport.

    2. The OrdID tag is in the ExecutionReport message, it is the ID that the broker will use to identify the order.

    3.  OrgClOrdID is usually used to identify the original order in when you do and update (using CancelReplaceRequest), it is supposed to contain the ClOrdID of the original order.

    Some brokers want the original order only, others want the ClOrdID of the last update, so the first OrigClOrdID or will be the ClOrdID of the NewOrderSingle, then if there are subsequent updates to the same order then they will be the ClOrderID from the last CancelReplaceRequest. Some brokers want the last OrderID and not ClOrderID. Note that the CancelReplaceRequest will require a ClOrdID as well.

    From:http://stackoverflow.com/questions/14587000/what-is-the-relationship-between-the-fix-protocols-ordid-clordid-origclordid

  • 相关阅读:
    2017 经典的CVPR 关于ImageCaptioning论文
    BLEU METEOR ROUGE CIDEr 详解和实现
    pytorch中的nn.CrossEntropyLoss()
    pytorch 中改变tensor维度(transpose)、拼接(cat)、压缩(squeeze)详解
    pytorch 中tensor的加减和mul、matmul、bmm
    pytorch 中的Variable一般常用的使用方法
    Attention 和self-attention
    pytorch中的pack_padded_sequence和pad_packed_sequence用法
    linux 的sleep()、usleep()、nanosleep()函数的区别
    linux下删除东西还原
  • 原文地址:https://www.cnblogs.com/xiangshancuizhu/p/2934348.html
Copyright © 2020-2023  润新知