简体   繁体   English

使用python quickfix软件包,如何发送TestRequest消息?

[英]Using the python quickfix package, how can I send a TestRequest message?

I have an established FIX connection with a vendor and we are sending heartbeats every thirty seconds. 我与供应商建立了FIX连接,我们每三十秒发送一次心跳。 However, due to their system setup, they send me TestRequests (35=1) at varying intervals along with the heartbeats. 但是,由于他们的系统设置,他们以不同的间隔向我发送TestRequests (35=1)以及心跳。 I have never had to handle these and the quickfix package is interpreting them as heartbeats. 我从没有处理过这些,而quickfix软件包将它们解释为心跳。 However, this is causing their systems to log me out. 但是,这导致他们的系统注销我。

A sample of the messages when I first logon is as follows: 首次登录时消息的示例如下:

2017-09-05 11:50:47,769 - fix_connection.FIX_IO - INFO - toAdmin >>>>:
8=FIX.4.2|9=78|35=A|34=1|49=***|52=20170905-15:50:47.763|56=XXX|98=0|108=30|141=Y|10=111|

2017-09-05 11:50:48,361 - fix_connection.FIX_IO - INFO - fromAdmin >>>>:
8=FIX.4.2|9=77|35=A|34=1|43=N|49=XXX|52=20170905-15:50:55.062|56=***|98=0|108=30|10=043|

2017-09-05 11:50:48,421 - fix_connection.FIX_IO - INFO - fromAdmin >>>>:
8=FIX.4.2|9=89|35=1|34=2|43=N|49=XXX|52=20170905-15:50:55.119|56=***|112=05/09/2017-11:50:55|10=163|

2017-09-05 11:50:48,437 - fix_connection.FIX_IO - INFO - toAdmin >>>>:
8=FIX.4.2|9=84|35=0|34=2|49=***|52=20170905-15:50:48.428|56=XXX|112=05/09/2017-11:50:55|10=175|

2017-09-05 11:51:18,644 - fix_connection.FIX_IO - INFO - fromAdmin >>>>:
8=FIX.4.2|9=65|35=0|34=3|43=N|49=XXX|52=20170905-15:51:25.341|56=***|10=254|

2017-09-05 11:51:18,657 - fix_connection.FIX_IO - INFO - toAdmin >>>>:
8=FIX.4.2|9=60|35=0|34=3|49=***|52=20170905-15:51:18.649|56=XXX|10=019|

I have already searched for a way to send a TestRequest specifically using the quickfix package, but didn't find anything. 我已经在寻找一种使用quickfix包专门发送TestRequest的方法,但没有找到任何东西。 Can someone point me in the right direction or provide an example? 有人可以指出正确的方向或提供例子吗? Much appreciated. 非常感激。

Try this simple piece of code, written in c#. 尝试使用C#编写的这段简单代码。 Please check with your vendor the data to send correctly (the "test" in my example). 请与您的供应商核对数据以正确发送(在我的示例中为“测试”)。

sessionId is the Session object with the parameters between you and the counterparty. sessionId是具有您和对方之间参数的Session对象。

public void SendTestRequestMessage() {
        QuickFix42.TestRequest req = new QuickFix42.TestRequest();
        req.set(new TestReqID("test"));
        Session.sendToTarget(req, sessionId);

    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM