Trading Connector - Bybit & Binance
API Endpoint
If you have your own trading system, you can use the following url to open and close trades
https://webhook.shadow.trading/trade-cryptocurrency
TradingView Webhook Endpoint
For Webhook alerts are sent from TradingView Platform use the following endpoint. No rate limiting applied to this endpoint.
https://webhook.shadow.trading/view/trade-cryptocurrency
Important Note: Using this endpoint through your local machine won't work as it check the IP Address of the request comes from TradingView.
Message structure
Send POST request with the following body example
POST https://webhook.shadow.trading/trade-cryptocurrency
Content-Type: text/plain
symbol=ETHUSDT&license_key=...&discord_channel_id=&comment=...&exchange=bybit&api_key=...&secret_key=...&testnet=false&price=1873.55&type=LimitSell...
The Body sent to the endpoint is under the form [key]=[value]
, with each key-value pair separated by &
.
(Note: The "🔗" symbol in the table denotes parameters that are linked or dependent on other parameters.)
Open trade parameters
Key | Value | Description | Required |
---|---|---|---|
symbol | BTCUSDT ETHUSDT ... | Cryptocurrency Pair | ✅ |
license_key | string | Your Shadow.Trading License Key, which can be found in your profile | ✅ |
exchange | bybit binanceusdm | bybit : Derivatives USDT Perpetualbinanceusdm : Binance USD M(argin) | ✅ |
api_key | string | To get api_key and secret_key , refer to Bybit Setup or Binance Setup | ✅ |
secret_key | string | To get api_key and secret_key , refer to Bybit Setup or Binance Setup | ✅ |
discord_channel_id | string | To get the Channel ID, refer to this link | ✅ |
type | LimitBuy LimitSell MarketBuy MarketSell | Type of order:LimitBuy Limit order for Long trade.LimitSell Limit order for Short trade.MarketBuy Market order for Long trade.MarketSell Market order for Short trade.For Limit type orders, price is required. | ✅ |
price | float | Entry price for Limit orders only (LimitBuy or LimitSell) | 🔗 |
timeout_seconds | int | Timeout seconds for Limit orders (max: 86400 seconds). If orders are not filled after X seconds, they will be automatically cancelled. This feature prevents manual actions. | 🔗 |
risk_percentage | float | You need to choose between risk_percentage or volume , as at least one is required. If risk_percentage is set, then the sl key is needed as well.Example: risk_percentage=0.02, the volume will be automatically calculated to risk only 2% of your account balance | 🔗 |
volume | float | You need to choose between risk_percentage or volume , as at least one is required. | 🔗 |
sl | float | Stoploss price, required when risk_percentage is set. | 🔗 |
tp1 | float | First Take Profit price, if set, qty1_percentage needs to be set also. | - |
qty1_percentage | float | First Take Profit Volume Percentage to take at the tp1 levelEx: qty1_percentage=0.2 means 20% of the total volume to take when tp1 is reached | - |
tp2 | float | Second Take Profit price, if set, qty1_percentage needs to be set also. | - |
qty2_percentage | float | Second Take Profit Volume Percentage to take at the tp2 levelEx: qty2_percentage=0.3 means 30% of the total volume to take when tp2 is reached | - |
tp3 | float | Third Take Profit price, if set, qty1_percentage needs to be set also. | - |
qty3_percentage | float | Third Take Profit Volume Percentage to take at the tp3 levelEx: qty3_percentage=0.5 means 50% of the total volume to take when tp2 is reached | - |
notification_only | boolean | Default value is false If true , it will just send notification to your Discord Channel and will not take any action on the exchange | - |
comment | string | A comment message that will be displayed in the Discord Notification | - |
testnet | boolean | Default value is false | - |
Close trade parameters
If Stop Loss and Take Profit are both set when entering trade, you may not need to exit trade with request call. As it is already setup on trades.
Key | Value | Description | Required |
---|---|---|---|
symbol | BTCUSDT ETHUSDT ... | Cryptocurrency Pair | ✅ |
license_key | string | Your Shadow.Trading License Key, which can be found in your profile | ✅ |
exchange | bybit binanceusdm | bybit : Derivatives USDT Perpetualbinanceusdm : Binance USD M(argin) | ✅ |
api_key | string | To get api_key and secret_key , refer to Bybit Setup or Binance Setup | ✅ |
secret_key | string | To get api_key and secret_key , refer to Bybit Setup or Binance Setup | ✅ |
discord_channel_id | string | To get the Channel ID, refer to this link | ✅ |
type | CloseMarketBuy CloseMarketSell CloseLimitBuy CloseLimitSell | Type of order | ✅ |
price | float | Closing price, required when CloseLimitBuy or CloseLimitSell | - |
entry_price | float | Entry price, useful to calculate price variation in Discord notification | - |
timeout_seconds | int | Timeout seconds for Limit orders (max: 86400 seconds). If orders are not filled after X seconds, they will be automatically close as market orders. This feature prevents manual actions. | 🔗 |
notification_only | boolean | Default value is false If true , it will just send notification to your Discord Channel and will not take any action on the exchange | - |
comment | string | A comment message that will be displayed in the Discord Notification | - |
testnet | boolean | Default value is false | - |
Request examples
In all the following examples, we assume you provide license_key
, discord_channel_id
, exchange
, api_key
and secret_key
.
1. Place a buy limit order for BTCUSDT with SL and 2 TPs and cancel order after 1 hour if not filled and risk 2% of your account balance per trade.
symbol=BTCUSDT&type=LimitBuy&risk_percentage=0.02&price=30000.00&sl=29000&tp1=31000&qty1_percentage=0.3&tp2=32000&qty2_percentage=0.7&timeout_seconds=3600
2.1. Place a sell market order for BTCUSDT with Stop Loss and risk 5% of your account balance per trade.
symbol=BTCUSDT&type=MarketSell&sl=29000&risk_percentage=0.05
2.2. Close a previous sell position BTCUSDT with Limit Order, if order not filled close position as Market after 10 minutes
We provide here entry_price
and price
in order to send well formatted notification on Discord, with Win or Loss notification.
symbol=BTCUSDT&type=CloseLimitSell&entry_price=30000&price=30500&timeout_seconds=600
3. Place a buy market order for 0.1 Volume of BTCUSDT with SL and TP
symbol=BTCUSDT&type=MarketBuy&volume=0.1&sl=29000&tp1=31000&qty1_percentage=1