2

TradingView Trading Syntax

This guide will show you how to structure your TradingView alert message

Morten Madsen

Last Update 8 วันที่แล้ว

If the below formats don't match your alert format, then please contact us and we will implement your format

Syntax

The minimum requirements for a TradingView alert to trigger a trade are Buy / Sell + trading pair name. Example: Buy EURUSD or Sell EURUSD.

Market orders

Buy Syntax

There are multiple ways to write a buy alert. Below we will list the most simple alert format.

  • Buy EURUSD or EURUSD Buy


Sell Syntax

  • Sell EURUSD or EURUSD Sell


For each alert format Take Profit levels and Stop Loss level can be added. Cordly supports up to 4 Take profit levels per alert.

Below are some examples(x = price):


  • Buy EURUSD
    TP x
    SL x
  • Buy EURUSD
    Take Profit x
    Stop loss x
  • Sell EURUSD
    TP x
    TP x
    TP x
    TP x
    SL x
  • Sell EURUSD
    TP x
    TP x
    SL x
  • EURUSD Buy
    SL x
    TP x
    TP x

These are just some examples. Alerts can be built in very different ways. It's important to define direction, pair, take profit levels, and stop loss.


Pending Orders

Buy Syntax

There are multiple ways to write a buy alert. Below we will list the most simple alert format. Below are some examples(x = price):

  • Buy EURUSD limit
    Entry x
  • EURUSD Buy limit
    Entry x
  • EURUSD Buy stop

    Entry x

  • Buy EURUSD Stop

    Entry x

The alerts need to have the entry price to create the alert


Sell Syntax

  • Sell limit EURUSD
    Entry x
  • EURUSD Sell limit
    Entry x
  • EURUSD Sell stop

    Entry x

  • Sell EURUSD Stop
    Entry x

The alerts need to have the entry price to create the alert


For each alert format Take Profit levels and Stop Loss level can be added. Cordly supports up to 4 Take profit levels per alert.

Here are some examples(x = price):


  • Buy EURUSD limit
    Entry x
    TP x
    SL x
  • Buy EURUSD stop
    Take Profit x
    Stop loss x
    Entry x
  • Sell EURUSD Limit
    Entry x
    TP x
    TP x
    TP x
    TP x
    SL x
  • Sell EURUSD Stop
    Entry x
    TP x
    TP x
    SL x
  • EURUSD Buy Limit
    Entry x
    SL x
    TP x
    TP x

These are just some examples. Alerts can be built in very different ways. It's important to define direction, pair, entry price, take profit levels, and stop loss.

Close Commands

If you want to close current open orders or pending orders you can use the below commands.

  • Close Pairname

This command will close all trades with that pair. 

Example Close EURUSD -> will close all open or pending orders for EURUSD


  • Close all

This command will close all trades. 

Example Close all -> will close all open or pending orders


  • Close Pairname buy

This command will close all buy trades with that pair. 

Example Close EURUSD buy -> will close all open or pending buy orders for EURUSD


  • Close Pairname sell

This command will close all sell trades with that pair. 

Example Close EURUSD sell -> will close all open or pending sell orders for EURUSD


Hedge Order Commands

If you use hedging in your trading you can use the below commands. The commands will close the current open position and open a new position in the opposite direction.

  • Close pairname go long or Close pairname go buy

This command will close the current sell position and open a buy position


  • Close pairname go short or Close pairname go sell

This command will close the current buy position and open a sell position


Example: Close EURUSD go short -> will close my Buy EURUSD position and open a Sell EURUSD position.

Example: Close EURUSD go long -> will close my Sell EURUSD position and open a Buy EURUSD position.


Indicators

To use indicators with Cordly, you need to use one of the two options below but it depends on how the indicator you use is configured.

The two options are plain text or syntax commands.

1) Plain text commands

If your indicator has buy or sell (or long/short) conditions as seen in the image below, you can use the plain text option.

With plain text commands, you can structure your alert message to be Buy/Sell TradingPair. Example Buy USDCAD

2) Syntax commands

If your indicator doesn't have the above conditions you need to ask the seller of the indicator what command structure to use. 

If they support the command structure as seen below you will be able to create alerts using this command line:

{{strategy.order.action}} {{ticker}}

In this case, the indicator will alert you to buy or sell and the trading pair to buy/sell. Example: Buy USDCAD

Was this article helpful?

3 out of 4 liked this article