在通过FIX4.4协议使用stunnel和quickfix python与我的经纪人DUKASCOPY建立连接时寻求帮助。
这是我的通道配置:
client = yes
cert = /etc/stunnel/stunnel.pem
[OKSERVER]
accept = 9443
connect = demo-api.dukascopy.com:10443
我的quickfix cfg文件:
[DEFAULT]
ConnectionType=initiator
LogonTimeout=30
ReconnectInterval=30
ResetOnLogon=Y
FileLogPath=./Logs/
[SESSION]
BeginString=FIX.4.4
SenderCompID=SENDER_ID # replaced with anonymous value for this post
TargetCompID=TARGET_ID # replaced with anonymous value for this post
StartTime=00:00:00
EndTime=00:00:00
HeartBtInt=30
CheckLatency=N
MaxLatency=240
SocketConnectPort=10443
SocketConnectHost=demo-api.dukascopy.com
UseDataDictionary=Y
DataDictionary=/home/jaspal/qfsample/quickfix/spec/FIX44.xml
FileStorePath=./Sessions/
当我尝试登录时,我得到:
20181002-22:26:23.972817000 : Created session
20181002-22:26:23.978505000 : Connecting to demo-api.dukascopy.com on port 10443 (Source :0)
20181002-22:26:24.023770000 : Initiated logon request
20181002-22:26:24.065703000 : Socket Error: Connection reset by peer.
20181002-22:26:24.065799000 : Disconnecting
我可以确认我正在侦听传入端口:
~/qfsample/quickfix-python-sample$ netstat -an | grep 9443
tcp 0 0 0.0.0.0:9443 0.0.0.0:* LISTEN
我还在路由器上配置了9443,以将其转发到客户端计算机。
这是我从应用程序中收到的消息:
onCreate(self=<__main__.Application; proxy of <Swig Object of type 'FIX::Application *' at 0x7f87db719030> >, sessionID=<quickfix.SessionID; proxy of <Swig Object of type 'FIX::SessionID *' at 0x7f87db6674e0> >)
toAdmin(self=<__main__.Application; proxy of <Swig Object of type 'FIX::Application *' at 0x7f87db719030> >, sessionID=<quickfix.Message; proxy of <Swig Object of type 'FIX::Message *' at 0x7f87db667e70> >, message=<quickfix.SessionID; proxy of <Swig Object of type 'FIX::SessionID *' at 0x7f87db667d20> >)
在这里找到问题的任何帮助都将受到欢迎!
答案 0 :(得分:4)
好。因此,我想不可避免地会从这个很棒的论坛上获得帮助,或者自己弄清楚!在这种情况下是后者!
这是我要去的地方:
使用隧道创建隧道时,必须在隧道配置中为“接受”创建的端口(而不是代理的地址)上将目标设置为本地计算机。现在很明显!这是我的cfg文件现在的样子:
SocketConnectPort=9443
SocketConnectHost=localhost
答案 1 :(得分:1)