APIBridge Python Sample Code

Integrating Python with APIBridge is extremely easy. You just need to execute the following Pyhton v3 code for placing orders. If you need further help, do not hesitate to contact us.

import socket
# client code to connect with API bridge
HOST = ''  # The server's hostname or IP address
PORT = 56789    # The port used by the server

with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
    s.connect((HOST, PORT))
    # Symbol = Symbol | Expiry | Strike | OptionType
    # TrigPrice = TrigPrice | StopLoss | SquareOff | TrailingTicks
    # StrategyTag = StrategyTag | Port

   # s.sendall(b"8,SE,HDFC,L,1,1200,100,EQ,STG11")

    data = s.recv(1024)

print('Received', repr(data))

Python Coding Service

Please check MyCoder if you need assistance in python coding for custom strategy deployment.