Syntax Guide

This guide is to assist you in crafting your alert messages to be compliant to our syntax.


Please refer to the EA Guide and Alerts Guide
in conjunction with this Syntax Guide.


EA Guide →   Alerts Guide →


Section Command Remarks
1 Basic Basic commands for most trades
2 Market Order Commands to enter at the market
3 Pending Order Commands to enter above or below the market
4 Breakeven Commands to activate the Breakeven Stop
5 Pips Trailing Commands to activate the Pips Trailing Stop
6 ATR Trailing Commands to activate the ATR Trailing Stop
7 Spread Filter Commands to filter out trades with high spreads
8 Trailing Scenarios and Settings Trailing examples with various scenarios and recommended settings
9 Sample Combined Syntax PineConector syntax, put together
10 Important Note Some things to keep in mind

Section 1: Basic Commands
Command Description Examples
LicenseID
(required parameter)

License ID is long string found in the intranet 

(Position #1) To be placed at the start of the syntax message

5123456789012
Order
(required parameter)

Main Order command – more information below under "Market Order" and "Pending Order" Commands

(Position #2) To be placed at the after the License ID 

buy, sell, buystop, buylimit, sellstop, selllimit, closelong, cancellong, closeshort, cancelshort, newsltplong, newsltpshort
Symbol
(required parameter)

Symbol or asset you would like to enter/exit/modify etc

(Position #3) To be placed after Market/Pending Order Command 

EURUSD, GER30
risk=
(required parameter)
Place a trade with Lot size/Volume based on alert message or percentage of balance (toggle on EA) risk=0.05 or risk=2
price=
(required parameter for pending orders)

Place pending order at the stated price or Pips from current market price 

Please note that we recommend Pips from current market price due to differences in quotes on TradingView and your Broker. (toggle on EA)

price=1.158 or price=10
sl= Place stoploss based on price or pips from open price (toggle on EA) sl=1.2012 or sl=25
tp=
Place takeproft based on price or pips from open price (toggle on EA)
tp=1.2022 or tp=50
comment=

Add a comment to the trade

Please note:
  • using the comment feature will disable the Breakeven and Trailing (Pips and ATR) features
  • text is to be contained in the " "
comment="hello" or comment="strategy 1"
eaon
eaoff

Resume or halt the PineConnector EA

licenseid,eaon,eaon

licenseid,eaoff,eaoff

Examples with basic commands*:
5123456789012,buy,EURUSD,risk=1
5123456789012,buylimit,EURUSD,risk=1,price=10
5123456789012,sell,EURUSD,risk=1,sl=10,tp=30,comment="strategy 1"
5123456789012,sellstop,EURUSD,risk=1,sl=10,tp=30,price=15,comment="strategy 2"

*see Section 9 for more comprehensive sample syntax with explanations

↑top 

 

Section 2: Market Order Commands
Command Description Examples
buy 
Place buy position
buy
sell
Place sell position
sell
closelong 

Close the full long position of that symbol 

ID,closelong,EURUSD
closeshort
Close the full short position of that symbol
ID,closeshort,GBPJPY

newsltplong*

Move the stoploss, takeprofit or both SL and TP of ALL buy trades with that symbol 
ID,newsltplong,EURUSD,sl=1.22
ID,newsltplong,EURUSD,tp=15
ID,newsltplong,EURUSD,sl=20,tp=10

newsltpshort*

Move the stoploss, takeprofit or both SL and TP of ALL sell trades with that symbol
ID,newsltpshort,GBPJPY,sl=152.11
ID,newsltpshort,GBPJPY,tp=150.51
ID,newsltpshort,GBPJPY,sl=30,tp=50

*the new SL and TP will be computed based on your target type in your EA Settings - pips, price or percentage

Sample output in the Experts tab, with percentage-based target:

↑top 

 

Section 3: Pending Order Commands
(please ensure you have price=)
Command Description Examples
buystop
Place Buy Stop order above current market price
ID,buystop,USOIL,
price=75,sl=70
buylimit
Place Buy Limit order below current market price
ID,buylimit,USOIL,
price=65,sl=60
sellstop
Place Sell Stop order below current market price
ID,sellstop,USOIL,
price=75,sl=80
selllimit
Place Sell Limit order above current market price
ID,selllimit,USOIL,
price=65,sl=70
cancellong
Cancels all long orders 
that was placed by the PineConnector EA (buystop and buylimit) for the accompanying symbol 
ID,cancellong,NAS100
cancelshort
Cancels all short orders 
that was placed by the PineConnector EA (sellstop and selllimit) for the accompanying symbol
ID,cancelshort,GBPJPY
↑top 

 

Section 4: Breakeven Commands
(to use Breakeven feature, both commands required)
Command Description Examples

betrigger=
(Ensure >0)

Breakeven will be activated after a trade gains this number of pips beyond opening price.

*Ensure that value is minimally the broker's stops level in pips.

betrigger=30
beoffset=

Offset from the entry price. 0 means the SL will be placed exactly at entry price while 1 means 1 pip above the entry price for buy trades and 1 pip below for sell trades. This is the amount of pips you'd like to protect. 

*Ensure that beoffset<bettrigger

beoffset=5

Your Breakeven parameters will be stored in the position's Comment area.

Please visually confirm that your parameters are added to the comment's section.

↑top 

 


Section 5: Pips Trailing Commands
(to use Pips Trailing SL feature, all 3 commands are required)
Command Description Examples
trailtrig=

Trailing stop-loss will be activated after a trade gains this number of pips. 

If your trailtrig=0, price will have to minimally move the bid-ask spread to begin.

To begin instantaneously, without the need to move the bid-ask spread, you may use trailtrig<0. (i.e. trialtrig=-10)

trailtrig=12

traildist=
(Ensure >0)

Distance of the trailing stop-loss from current price. SL will be opened at traildist, after trailtrig is met, even if you do not have a SL placed.  traildist=8
trailstep= Moves trailing stop-loss once price moves favourable by a specified number of pips. trailstep=3 
Example configuration: Buy position with trailtrig=12, traildist=8 and trailstep=3

  • With trailtrig=12, the first instance of trailing SL will be when price moves favorably for 12 pips (entry+12). 
    The SL will be placed 8 pips lower at (entry+12-8).
    • If you have a SL, the SL will be updated 
    • If you do not have a SL, a SL will be created automatically
    • With trailstep=3, the second instance of trailing SL is when price moves favorably for another 3 pips (entry+12+3).
      The SL will be placed at 8 pips lower at (entry+12+3-8).
      • The third instance will be when price moves another 3 favorable pips (entry+12+3+3). 
        The SL will be placed 8 pips lower at (entry+12+3+3-8), and so on.


      Your Pips Trailing parameters will be stored in the position's Comment area.

      Please visually confirm that your parameters are added to the comment's section.

      ↑top 

       


      Section 6: ATR Trailing Commands 
      (to use ATR Trailing SL feature, both atrtimeframe= and atrperiod= commands are required)
      Command Description Examples

      atrtimeframe=
      (Ensure one of the 7 allowable values)

       

      ATR Trailing Stop will be based on the specified timeframe in minutes and will only update once per bar close

      If stop loss not specified at point of entry, a SL will be automatically added with the ATR values used

      Allowable timeframe values:

      1. 1        (1 minute),
      2. 5        (5 minutes),
      3. 15      (15 minutes),
      4. 30      (30 minutes),
      5. 60      (1 hour),
      6. 240    (4 hours),
      7. 1440  (1 day)
      atrtimeframe=15

      atrperiod=
      (Ensure >0)

      ATR averaging period atrperiod=14

      atrmultiplier=
      (optional)

      ATR multiplier atrmultiplier=2

      atrtrigger=
      (optional)

      Delay the trigger of ATR Trailing, in pips  atrtrigger=10


      Your ATR Trailing parameters will be stored in the position's Comment area.



      Sample Expert output when ATR Trailing moves SL.

      Please visually confirm that your parameters are added to the comment's section.

      ↑top 

       


      Section 7: Spread Filter Commands
      Command Description Examples

      spread=

      Only orders with spread equal or less than specified spread in pips will be executed

      spread=2
      spread=1.22


      Sample alert if spread in pips is more than specified spread tolerance


      Sample Expert output when spread is within acceptable levels

      ↑top 

       

      Section 8: Trailing Scenarios and Settings
      Scenario Recommended Trail Settings 
      • Trailing to start immediately
      • SL to be placed 10 pips from current price
      • SL to be moved every 1 pip of favorable movement
      • trailtrig=-10 (negative 10)
      • traildist=10
      • trailstep=1
      • Trailing to begin when price moves favorably by 8 pips
      • SL to be placed 9 pips from current price
      • SL to be moved every 5 pips of favorable movement
      • trailtrig=8
      • traildist=9
      • triailstep=5
      Note: Values are typically in pips.
      When trading non-FX, such as the US100,
      using a value of 10 may mean 1 point in the index.
      Do test it first.

      ↑top 

       

      Section 9: Sample Combined Syntax
      Sample Syntax Interpretation
      5123456789012,buy,AUDUSD,risk=0.01

      Enter a long AUDUSD trade with 0.01 position size

      EA Settings
      • Volume type = Specified Volume
        5123456789012,sell,GBPJPY,sl=50,tp=150,risk=1

        Enter a short 1 volume GBPJPY trade with SL and TP being 50 and 150 pips from current price. 

        EA Settings
        • Target type = TP & SL based on pips
        • Volume type = Specified Volume
          5123456789012,closelong,GBPUSD

          Closes the all GBPUSD long trades 

          EA Settings
          • N/A
            5123456789012,buy,EURUSD,sl=1.20,risk=1, trailtrig=15,traildist=10,trailstep=12

            Going long EURUSD with initial SL at 1.20 risking 1% of account balance. Trailing stop to activate when price moves favorably by 15 pips. Every 12 pips move in favor of direction, the stop-loss will move to 10 pips from current price.

            EA Settings
            • Target type = TP & SL based on price
            • Volume type = Percentage of balance
              5123456789012,buy,EURCAD,sl=100,risk=5, betrigger=30,beoffset=5

              Going long EURCAD with initial SL at 100 pips away, risking 5 volumes. SL will be moved to (entry price + 5 pips) when price has moved favorably by 30 pips. 

              EA Settings
              • Target type = TP & SL based on pips
              • Volume type = Specified volume
              5123456789012,selllimit,EURUSD,price=1.2340,sl=10,risk=1

              Place a sell limit on EURUSD at price of 1.2340 with a 10 pips stop-loss. Lot size/Volume of 1.

              EA Settings
              • Target type = TP & SL based on pips
              • Volume type = Specified volume
              5123456789012,cancellong,EURUSD

              Cancel all long pending orders (buystop and buylimit) for EURUSD.

              EA Settings
              • NA
              5123456789012,buy,EURUSD,risk=1,spread=3

              Buy EURUSD at the market if current spread is 3 or lower.

              EA Settings
              • NA
              5123456789012,newsltplong,EURUSD,sl=10,tp=30

              Update SL to 10 pips and TP to 30 pips from current market price.

              EA Settings
              • Target Type = TP & SL based on pips

              note: syntax commands are case-sensitive 


              ↑top 

               

              Section 10: Important Note
               Components Remarks Example
              SL, TP, BE, Trailing Settings cannot be too tight. Refer to your symbol information in the symbol list under "Stops Level"
              1 pip from current price
              Tick Size Targets have to comply with symbol's tick size. Refer to "Tick Size"
              UK100 CFDs with a tick size of 0.5. Your target ending with 0.3 will be rejected.
              Volume Minimum volume should be met. Refer to "Minimal Volume" 0.1 minimum volume. Trade with volume or increments of 0.01 will be rejected.
              ↑top  

              Related Links