TradingView Alert Syntax

Buy/Sell Commands

In each Alert message you can distinguish several components separated by comma:

TradingLink ID, symbol name, command, command parameters

The two most popular commands you will be using are buy and sell. They are also the ones with most elaborate command parameters. Below is a sample buy Alert message:

70c3ecab,EURUSD,buy,tp=20,sl=10,risk=1%

Let's dissect the above example:

  • 70c3ecab is TradingLink ID, it is unique ID created per trading account when you first start TradingLink software

  • EURUSD is symbol name that we'll operate on, it needs to exist on your broker's symbol list

  • buy is command to be executed, it has three required parameters described next

  • tp=60 is take profit in PIPS, you can also specify it as price by adding $ at the end eg. tp=1.19915$

  • sl=40 is stop loss in PIPS, as with take profit you can enter exact price level by adding $ at the end eg. sl=1.197$

  • risk=1% position size that will be equivalent of 1% of your trading account balance, you can specify exact lot size by removing % sign eg. risk=0.05

Every buy and sell command requires you to specify tp=, sl= and risk= parameters that are greater than zero.


Optional Parameters

On top of required ones, buy and sell command also have a set of optional parameters. Take a look at the following Alert message:

70c3ecab,GE30,sell,tp=70,sl=20,risk=0.7%,betrigger=30,beoffset=2

Two optional parameters related to break even were added:

  • betrigger=30 after price moves 30 PIPS in your favour, stop loss will be moved to the break even level

  • beoffset=2 add 2 PIPS to the calculated break even level, this is the amount of PIPS you would like to protect


Another example, this time presenting the tailing stop loss feature:

70c3ecab,XAUUSD,buy,tp=100,sl=50,risk=0.3,trailtrig=30

  • trailtrig=30 once there is profit of 30 PIPS on your trade, the trailing stop loss will be activated. Initial stop loss level, set with parameter sl=50, determines the trailing distance. In other words stop loss would be automatically kept within distance of 50 PIPS from current price. Stop loss will only be moved in your favour.


You might want to set trailing distance to a different value from the initial stop loss level. Here is how to do that:

70c3ecab,GE30,sell,tp=90,sl=60,risk=2%,trailtrig=30,traildist=20

  • traildist=20 when the trailing stop loss is activated the stop loss level will automatically be kept within distance of 20 PIPS from current price, and only moved to protect more and more of your gains.


Close Commands

Apart from buy and sell, there is also set of close commands, which don't have any parameters:

  • 70c3ecab,BTCUSD,closeall close all positions opened by TradingLink software on BTCUSD symbol

  • 70c3ecab,XTIUSD,closelong close long position opened with buy command on XTIUSD symbol

  • 70c3ecab,AUDUSD,closeshort close short positions opened with sell command on AUDUSD symbol

  • 70c3ecab,GBPUSD,closeprofit close all profitable positions, opened by TradingLink software on GBPUSD symbol

  • 70c3ecab,GE30,closeloss close all positions in loss, opened by TradingLink software on GE30 symbol


Setup TradingView

Go to TradingView and use the following “Webhook URL”:

http://webhook.tradinglink.org