Complete guide to connect TradingView alerts to your cTrader account
Use this URL in your TradingView alert settings:
https://swietcherbot.space/webhook
In the new system, symbol IDs are automatically fetched from cTrader. Just use the symbol name from TradingView.
You cannot use absolute (sl/slPrice) and pip-based (slPips) SL/TP together! Choose ONE method per request.
You can set a secret key from your Profile page. When enabled, all webhook requests must include your secret key for additional protection against unauthorized access.
| Field | Required | Type | Description |
|---|---|---|---|
licenseKey |
✓ Yes | string | Your license key from the Profile page. Unique to each user. Also accepted as license (short alias) |
secretkey |
○ Optional | string | Optional security key. If set in your Profile page, it becomes required in every webhook request. |
{
"licenseKey": "YOUR_LICENSE_KEY",
"symbol": "XAUUSD",
"action": "BUY",
"volume": 0.01
}
| Field | Required | Type | Description |
|---|---|---|---|
symbol |
✓ Yes | string | Symbol to trade. Must match the symbol name in TradingView exactly. Examples: XAUUSD, EURUSD, BTCUSD |
action |
✓ Yes | string |
Action type. Accepted values:BUY — Open buy position (shortcut)SELL — Open sell position (shortcut)CLOSE_LONG — Close buy positionCLOSE_SHORT — Close sell positionEXIT_ALL — Close ALL positions (both long & short)AMEND_LONG — Modify SL/TP for buyAMEND_SHORT — Modify SL/TP for sellopen — Open position (requires side)close — Close position (requires side)
|
side |
○ Optional | string | Trade direction. Only needed when using action: "open" or
"close".buy — Long position | sell — Short position
|
volume |
○ Optional | number | Trade volume in LOT format (0.01, 0.1, 1.0,
etc.).Optional for CLOSE_LONG/CLOSE_SHORT/EXIT_ALL — omitting closes
all positions.
|
{
"licenseKey": "YOUR_LICENSE_KEY",
"symbol": "XAUUSD",
"action": "BUY",
"volume": 0.01
}
{
"licenseKey": "YOUR_LICENSE_KEY",
"symbol": "EURUSD",
"action": "CLOSE_SHORT"
}
Tek bir komutla hem BUY hem SELL pozisyonlarını kapatır. side parametresi gerekmez.
{
"licenseKey": "YOUR_LICENSE_KEY",
"symbol": "XAUUSD",
"action": "EXIT_ALL"
}
CLOSE_ALL, CLOSEALL, EXITALL, EXIT-ALL — hepsi aynı şekilde çalışır. Volume belirtmenize gerek yoktur, tüm açık pozisyonlar kapanır.{
"licenseKey": "YOUR_LICENSE_KEY",
"symbol": "GBPUSD",
"action": "open",
"side": "sell",
"volume": 0.1
}
| Field | Required | Type | Description |
|---|---|---|---|
orderType |
○ Optional | string |
market — Execute at current price (default)limit — Pending order at specified price
Default: market
|
limitPrice |
○ Conditional | number | Limit order price. Required when orderType="limit". Range:
(0; +∞)
|
{
"licenseKey": "YOUR_LICENSE_KEY",
"symbol": "EURUSD",
"action": "BUY",
"volume": 0.1,
"orderType": "limit",
"limitPrice": 1.0850
}
You cannot mix absolute prices (slPrice/tpPrice) with
pip-based (slPips/tpPips) in the same request. Choose
ONE method.
| Field | Required | Type | Description |
|---|---|---|---|
slPrice |
○ Optional | number | Stop Loss as absolute price. Position closes automatically when reached. Range:
(0; +∞)
|
tpPrice |
○ Optional | number | Take Profit as absolute price. Position closes automatically when reached. Range:
(0; +∞)
|
slPips |
○ Optional | number | Stop Loss as pip distance from entry price. BUY: below entry | SELL: above entry Example: 5000 pips = 50 pips for 4-decimal pairs
|
tpPips |
○ Optional | number | Take Profit as pip distance from entry price. BUY: above entry | SELL: below entry Example: 10000 pips = 100 pips for 4-decimal pairs
|
{
"licenseKey": "YOUR_LICENSE_KEY",
"symbol": "XAUUSD",
"action": "BUY",
"volume": 0.01,
"slPrice": 2600.00,
"tpPrice": 2700.00
}
{
"licenseKey": "YOUR_LICENSE_KEY",
"symbol": "EURUSD",
"action": "BUY",
"volume": 0.1,
"slPips": 500,
"tpPips": 1000
}
{
"licenseKey": "YOUR_LICENSE_KEY",
"symbol": "XAUUSD",
"action": "AMEND_LONG",
"slPrice": 2620.00,
"tpPrice": 2750.00
}
| Field | Required | Type | Description |
|---|---|---|---|
trailingStopLoss |
○ Optional | boolean | Activates Trailing Stop. Must be used with AMEND_LONG or
AMEND_SHORT.slPrice or slPips is required — broker automatically trails
the price from this level.
|
{
"licenseKey": "YOUR_LICENSE_KEY",
"symbol": "XAUUSD",
"action": "AMEND_LONG",
"trailingStopLoss": true,
"slPips": 5000
}
{
"licenseKey": "YOUR_LICENSE_KEY",
"secretkey": "YOUR_SECRET_KEY",
"symbol": "XAUUSD",
"action": "BUY",
"volume": 0.1,
"orderType": "limit",
"limitPrice": 2650.00,
"slPrice": 2600.00,
"tpPrice": 2750.00
}
1 standard lot = 100,000 units. Convert using the table below:
⚠️ Varies by broker!
{
"license": "YOUR_LICENSE_KEY",
"secretkey": "YOUR_SECRET_KEY",
"symbol": "XAUUSD",
"action": "BUY",
"volume": 0.01
}
{
"license": "YOUR_LICENSE_KEY",
"secretkey": "YOUR_SECRET_KEY",
"symbol": "XAUUSD",
"action": "SELL",
"volume": 0.01
}
{
"license": "YOUR_LICENSE_KEY",
"secretkey": "YOUR_SECRET_KEY",
"symbol": "XAUUSD",
"action": "CLOSE_LONG"
}
Bir sembolde açık olan tüm pozisyonları (hem long hem short) tek seferde kapatır.
{
"license": "YOUR_LICENSE_KEY",
"secretkey": "YOUR_SECRET_KEY",
"symbol": "XAUUSD",
"action": "EXIT_ALL"
}
side ve volume parametreleri gerekmez. Tüm açık BUY ve SELL pozisyonları otomatik olarak kapanır.CLOSE_ALL, CLOSEALL, EXITALL, EXIT-ALL{
"license": "YOUR_LICENSE_KEY",
"secretkey": "YOUR_SECRET_KEY",
"symbol": "XAUUSD",
"action": "BUY",
"volume": 0.01,
"orderType": "limit",
"limitPrice": 4300.00
}
{
"license": "YOUR_LICENSE_KEY",
"secretkey": "YOUR_SECRET_KEY",
"symbol": "XAUUSD",
"action": "BUY",
"volume": 0.01,
"orderType": "limit",
"limitPrice": 4300.00,
"slPrice": 4200.00,
"tpPrice": 4800.00
}
{
"license": "YOUR_LICENSE_KEY",
"secretkey": "YOUR_SECRET_KEY",
"symbol": "BTCUSD",
"action": "BUY",
"volume": 0.01
}
//@version=5
strategy("Basic Forex Integration", overlay=true)
// MA Crossover Strategy
fastMA = ta.sma(close, 14)
slowMA = ta.sma(close, 28)
longCondition = ta.crossover(fastMA, slowMA)
shortCondition = ta.crossunder(fastMA, slowMA)
// Alerts (Change YOUR_LICENSE_KEY with your actual license)
if (longCondition)
strategy.entry("Long", strategy.long)
alert('{"license": "YOUR_LICENSE_KEY", "secretkey": "OPTIONAL", "symbol": "' + syminfo.ticker + '", "action": "BUY", "volume": 0.01}', alert.freq_once_per_bar_close)
if (shortCondition)
strategy.entry("Short", strategy.short)
alert('{"license": "YOUR_LICENSE_KEY", "secretkey": "OPTIONAL", "symbol": "' + syminfo.ticker + '", "action": "SELL", "volume": 0.01}', alert.freq_once_per_bar_close)
//@version=5
strategy("Advanced Forex Strategy with SL/TP", overlay=true, calc_on_every_tick=true)
// Dynamic SL/TP based on ATR
atr = ta.atr(14)
longCondition = ta.crossover(ta.ema(close, 9), ta.ema(close, 21))
// Format dynamic JSON with string building
if (longCondition)
sl = close - (atr * 2)
tp = close + (atr * 3)
json = '{"license": "YOUR_LICENSE_KEY", ' +
'"symbol": "' + syminfo.ticker + '", ' +
'"action": "BUY", "volume": 0.1, ' +
'"slPrice": ' + str.tostring(sl) + ', ' +
'"tpPrice": ' + str.tostring(tp) + '}'
strategy.entry("Long", strategy.long)
alert(json, alert.freq_once_per_bar_close)
Copy the Webhook URL from the top of this documentation page.
In TradingView, click the "Alert" button or press Alt+A. In the "Notifications" tab, check "Webhook URL" and paste the link.
In the "Settings" tab, paste the JSON payload or PineScript variable into the "Message" box. Click "Create".
Use this URL in your TradingView alert settings for Signal Bot:
https://swietcherbot.space/webhook
Use the same webhook URL for both Forex and Crypto. The system automatically detects the signal format and routes to the correct engine.
Existing WunderTrading users only need to swap the webhook URL. All signal formats are fully compatible.
You can use either plain text signal codes or full JSON format:
ENTER-LONG_Binance_BTCUSDT_mybotname_5M_a1b2c3d4e5f6
ENTER-LONG
EXIT-LONG
ENTER-SHORT
EXIT-SHORT
EXIT-ALL
| Field | Required | Type | Comments |
|---|---|---|---|
code |
✓ Yes | string | The entry comment code that passes Enter Long or Enter Short signal. Format: ACTION_Exchange_SYMBOL_BotName_Timeframe_LicenseCode |
{
"code": "ENTER-LONG_Binance_BTCUSDT_mybotname_5M_a1b2c3d4e5f6"
}
| Field | Required | Type | Comments |
|---|---|---|---|
orderType |
✓ Yes | string | Accepted values: "market", "limit" |
amountPerTradeType |
✓ Yes | string |
Spot: "quote", "base", "percents"Derivatives: "quote", "contracts", "percents"
|
amountPerTrade |
✓ Yes | number | Range: (0; +∞). When type is "percents", use decimals — 10% →
0.1
|
leverage |
○ No | number | Range: [1, 125]. Default: 1 |
{
"code": "ENTER-LONG_Binance_BTCUSDT_mybotname_5M_license",
"orderType": "market",
"amountPerTradeType": "quote",
"amountPerTrade": 100,
"leverage": 10
}
{
"code": "ENTER-SHORT_Bybit_ETHUSDT_mybotname_15M_license",
"orderType": "market",
"amountPerTradeType": "percents",
"amountPerTrade": 0.1,
"leverage": 5
}
| Field | Required | Type | Comments |
|---|---|---|---|
timeInForce |
○ No | number | Range: [5, 20160]. Default: 5. Limit order time in force in
minutes. Mandatory for limit orders.
|
price |
○ No | number | Range: (0; +∞). Strict price value. Mandatory when
priceDeviation is not defined.
|
priceDeviation |
○ No | object | Price deviation settings. Mandatory when price is not
defined. |
priceDeviation.deviation |
✓ Yes* | number | If deviationType="percents" — LONG: (0.001; 1) | SHORT:
(0.001; +∞)
|
priceDeviation.deviationType |
○ No | string | Possible value: "percents" |
priceDeviation.priceType |
○ No | string | Possible values: "bid", "ask", "last". Default:
"last"
|
{
"code": "ENTER-LONG_Binance_BTCUSDT_bot_1H_license",
"orderType": "limit",
"amountPerTradeType": "quote",
"amountPerTrade": 200,
"price": 65000,
"timeInForce": 60
}
{
"code": "ENTER-LONG_Bybit_ETHUSDT_bot_1H_license",
"orderType": "limit",
"amountPerTradeType": "quote",
"amountPerTrade": 100,
"timeInForce": 30,
"priceDeviation": {
"deviation": 0.01,
"deviationType": "percents",
"priceType": "ask"
}
}
| Field | Required | Type | Comments |
|---|---|---|---|
takeProfits |
○ No | array | Array of take profit target objects. Multiple TPs allowed. |
takeProfits[].price |
○ No | number | Range: (0; +∞). Strict price value. Only for single pair bots. |
takeProfits[].priceDeviation |
○ No | number | Percent ratio: 10% → 0.1. LONG: (0.001; +∞) | SHORT:
(0.001; 1). Cannot be empty for multiple pairs bot.
|
takeProfits[].portfolio |
○ No | number | null | Range: (0; 1]. Position size ratio to close — 100% → 1. Cannot
be empty for multiple pairs bot. |
{
"code": "ENTER-LONG_Binance_BTCUSDT_bot_4H_license",
"takeProfits": [
{ "price": 72000, "portfolio": 0.5 },
{ "price": 76000, "portfolio": 0.5 }
]
}
{
"code": "ENTER-LONG_Bybit_ETHUSDT_bot_1H_license",
"takeProfits": [
{ "priceDeviation": 0.02, "portfolio": 0.5 },
{ "priceDeviation": 0.04, "portfolio": 0.5 }
]
}
| Field | Required | Type | Comments |
|---|---|---|---|
stopLoss |
○ No | object | Stop loss configuration object. |
stopLoss.price |
✓ Yes* | number | Range: (0; +∞). Strict price value. Only for single pair bots. Use
either price or priceDeviation.
|
stopLoss.priceDeviation |
✓ Yes* | number | Percent ratio: 10% → 0.1. SHORT: (0.001; +∞) | LONG:
(0.001; 1). Cannot be empty for multiple pairs bot.
|
{
"code": "ENTER-LONG_Binance_BTCUSDT_bot_4H_license",
"stopLoss": { "price": 61000 }
}
{
"code": "ENTER-LONG_Bybit_ETHUSDT_bot_1H_license",
"stopLoss": { "priceDeviation": 0.02 }
}
| Field | Required | Type | Comments |
|---|---|---|---|
moveToBreakeven.activationPrice |
✓ Yes (single) | number | Range: (0; +∞). Strict price value. Only for single pair bots. |
moveToBreakeven.executePrice |
○ No (single) | number | null | Range: (0; +∞). Default: null (equals entry price). Only for
single pair bots. |
moveToBreakeven.activationPriceDeviation |
✓ Yes | number | Percent ratio: 10% → 0.1. LONG: (0.001; +∞) | SHORT:
(0.001; 1). Cannot be empty for multiple pairs bot.
|
moveToBreakeven.executePriceDeviation |
✓ Yes | number | Range: (-1; activationPriceDeviation). Percent ratio: 10% →
0.1. Cannot be empty for multiple pairs bot.
|
{
"code": "ENTER-LONG_Binance_BTCUSDT_bot_4H_license",
"moveToBreakeven": {
"activationPriceDeviation": 0.02,
"executePriceDeviation": 0.001
}
}
{
"code": "ENTER-LONG_Binance_BTCUSDT_bot_4H_license",
"moveToBreakeven": {
"activationPrice": 70000,
"executePrice": null,
"activationPriceDeviation": 0.02,
"executePriceDeviation": 0.001
}
}
| Field | Required | Type | Comments |
|---|---|---|---|
trailingStop.activation |
✓ Yes | number | Percent ratio. LONG: (0.0001; +∞) | SHORT: (0.0001; 1). Profit
level that triggers trailing. 2% → 0.02 |
trailingStop.execute |
✓ Yes | number | Percent ratio. LONG: (0.0001; 1) | SHORT: (0.0001; +∞).
Callback from peak that triggers exit. 1% → 0.01 |
{
"code": "ENTER-LONG_Binance_BTCUSDT_bot_1H_license",
"trailingStop": {
"activation": 0.02,
"execute": 0.01
}
}
{
"code": "ENTER-LONG_Bybit_SOLUSDT_bot_15M_license",
"trailingStop": {
"activation": 0.005,
"execute": 0.002
}
}
| Field | Required | Type | Comments |
|---|---|---|---|
keepPositionOpen |
○ No | boolean | Default: true. Only affects spot strategies with empty
takeProfits, stopLoss, moveToBreakeven,
trailingStop.
|
reduceOnly |
○ No | boolean | Default: true. Reduce only for exits. No effect for spot strategies. |
placeConditionalOrdersOnExchange |
○ No | boolean | Default: false. Place exit conditional orders on exchange. Partially
supported, ignored when DCA is enabled. |
{
"code": "ENTER-LONG_Binance_BTCUSDT_bot_4H_license",
"keepPositionOpen": true,
"reduceOnly": true,
"placeConditionalOrdersOnExchange": true
}
| Field | Required | Type | Comments |
|---|---|---|---|
dca |
○ No | object | DCA configuration object. All sub-fields below belong inside this object. |
dca.extraOrderCount |
✓ Yes* | number | Range: [1; 30]. Total of entry + extra DCA orders. Value 5 = 1
entry + 4 extra DCA orders. |
dca.extraOrderDeviation |
✓ Yes* | number | Range: [0.001; 0.2]. Price deviation for each extra DCA order. |
dca.extraOrderVolumeMultiplier |
✓ Yes* | number | Range: [1; 10]. Volume multiplier for each extra DCA order. |
dca.extraOrderDeviationMultiplier |
○ No | number | Range: [1; 10]. Default: null. Price deviation multiplier
between DCA orders. |
dca.takeProfitsBasedOn |
○ No | string | Values: "average_price", "entry_order". Default:
"average_price"
|
dca.stopLossBasedOn |
○ No | string | Values: "average_price", "entry_order". Default:
"entry_order"
|
{
"code": "ENTER-LONG_Bybit_ETHUSDT_bot_1H_license",
"amountPerTradeType": "quote",
"amountPerTrade": 100,
"dca": {
"extraOrderCount": 4,
"extraOrderDeviation": 0.01,
"extraOrderVolumeMultiplier": 1.5
}
}
{
"code": "ENTER-LONG_Binance_BTCUSDT_bot_4H_license",
"amountPerTradeType": "quote",
"amountPerTrade": 200,
"leverage": 5,
"takeProfits": [
{ "priceDeviation": 0.03, "portfolio": 1 }
],
"stopLoss": { "priceDeviation": 0.05 },
"dca": {
"extraOrderCount": 5,
"extraOrderDeviation": 0.015,
"extraOrderVolumeMultiplier": 2,
"extraOrderDeviationMultiplier": 1.5,
"takeProfitsBasedOn": "average_price",
"stopLossBasedOn": "average_price"
}
}
{
"code": "ENTER-LONG_Binance_BTCUSDT_mybotname_5M_a1b2c3d4e5f6",
"orderType": "market",
"amountPerTradeType": "quote",
"amountPerTrade": 100,
"leverage": 10,
"takeProfits": [
{ "priceDeviation": 0.02, "portfolio": 0.5 },
{ "priceDeviation": 0.04, "portfolio": 0.5 }
],
"stopLoss": { "priceDeviation": 0.02 }
}
{
"code": "EXIT-LONG_Binance_BTCUSDT_mybotname_5M_a1b2c3d4e5f6"
}
code is required for exit signals.{
"code": "ENTER-LONG_Bybit_ETHUSDT_mybot_15M_license",
"amountPerTradeType": "quote",
"amountPerTrade": 200,
"leverage": 20,
"takeProfits": [
{ "priceDeviation": 0.02, "portfolio": 0.5 },
{ "priceDeviation": 0.04, "portfolio": 0.5 }
],
"stopLoss": { "priceDeviation": 0.015 },
"trailingStop": {
"activation": 0.03,
"execute": 0.01
},
"moveToBreakeven": {
"activationPriceDeviation": 0.02,
"executePriceDeviation": 0.001
}
}
{
"code": "ENTER-LONG_Binance_BTCUSDT_mybot_4H_license",
"orderType": "market",
"amountPerTradeType": "quote",
"amountPerTrade": 200,
"leverage": 10,
"takeProfits": [
{ "priceDeviation": 0.02, "portfolio": 0.33 },
{ "priceDeviation": 0.04, "portfolio": 0.33 },
{ "priceDeviation": 0.08, "portfolio": 0.34 }
],
"stopLoss": { "priceDeviation": 0.03 },
"trailingStop": {
"activation": 0.04,
"execute": 0.01
},
"moveToBreakeven": {
"activationPriceDeviation": 0.015,
"executePriceDeviation": 0.001
},
"dca": {
"extraOrderCount": 4,
"extraOrderDeviation": 0.01,
"extraOrderVolumeMultiplier": 1.5,
"extraOrderDeviationMultiplier": 1.2,
"takeProfitsBasedOn": "average_price",
"stopLossBasedOn": "average_price"
},
"keepPositionOpen": true,
"reduceOnly": true,
"placeConditionalOrdersOnExchange": false
}
ENTER-LONG_Binance_BTCUSDT_mybotname_5M_a1b2c3d4e5f6g7h8i9j0k1l2
//@version=5
strategy("My Signal Bot Strategy", overlay=true)
longCondition = ta.crossover(ta.sma(close, 14), ta.sma(close, 28))
shortCondition = ta.crossunder(ta.sma(close, 14), ta.sma(close, 28))
if (longCondition)
strategy.entry("Long", strategy.long)
alert("ENTER-LONG_Binance_{{ticker}}_mybotname_5M_YOUR_LICENSE_CODE", alert.freq_once_per_bar)
if (shortCondition and strategy.position_size > 0)
strategy.close("Long")
alert("EXIT-LONG_Binance_{{ticker}}_mybotname_5M_YOUR_LICENSE_CODE", alert.freq_once_per_bar)
if (shortCondition)
strategy.entry("Short", strategy.short)
alert("ENTER-SHORT_Binance_{{ticker}}_mybotname_5M_YOUR_LICENSE_CODE", alert.freq_once_per_bar)
if (longCondition and strategy.position_size < 0)
strategy.close("Short")
alert("EXIT-SHORT_Binance_{{ticker}}_mybotname_5M_YOUR_LICENSE_CODE", alert.freq_once_per_bar)
//@version=5
strategy("Advanced Signal Bot", overlay=true)
longCondition = ta.crossover(ta.ema(close, 9), ta.ema(close, 21))
shortCondition = ta.crossunder(ta.ema(close, 9), ta.ema(close, 21))
longJson = '{"code":"ENTER-LONG_Binance_' + syminfo.ticker + '_mybotname_5M_YOUR_LICENSE_CODE","leverage":10,"amountPerTrade":100,"takeProfits":[{"priceDeviation":0.02,"portfolio":0.5},{"priceDeviation":0.04,"portfolio":0.5}],"stopLoss":{"priceDeviation":0.015}}'
shortJson = '{"code":"ENTER-SHORT_Binance_' + syminfo.ticker + '_mybotname_5M_YOUR_LICENSE_CODE","leverage":10,"amountPerTrade":100,"takeProfits":[{"priceDeviation":0.02,"portfolio":0.5},{"priceDeviation":0.04,"portfolio":0.5}],"stopLoss":{"priceDeviation":0.015}}'
if (longCondition)
strategy.entry("Long", strategy.long)
alert(longJson, alert.freq_once_per_bar)
if (shortCondition and strategy.position_size > 0)
strategy.close("Long")
alert('{"code":"EXIT-LONG_Binance_' + syminfo.ticker + '_mybotname_5M_YOUR_LICENSE_CODE"}', alert.freq_once_per_bar)
if (shortCondition)
strategy.entry("Short", strategy.short)
alert(shortJson, alert.freq_once_per_bar)
if (longCondition and strategy.position_size < 0)
strategy.close("Short")
alert('{"code":"EXIT-SHORT_Binance_' + syminfo.ticker + '_mybotname_5M_YOUR_LICENSE_CODE"}', alert.freq_once_per_bar)
Signal Bot receives trading signals via webhook and executes trades on Binance or Bybit. Configure TP/SL/DCA once, send simple signals from TradingView.
No! Use the same URL: swietcherbot.space/webhook. The system auto-detects signal format (JSON with "code" field → Signal Bot, "action" field → cTrader).
Yes! Our signal format is fully WunderTrading-compatible. Just change the webhook URL and your existing bots will work.
VIP plan: Up to 5 signal bots. Premium plan: Signal Bots not included. Upgrade to VIP for full Signal Bot access.
Go to AI Terminal → Signal Bots tab → Click "Create Bot". Set your exchange, trading pair, amount, leverage, and default TP/SL settings.