I just started trying to connect to my broker through the FIX protocol.
The broker gave me:
- an IP:port address to connect to
- a "sendercompid"
- a "targetcompid"
- a password
I would like, as a first test, simply send a logon message to the broker and hopefully receive a message back from it. I would have thought this should be possible with a simple, small python script?
(ie im not interested in installing a fully fledge python engine / or use wrapper for c++ language such as quickfix)
edit: to be more precise: I found on SO example of doing (or trying) such thing in PHP, for instance:
$fp = fsockopen($host, $port, $errno, $errstr, 3.0);
if ($fp)
{
$request = "8=FIX.4.49=11235=A49=SENDER56=RECEIVER34=152=20130921-18:52:4898=0108=30141=Y553=user554=pass10=124";
echo $request;
fwrite($fp, "GET / HTTP/1.0\r\n" .
"Host: $host\r\n".
"Connection: close\r\n".
"Content-Length: " . strlen($request) . "\r\n" .
"\r\n" .
$request);
stream_set_timeout($fp, 2, 0);
$response = '';
while (!feof($fp))
{
$response .= fread($fp, 1024);
}
print "Response: ".$response . "<BR>\n";
fclose($fp);
}
Do you know which library i can use to simply communicate (ie send/retrieve) message to the FIX server in the same fashion in python?