zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    Nginx 配置对流量、连接和请求的限制
    linux iptables规则介绍
    Javascript 语言精粹 代码片段合集
    Wowza® Media Systems 使用配置手册。
    如何去除My97 DatePicker控件上右键弹出官网的链接
    [转载]jQuery诞生记-原理与机制
    java swing JButton文字显示异常
    c# 内存拷贝 解决json序列化丢失私有数据(二进制序列化反序列化)
    c# Marshal 将字节数组转为结构 封装协议
    c# 串口通信及模拟串口进行调试
  • 原文地址:https://www.cnblogs.com/xiangshancuizhu/p/2934348.html
Copyright © 2011-2022 走看看