Skip to content

Instantly share code, notes, and snippets.

@bsmth
Created Jun 6, 2021
Embed
What would you like to do?
import time
import socket
HOST = 'localhost'
PORT = 9009
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
sock.connect((HOST, PORT))
sock.sendall(('eod,instrument=fut open=141.5,high=142.0,low=139.9,close=142.0,settle_price=143.7,value=42.27\n').encode())
except socket.error as e:
print("Got error: %s" % (e))
sock.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment