Skip to main content

Quick Start

Get Started with Sending Signal

Webhook URL
https://api.crypto-arsenal.io/trading-signal/webhook
your-strategy.py
import requests

URL = 'https://api.crypto-arsenal.io/trading-signal/webhook'
PAYLOAD = {
"connectorName": "FIND_ME_ON_CA_STRATEGY_CONNECTOR",
"connectorToken": "FIND_ME_ON_CA_STRATEGY_CONNECTOR",
"log": "OPEN LONG on BTC/USDT at $1200",

# ...whatever you would like to send to us :)

}

response = requests.post(URL, json=PAYLOAD)

提示

You can send us custom JSON payload and process them in the Python editor

Common Q&A

Q: What is the webhook URL?

The webhook URL is https://api.crypto-arsenal.io/trading-signal/webhook. You will need to send your signal via a POST request to this URL with the JSON payload.


Q: What are connectorName and connectorToken?

The connectorName and connectorToken uniquely identify and link the signal you send to a specific strategy on Crypto-Arsenal. Each pair has a one-to-one correspondence with a strategy. You can locate these details within your strategy's editor on Crypto-Arsenal.


Q: How can I process customized signal? (Advanced)

You can send any custom JSON payload to the webhook URL. The payload will be processed in the Python editor that is where your strategy lives.

Each time a signal is received from the webhook, the on_tradingview_signal callback is invoked with the signal's JSON data and the most recent candle data. This class and function is stateful, allowing for the maintenance of state across signals.

your-crypto-arsenal-strategy.py
#...
def on_tradingview_signal(self, signal, candles):
exchange, pair, base, quote = CA.get_exchange_pair()

# will print out exactly the signal you sent to the webhook
CA.log('on_tradingview_signal: ' + str(signal))

if signal.get('action') == 'open_long':
CA.open_long(exchange, pair, signal.get('amount'), CA.OrderType.MARKET)
#...