Created
June 6, 2021 12:30
-
-
Save bsmth/2c4d3319e99a13f66d6b0f5f4448c218 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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