Webhook Trading
Send a webhook as if it came from TradingView or anywhere else.
Authentication
Code Example (Python)
import requests
# Webhook URL
url = "https://app.crosstrade.io/v1/send/abc123/abcdefghijklmnopqrstuvwxyz"
# Content must be sent as plain text
headers = {
"Content-Type": "text/plain"
}
# Message payload text
data = '''
key=my-secret-key;
command=PLACE;
account=Sim105;
instrument=MES 12-25;
action=BUY;
qty=1;
tif=DAY;
order_type=MARKET;
'''
# Post it to CrossTrade!
try:
response = requests.post(url, headers=headers, data=data)
print(f"Response Code: {response.status_code}, Response Text: {response.text}")
except Exception as e:
print(f"An error occurred: {e}")Last updated