Skip to content

Instantly share code, notes, and snippets.

@bsmth
Created June 6, 2021 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bsmth/2c4d3319e99a13f66d6b0f5f4448c218 to your computer and use it in GitHub Desktop.
Save bsmth/2c4d3319e99a13f66d6b0f5f4448c218 to your computer and use it in GitHub Desktop.
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