Documentation

Create a TradingView alert and understand commands

Create an alert in TradingView

  1. Open your chart in TradingView
  2. Right-click on the chart
  3. Click Add alert
  4. Fill in the trigger condition
  5. In the Notifications section, check Webhook URL
  6. Paste the webhook URL
  7. In the Message field, paste your JSON
  8. Click Create



Enter the webhook URL

Example TIXIAN webhook URL to display and keep copyable:

https://webhook.tixian.fr/YOUR_UNIQUE_TOKEN

Depending on your setup, two cases may exist:

  1. a personal URL that already contains your token
  2. a configuration where you must also send the privateKey in the JSON

If support gave you a personal URL, use it as it is. If your setup relies on JSON authentication, also add the privateKey to the message.



Fields to use in your alerts

  1. privateKey: the account private key if your setup requires it
  2. symbol: the symbol, for example EURUSD
  3. side: the order type, for example buy or sell
  4. price: the entry price for pending orders
  5. risk: the risk value sent to the robot
  6. sl: the stop loss
  7. tp: the take profit

Market order example

{
"privateKey": "YOUR_PRIVATEKEY",
"symbol": "{{ticker}}",
"side": "buy",
"risk": 1,
"sl": 20,
"tp": 40
}

Pending order example

{
"privateKey": "YOUR_PRIVATEKEY",
"symbol": "{{ticker}}",
"side": "buylimit",
"price": 1.08250,
"risk": 1,
"sl": 20,
"tp": 40
}

In the current MT5 robot code, the field used for the entry price of a pending order is price. If you use entry, the order may not be interpreted as expected.

Close example

{
"privateKey": "YOUR_PRIVATEKEY",
"symbol": "{{ticker}}",
"side": "closelong"
}
***PHOTO ICI*** + Screenshot of the Message field with a correctly filled JSON payload.

What each field is used for

  1. privateKey: identifies your account if your webhook URL does not already include the necessary token
  2. symbol: indicates the symbol to process
  3. side: indicates the action to perform
  4. price: indicates the entry price for a pending order
  5. risk: indicates the risk value to use
  6. sl: indicates the stop loss
  7. tp: indicates the take profit

Main commands

Market orders

  1. buy or long
  2. sell or short

Pending orders

  1. buylimit
  2. buystop
  3. selllimit
  4. sellstop

Close and cancel actions

  1. closelong
  2. closeshort
  3. closelongshort
  4. cancellong
  5. cancelshort

Important rules

If you use RiskSource = RISK_FROM_TV_PERCENT

  1. the risk field becomes mandatory
  2. use a value strictly greater than 0
  3. keep the value reasonable
  4. avoid sending a value greater than 50

If you use PriceMode = PRICE_ABSOLUTE

  1. for a buy, sl must be below and tp above
  2. for a sell, sl must be above and tp below

For pending orders

  1. buylimit: price must be below market
  2. buystop: price must be above market
  3. selllimit: price must be above market
  4. sellstop: price must be below market

Testing advice

  1. use a demo account
  2. test one symbol first
  3. keep risk low
  4. then check Orders, then Transactions