快速修复:同一应用程序中的接受者和发起者?
我是quickfix的新手(我是一名试图自学的学生),并且已经从quickfix.org(c++语言)下载了示例,并且已经能够将ordermatch连接到tradeclient并让它们相互交谈。我更改了 ordermatch 的配置文件以允许多个客户端并使其正常工作(ordermatch 可以接收来自多个客户端的订单并管理订单簿)。
我一直在尝试找到一种方法来改变 ordermatch 以将其确认消息发送给所有客户端,而不仅仅是发件人。
我有一个限价订单簿的单独实现,并且想要破解传入的消息(订单、取消等)并将它们存储在我的限价订单簿中。我的订单簿会观察该订单并据此做出交易决策。问题是,我不知道如何让 ordermatch 将所有更新发送到该客户端。此外,我很难弄清楚如何“增强”贸易客户不仅发送订单,而且接收和破解它们。
我想我需要在每个应用程序中都有一个接受者和一个发起者(在订单匹配中和在一个交易客户端中)——我已经读到这是可能的且常见的,但找不到任何示例代码。我现在走在正确的轨道上吗,还是有更好的方法来设置它?有人可以分享一些示例代码吗?我不打算将其用于实时交易,因此粗略的代码对我来说完全没问题。
预先感谢
布兰登
I am new to quickfix (I'm a student trying to teach myself), and have downloaded the examples from quickfix.org (in c++) and have been able to connect ordermatch to tradeclient and get them talking to each other. I changed the config file for ordermatch to allow multiple clients and got that working (ordermatch can receive orders from multiple clients and manage the order book).
I have been trying to find a way to alter ordermatch to send it's confirm messages to ALL clients, not just the sender.
I have a seperate implementation of a limit orderbook and want to crack the incoming messages (orders, cancels, etc) and store them in my limit orderbook. My orderbook watches the book an makes trading decisions based on it. The problem is, I can't figure out how to get ordermatch to send all updates to this client. Further, I am having a hard time figuring out how to "soup up" the tradeclient to not only send orders, but receive and crack them.
I'm thinking I need to have an acceptor and an initator in each application(in ordermatch and in one of the tradeclients)--I've read this is possible and common but can't find any sample code. Am I on the right track here, or is there a better way to set this up? Does anybody have some sample code they can share? I am not planning on using this for live trading so crude code is perfectly fine by me.
Thanks in advance
Brandon
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
同一应用程序可以充当一个会话的发起者和不同会话的接受者。
事实上,您可以从同一应用程序拥有多个接受者/发起者会话。
配置文件需要定义多个会话。
或者您可以为每个会话拥有单独的配置文件。
Same application can act as Initiator for one session and Acceptor for different session.
Infact you can have multiple Acceptor/Initiator sessions from same application.
Config file needs to define multiple sessions.
Or you can have separate config file for each session.
如果我理解正确的话,我认为您想要做的是拦截 OMS 和代理(参见客户端和服务器)之间的消息,并根据它们包含的内容采取行动。有几种方法可以做到这一点,包括在 TCP 层拦截,但我认为最简单的方法可能是使用 2 个单独的程序,如 @DumbCoder 建议的那样,并作为客户端的接受者连接到其中一个程序,处理消息,然后通过另一个协议将它们传递到另一个程序,然后从另一个程序发送它们。理论上,您可以在程序中创建引擎的另一个实例,并通过在创建引擎的每个实例时使用不同的配置文件(当调用 FIX::FileStoreFactory storeFactory(*settings); 时)。 但是,我从未见过这样做,因此觉得这可能会导致问题。如果您尝试这种方法,我强烈建议将启动器和连接器放在不同的 dll 中,这可能足以将两个引擎实例分开。
If I understand correctly, I think what you're trying to do is intercept messages between an OMS and a broker (c.f. client and server) and act depending on what they contain. There are a few ways you could do this, including intercepting at the TCP layer, but I think that the easiest way might be to use 2 separate programs as @DumbCoder suggests and connect to one of them as an acceptor from your clients, process the messages and then pass them on to another program via another protocol and then send them on from the other program. Theoretically you can create another instance of the engine in your program and, by using different config files on creation (when FIX::FileStoreFactory storeFactory(*settings); is called) of each instance of the engine. However, I have never seen this done and so feel that it could cause problems. If you do try this method I would strongly advise putting the initiator and the connector in different dlls which might just separate the two engine instances enough.