Open Portal

Signal Reference

Learn how to configure and manage trading signals with TradeSgnl. Understand signal formats, webhook setup, and automated signal processing.

The raw signal syntax that TradeSgnl accepts — every parameter, every action type, every output. Use this when you're writing Pine Script by hand or integrating from a non-TradingView source. For everyday use, the Syntax Generator is faster.

Syntax Generator Tool

Most users don't need this page

The Syntax Generator builds every signal format on this page through a visual form, and includes a Test Signal button to verify your EA without touching TradingView. Read this page only when you need the raw reference — for Pine Script authors, integrators, or to understand a specific parameter in depth.

Go to the Syntax Generator guide

Signal Format & EA Settings

The TradeSgnl EA has settings that determine which parameters it uses for trades.

Parameter Source Setting

The EA has a "Parameter Source" setting that determines whether it uses values from the Signal Parameters or from the EA Inputs. This affects volume, stop-loss, and take-profit values.

Open EA Settings

TradeSgnl uses a comma-separated format with required and optional parameters:

LicenseID,SYMBOL,ACTION,risk=VOLUME,[OPTIONAL_PARAMS]

Signal Structure

Each signal consists of required components followed by optional parameters:

  1. LicenseID. Your unique license identifier (e.g., LicenseID)
  2. Symbol. The trading instrument (e.g., EURUSD, BTCUSD)
  3. Action. The trading action (buy, sell, buystop, etc.)
  4. Volume. Trading size with risk= prefix (e.g., risk=0.01)
  5. Optional Parameters. Additional settings (sl=, tp=, comment=, etc.)

Format Rules

  • Parameters are separated by commas with no spaces.
  • All parameters are case-insensitive (buy = BUY).
  • Optional parameters can be in any order.
  • Values are assigned with the equals sign (sl=30).
  • Risk can be in lots (risk=0.01) or percentage (risk=1) depending on EA settings.
  • Partial close values can be in lots (pct=2) or percentage (pct=0.5) depending on EA settings.

Optional Parameters

Enhance your signals with these optional parameters.

ParameterDescriptionExample
sl=Stop Loss in pips (or currency if enabled) from entry pricesl=50
tp=Take Profit in pips (or currency if enabled) from entry pricetp=100
tp1=, tp2=, tp3=, ...Unlimited take profit levels (tp1, tp2, tp3, tp4, tp5, ...)tp1=50,tp2=100,tp3=150,tp4=200
pct1=, pct2=, pct3=, ...Partial close percentage for each TP level (0.0–1.0)pct1=0.5,pct2=0.3,pct3=0.2
pending=Pending order level (interpretation depends on EA setting)pending=20
pct=Partial close amount (percentage or lots based on EA setting)pct=0.5
trtrig=Pips needed to activate trailing stoptrtrig=20
trdist=Trailing stop distance in pipstrdist=10
trstep=Pips needed to move trailing stoptrstep=5
betrig=Pips needed to activate breakevenbetrig=15
bedist=Breakeven distance in pipsbedist=2
comment=Comment for the tradecomment=Strategy1
pyEnable pyramid trading modepy
reEnable recovery modere
exopExit opposite positions only (no new trade if opposite positions exist)exop
exentExit opposite positions and enter new tradeexent
noexitDrop this strategy's position-close signals (closebuy, closesell, closeall) at the server; entries, reversals, and pending-order cancels still executenoexit

Explicit Parameter Types

Explicit parameter types give you complete control directly in your signal, without relying on EA input settings. Specify exactly how volume, SL/TP, and other values should be interpreted (in pips, currency, percentages, lots, or dollar amounts).

Why Use Explicit Types?

  • Signal-Level Control: Override EA settings per-signal. No need to change EA inputs for different strategies.
  • Multi-Strategy Support: Run multiple strategies with different risk profiles on the same EA instance.
  • Consistent Behavior: Ensure signals behave identically regardless of how the EA is configured.
  • Cross-Instrument Clarity: Eliminate pip vs point confusion when trading forex, indices, and commodities together.

Explicit Volume Parameters

New volume parameters with explicit type specification. Use these instead of the generic risk= parameter for precise control.

ParameterDescriptionExample
vol_lots=Direct lot sizevol_lots=0.5 (0.5 lots)
vol_pctbal=Lot size as % of balancevol_pctbal=1 (1% of balance in lots)
vol_pcteq=Lot size as % of equityvol_pcteq=1 (1% of equity in lots)
vol_dollar=Dollar risk amount (requires SL)vol_dollar=100 (risk $100)
vol_pctbal_loss=% of balance to lose at SL (requires SL)vol_pctbal_loss=1 (lose 1% at SL)
vol_pcteq_loss=% of equity to lose at SL (requires SL)vol_pcteq_loss=1 (lose 1% at SL)

Examples:

LicenseID,EURUSD,buy,vol_lots=0.5,sl=30,tp=60

Opens a buy order with exactly 0.5 lots.

LicenseID,XAUUSD,sell,vol_dollar=100,sl_points=15,tp_points=45

Opens a sell order risking exactly $100. Requires SL for position sizing calculation.

LicenseID,EURUSD,buy,vol_pctbal_loss=1,sl_pips=50,tp_pips=100

Opens a buy order sized so that a 50 pip SL loss equals 1% of account balance.

Error Handling

If you use a volume type that requires SL (vol_dollar, vol_pctbal_loss, vol_pcteq_loss) without providing an SL parameter, you'll receive error code 6013.

Explicit SL/TP Parameters

Specify exactly how your Stop Loss and Take Profit values should be interpreted.

Stop Loss Types

ParameterDescriptionExample
sl_pips=SL distance in pipssl_pips=25 (25 pips from entry)
sl_points=SL as direct price distance (currency)sl_points=10 (10.00 price distance, e.g., Gold: 2000→1990)
sl_percent=SL as % of current pricesl_percent=1 (1% from entry price)
sl_price=SL as absolute price levelsl_price=1.0800 (SL at exactly 1.0800)

Take Profit Types (Single Level)

ParameterDescriptionExample
tp_pips=TP distance in pipstp_pips=50 (50 pips from entry)
tp_points=TP as direct price distance (currency)tp_points=15 (15.00 price distance)
tp_percent=TP as % of current pricetp_percent=2 (2% from entry price)
tp_price=TP as absolute price leveltp_price=1.1200 (TP at exactly 1.1200)

Multi-Level Take Profit with Per-TP Types

Each TP level can have its own type, or inherit from the first TP level (tp1):

tp1_pips=50,tp2_percent=1,tp3_price=1.1500

TP1: 50 pips, TP2: 1% of price, TP3: exact price at 1.1500. Each with explicit type.

tp1_pips=50,tp2=100,tp3=150

TP1: 50 pips (explicit). TP2 and TP3 inherit "pips" type automatically.

Type Inheritance

When a TP level doesn't specify a type (e.g., tp2=100), it automatically inherits the type from tp1. This makes mixed signals cleaner and faster to write.

Explicit Pending Parameters

Specify exactly how your pending order entry level should be interpreted, directly in your signal.

ParameterDescriptionExample
entry_pips=Pending entry as pips from current priceentry_pips=20 (20 pips from current price)
entry_price=Pending entry as absolute price levelentry_price=1.1050 (entry at exactly 1.1050)
entry_percent=Pending entry as percent of current priceentry_percent=1 (entry 1% away from current)

Examples:

LicenseID,EURUSD,buystop,risk=0.01,entry_pips=20,sl=30,tp=50

Buy stop 20 pips above current price, regardless of EA setting.

LicenseID,EURUSD,buylimit,risk=0.01,entry_price=1.0950,sl_pips=30,tp_pips=60

Buy limit at exactly 1.0950, regardless of EA setting.

LicenseID,BTCUSD,buystop,risk=0.01,entry_percent=2,sl_percent=1,tp_percent=3

Buy stop entry that is exactly 2% above the current price.

Override EA Setting

Explicit pending parameters (entry_pips, entry_price, entry_percent) always override the EA's "Pending Order Entry" setting, giving you per-signal control. The legacy pending= parameter still respects the EA setting.

Explicit Trailing & Breakeven

Trailing stop and breakeven parameters support explicit type suffixes (_pips or _points) for consistent behavior across all instruments.

Trailing Stop Parameters

ParameterDescriptionExample
trtrig_pips= / trtrig_points=Profit distance to activate trailing stop (use points for currency)trtrig_pips=30 or trtrig_points=30
trdist_pips= / trdist_points=Distance to maintain between price and SL (use points for currency)trdist_pips=15 or trdist_points=15
trstep_pips= / trstep_points=Minimum movement before adjusting SL (use points for currency)trstep_pips=5 or trstep_points=5
trtrig_points=30,trdist=20,trstep=5

Trigger uses points for currency. trdist and trstep inherit the points type automatically.

Breakeven Parameters

ParameterDescriptionExample
betrig_pips= / betrig_points=Profit distance to activate breakeven (use points for currency)betrig_pips=20 or betrig_points=20
bedist_pips= / bedist_points=Distance to lock in above entry price (use points for currency)bedist_pips=2 or bedist_points=2
betrig_pips=20,bedist=2

Trigger uses explicit pips type. bedist inherits "pips" type automatically.

Type Inheritance

Just like multi-level TPs, trailing and breakeven parameters inherit their type from the trigger parameter. Set trtrig_pips or trtrig_points and trdist/trstep will use the same type. Set betrig_pips or betrig_points and bedist will inherit that type.

Examples:

LicenseID,EURUSD,buy,vol_lots=0.5,sl_pips=30,tp_pips=90,trtrig_pips=30,trdist=15,trstep=5

Forex trade with pips-based trailing: activates at 30 pips profit, trails at 15 pips distance.

LicenseID,US30,buy,vol_lots=0.5,sl_points=50,betrig_points=15,bedist=2

Index trade using points (currency) for breakeven. Distance inherits the points type.

Direct Price Distance

All _points parameters use the value directly as price distance. This provides accurate handling for indices and CFDs regardless of broker decimal precision.

Explicit Partial Close

New explicit partial close parameters remove ambiguity about whether you're closing a percentage or exact lots.

ParameterDescriptionExample
pct_lots=Explicit lot amount to closepct_lots=0.5 (close exactly 0.5 lots)
pct_percent=Explicit percentage to close (0.0–1.0)pct_percent=0.5 (close 50% of position)

Examples:

LicenseID,EURUSD,closebuy,pct_percent=0.5,comment=Strategy1

Closes 50% of buy positions with comment "Strategy1".

LicenseID,XAUUSD,closesell,pct_lots=0.25

Closes exactly 0.25 lots from sell positions.

Backward Compatibility

The original pct= parameter still works and follows the EA's "Partial Close Type" setting. Use the explicit pct_lots or pct_percent parameters when you need guaranteed behavior regardless of EA settings.

Order Types

TradeSgnl supports various order types for different trading scenarios.

Market Orders

Market order commands allow you to immediately enter or exit positions at current market prices.

buy (or long). Places a buy order at the current market price.

LicenseID,EURUSD,buy,risk=0.01

sell (or short). Places a sell order at the current market price.

LicenseID,EURUSD,sell,risk=0.01

closebuy (or closelong). Closes all buy positions for the specified symbol.

LicenseID,EURUSD,closebuy

closesell (or closeshort). Closes all sell positions for the specified symbol.

LicenseID,EURUSD,closesell

closeall. Closes all open positions for the specified symbol. Can optionally filter by comment to close only specific strategy positions.

LicenseID,EURUSD,closeall

With comment filter:

LicenseID,EURUSD,closeall,comment=Strategy1

When using closeall, only positions for the specified symbol will be closed. When combined with a comment filter, only positions matching BOTH the symbol AND comment will be closed.

Partial Close. Close a percentage of positions instead of the entire position. Use the pct= parameter with any close action.

LicenseID,EURUSD,closebuy,pct=0.5,comment=Strategy1

Partial Close Features

  • Interpretation Control: The EA's "Partial Close Type" setting (in Volume Settings) determines how the pct= value is interpreted (as percentage of position or as exact lots to close).
  • Percentage Mode: Use values between 0.0 and 1.0 (pct=0.5 closes 50% of position volume).
  • Lots Mode: Use exact lot values (pct=0.5 closes exactly 0.5 lots regardless of position size).
  • Volume Rounding: Volumes are rounded up to meet broker minimum requirements.
  • Comment Preservation: Remaining positions retain their original comments for future partial closes.
  • Multiple Partial Closes: You can send multiple partial close signals with the same comment.

Replace Orders

Replace orders allow you to close existing positions and immediately open new positions in a single signal. This includes both same-direction updates and trend reversal strategies.

Important

These commands first close all positions of a symbol with the specified direction (optionally filtered by comment), then immediately open a new position with the provided parameters.

If no existing positions are found to close, the command will still open the new position with the specified parameters. You can safely use these commands even when you're not sure if there are existing positions to close.

Reverse Direction Commands

closelongsell. Closes all long (buy) positions for the specified symbol (optionally filtered by comment), then opens a new sell (short) position using the provided parameters.

LicenseID,GBPUSD,closelongsell,risk=0.02,sl=40,tp=80,comment=Strategy2

closeshortbuy. Closes all short (sell) positions for the specified symbol (optionally filtered by comment), then opens a new buy position using the provided parameters.

LicenseID,EURUSD,closeshortbuy,risk=0.01,sl=30,tp=50,comment=Strategy1

Same Direction Commands

closelongbuy. Closes all long (buy) positions for the specified symbol (optionally filtered by comment), then opens a new buy position using the provided parameters.

LicenseID,EURUSD,closelongbuy,risk=0.01,sl=30,tp=50,comment=Strategy1

closeshortsell. Closes all short (sell) positions for the specified symbol (optionally filtered by comment), then opens a new sell (short) position using the provided parameters.

LicenseID,GBPUSD,closeshortsell,risk=0.02,sl=40,tp=80,comment=Strategy2

Comment Filtering

When using the comment parameter, only positions with the matching comment will be closed. If no comment is provided, all positions of that symbol with the specified direction will be closed.

Common Trading Scenarios

  • Trend Reversal Strategy: Use closelongsell or closeshortbuy when your strategy signals a trend reversal.
  • Position Management: Use closelongbuy or closeshortsell to update existing positions with new parameters without manually closing first.
  • Risk Management: These commands are particularly useful for automated strategies that need to quickly adapt to changing market conditions.

Pending Orders

Pending order commands allow you to set orders that will be executed when price reaches a specific level.

buystop. Places a buy stop order above the current market price. The pending= parameter is required.

LicenseID,EURUSD,buystop,risk=0.01,pending=20,sl=30,tp=50

buylimit. Places a buy limit order below the current market price. The pending= parameter is required.

LicenseID,EURUSD,buylimit,risk=0.01,pending=20,sl=30,tp=50

sellstop. Places a sell stop order below the current market price. The pending= parameter is required.

LicenseID,EURUSD,sellstop,risk=0.01,pending=20,sl=30,tp=50

selllimit. Places a sell limit order above the current market price. The pending= parameter is required.

LicenseID,EURUSD,selllimit,risk=0.01,pending=20,sl=30,tp=50

pending=. Required parameter for all pending orders. Specifies the price level for the pending order.

LicenseID,EURUSD,buystop,risk=0.01,pending=20

Pending Order Entry Setting

The interpretation of the pending parameter depends on the "Pending Order Entry" setting in the EA:

  • Pips From Current: The value is treated as the number of pips away from current price.
  • Absolute Price: The value is treated as the exact price level for the order.
  • Percent of Price: The value is treated as a percentage offset from the current price.

Auto-Correction: When using absolute price for pending orders, the EA will automatically correct mismatched order types (e.g., converting a buystop to a buylimit if the specified price is below the current market price).

cancellong. Cancels all pending buy orders (buystop and buylimit) for the specified symbol.

LicenseID,EURUSD,cancellong

cancelshort. Cancels all pending sell orders (sellstop and selllimit) for the specified symbol.

LicenseID,EURUSD,cancelshort

Advanced Features

Advanced parameters that enhance your trading signals with features like trailing stops, breakeven levels, and more.

Feature Control Settings

Advanced features can be controlled by either signals or EA settings.

FeatureEA SettingSignal Parameter
Trailing StopTrailing Mode: Disabled/Enabled/Signaltrtrig, trdist, trstep (requires Signal mode in EA)
Pyramid TradingPyramid Mode: Disabled/Enabled/Signalpy (requires Signal mode in EA)
Recovery SystemRecovery Mode: Disabled/Enabled/Signalre (requires Signal mode in EA)

Important

For any feature to be controlled via signal parameters, the corresponding EA setting MUST be set to "Signal". Otherwise, the signal parameters for these features will be ignored.

Trailing Stop

Add trailing stop functionality to your trades using these parameters together.

LicenseID,EURUSD,buy,risk=0.01,sl=30,tp=50,trtrig=20,trdist=10,trstep=5
  • trtrig=. Trailing stop will be activated after the trade gains this number of pips. For example, with trtrig=20, the trailing stop will activate after price moves 20 pips in your favor.
  • trdist=. Distance in pips to maintain between the current price and the trailing stop. For example, with trdist=10, the stop loss will be placed 10 pips away from the current price.
  • trstep=. Minimum price movement in pips required to adjust the trailing stop. For example, with trstep=5, the stop loss will only move after the price moves at least 5 pips.

Breakeven

Automatically move your stop loss to breakeven level when price reaches a certain point.

LicenseID,EURUSD,buy,risk=0.01,sl=30,tp=50,betrig=15,bedist=2
  • betrig=. Breakeven will be activated after the trade gains this number of pips. For example, with betrig=15, the breakeven will activate after price moves 15 pips in your favor.
  • bedist=. Distance in pips from the entry price to place the stop loss after breakeven is triggered. With bedist=2, the stop loss will be placed 2 pips in profit from your entry.

Pyramid Trading

Configure pyramid trading strategies with multiple entries.

LicenseID,BTCUSD,buy,risk=0.01,sl=500,tp=2000,py
  • py. Flag to enable pyramid trading mode. Requires the EA to have the Pyramid Mode set to "Signal" in settings. All pyramid configuration settings are controlled from the EA.

Recovery Mode

Enable recovery system for managing losing positions.

LicenseID,EURUSD,buy,risk=0.01,sl=30,tp=50,re
  • re. Flag to enable the recovery system. Requires the EA to have the Recovery Mode set to "Signal" in settings. All recovery configuration settings are controlled from the EA.

Exit Opposite Positions (ExOp)

Smart position management that closes opposite positions or opens new trades based on market conditions.

LicenseID,EURUSD,buy,risk=0.01,sl=30,tp=50,exop
  • exop. Flag that modifies trade behavior: if opposite positions exist for the symbol/comment, close them and don't execute the new trade. If no opposite positions exist, execute the trade normally.

How it works:

  • Buy signal with exop: If sell positions exist, close sells and no buy is executed. If no sells exist, execute buy normally.

Use Cases

  • Trend Reversal: Close counter-trend positions when trend changes, only open a new position if market is clean.
  • Risk Management: Avoid adding to drawdown by only trading when there are no opposing positions.
  • Strategy Filtering: Works with comment filtering to manage specific strategy positions only.

Exit and Enter (ExEnt)

Advanced position management that closes opposite positions and immediately opens new trades in the signal direction.

LicenseID,EURUSD,buy,risk=0.01,sl=30,tp=50,exent
  • exent. Flag that modifies trade behavior: if opposite positions exist for the symbol/comment, close them and then execute the new trade. If no opposite positions exist, execute the trade normally.

How it works:

  • Buy signal with exent: If sell positions exist, close sells, then execute buy. If no sells exist, execute buy normally.

Key Differences from ExOp:

  • ExOp: Closes opposite positions, then stops (no new trade opened).
  • ExEnt: Closes opposite positions, then continues to open the new trade.

Use Cases

  • Trend Reversal: Automatically flip from long to short (or vice versa) when market conditions change.
  • Strategy Switching: Close positions from one strategy and immediately enter with a new strategy.
  • Risk Management: Ensure you're always positioned in the current trend direction.
  • Automated Trading: Perfect for algorithmic strategies that need to switch directions quickly.

Ignore Exit Signals (NoExit)

Per-strategy server-side filter that drops position-close signals before they reach the EA. Other strategies on the same license are unaffected.

LicenseID,EURUSD,buy,risk=0.01,sl=30,tp=50,noexit
  • noexit. Flag added to a strategy's alert message. The server rejects resolved position-close actions (closebuy, closesell, closeall) before forwarding to the EA. Entries, reversals (closelongbuy, closeshortsell, etc.), and pending-order cancels (cancellong, cancelshort) pass through unchanged. They have different fallback semantics and are out of scope for this filter. Rejections show as rejected status (orange) in the signal history with error code 7020 for audit. Because the rejection is user-configured rather than a system failure, no email/telegram notification is sent.

Enabling NoExit: Toggle Ignore Exit Signals in the Syntax Generator next to Exit on Opposite / Exit on Entry, then recopy the alert message into TradingView.

Use Cases

  • Manual Exit Management: Take the strategy's entries but close trades via the EA's built-in TP/SL/trailing logic.
  • Stricter Risk Management: Override the strategy's exit logic with the EA's session-end, drawdown, or news-filter rules.
  • Hybrid Strategies: Combine entries from one strategy with exits driven by a different system.

Multi-Level Take Profit

Scale out of positions at multiple price levels with automatic partial close execution. Set unlimited TP levels (tp1, tp2, tp3, tp4, tp5, ...) with optional partial close percentages for each level.

LicenseID,EURUSD,buy,risk=0.01,sl=30,tp1=50,pct1=0.5,tp2=100,pct2=0.3,tp3=150,tp4=200
  • tp1=, tp2=, tp3=, tp4=, .... Define unlimited take profit levels in pips (or points if enabled). Each level represents a price target where the EA will take action.
  • pct1=, pct2=, pct3=, pct4=, .... Optional partial close percentage for each TP level (values between 0.0 and 1.0). For example, pct1=0.5 will close 50% of the position when tp1 is reached. If omitted, smart defaults are used automatically.

How it works:

  • Intermediate Levels: When price reaches tp1, tp2, tp3, etc., the EA executes a partial close using the specified pct value.
  • Final TP Level: The last TP level always uses MT5's native TP (closes all remaining position).
  • Automatic Updates: After each partial close, the position's TP is automatically updated to the next level.
  • Unlimited Support: You can set as many TP levels as your strategy requires.

Smart Defaults:

  • 2 TP Levels: If pct values are omitted, first TP closes 50%, second closes remaining 50%.
  • 3 TP Levels: If pct values are omitted, first TP closes 33%, second closes 50%, third closes remaining.
  • 4+ TP Levels: Smart defaults divide positions equally among intermediate levels, with the final level using MT5's native TP.

Example Scenarios

  • Conservative Scaling: tp1=30,pct1=0.3,tp2=60,pct2=0.3,tp3=100 (take 30% profit twice, let final 40% ride).
  • Aggressive Scaling: tp1=20,pct1=0.7,tp2=50,pct2=0.2,tp3=100 (secure 70% early, small runner).
  • Simple Two-Level: tp1=50,tp2=100 (uses smart defaults: 50% at each level).

Point-Based Values (For Indices & CFDs)

Use point-based values instead of pips for instruments like indices, commodities, and crypto. Perfect for US30, NAS100, DAX40, Gold, etc.

EA Setting Required: In EA General Settings, enable "Use Points Instead of Pips" to activate this feature.

With Feature Enabled:

LicenseID,US30,buy,risk=0.25,sl=100,tp=200,comment=US30_Strategy

This signal will set SL at exactly 100 points (100.0 price distance) and TP at 200 points (200.0 price distance). No calculations needed.

How it works:

  • Traditional Mode (disabled): Values interpreted as "pips" with broker-specific multipliers.
  • Point Mode (enabled): Signal value directly represents price distance. Works for any broker decimal format.
  • Example: sl=100 with point mode equals exactly 100 points stop loss, regardless of broker.

Why Use Point Mode?

  • Intuitive for Indices: Think in points (100 points on US30) not pips.
  • No Calculations: Enter values exactly as you think about them.
  • Broker Independent: Works with any broker's decimal format (1, 2, or 3 decimals).
  • Perfect For: US30, NAS100, DAX40, SPX500, Gold, Silver, Oil, Crypto.

This feature affects ALL TP/SL values in signals (tp, tp1, tp2, tp3, sl, pending). Once enabled, all values are interpreted as points/price distance instead of pips.

Signal Examples

Examples of different signal formats for various trading scenarios.

Basic Orders

Market Buy Order. Simple buy order for EURUSD with 0.01 lots.

LicenseID,EURUSD,buy,risk=0.01

Market Sell Order. Simple sell order for GBPUSD with 0.01 lots.

LicenseID,GBPUSD,sell,risk=0.01

Buy with Stop-Loss and Take-Profit. Buy order with 30 pips stop-loss and 50 pips take-profit.

LicenseID,EURUSD,buy,risk=0.01,sl=30,tp=50

Buy Order with Comment. Buy order with stop-loss, take-profit, and strategy comment.

LicenseID,EURUSD,buy,risk=0.01,sl=30,tp=50,comment=Strategy1

Closing Positions

Close Specific Position Type. Close all buy positions for EURUSD.

LicenseID,EURUSD,closebuy

Close All Positions. Close all open positions for EURUSD.

LicenseID,EURUSD,closeall

Close All Positions with Comment. Close all EURUSD positions that have the comment "Strategy1".

LicenseID,EURUSD,closeall,comment=Strategy1

Partial Close 50% of Positions. Close 50% of buy positions with comment "Strategy1" (Percentage mode) or close exactly 0.5 lots (Lots mode).

LicenseID,EURUSD,closebuy,pct=0.5,comment=Strategy1

Partial Close 25% of All Positions. Close 25% of all open positions for EURUSD (Percentage mode) or close exactly 0.25 lots per EURUSD position (Lots mode).

LicenseID,EURUSD,closeall,pct=0.25

Replace Orders

Close Long Then Open Buy. Closes all long positions, then opens a new buy with provided parameters.

LicenseID,EURUSD,closelongbuy,risk=0.01,sl=30,tp=50,comment=Strategy1

Close Short Then Open Sell. Closes all short positions, then opens a new sell with provided parameters.

LicenseID,GBPUSD,closeshortsell,risk=0.02,sl=40,tp=80,comment=Strategy2

Close Long Then Open Sell. Closes all long positions, then opens a new sell with provided parameters.

LicenseID,EURUSD,closelongsell,risk=0.01,sl=25,tp=45,comment=Strategy3

Close Short Then Open Buy. Closes all short positions, then opens a new buy with provided parameters.

LicenseID,GBPUSD,closeshortbuy,risk=0.02,sl=35,tp=70,comment=Strategy4

Pending Orders

Buy Stop Pending Order. Buy stop order 20 pips above current price.

LicenseID,EURUSD,buystop,risk=0.01,pending=20,sl=30,tp=50

Buy Limit Pending Order. Buy limit order 20 pips below current price.

LicenseID,EURUSD,buylimit,risk=0.01,pending=20,sl=30,tp=50

Sell Stop Pending Order. Sell stop order 25 pips below current price.

LicenseID,GBPUSD,sellstop,risk=0.02,pending=25,sl=40,tp=80

Sell Limit Pending Order. Sell limit order 25 pips above current price.

LicenseID,GBPUSD,selllimit,risk=0.02,pending=25,sl=40,tp=80

Cancel Pending Buy Orders. Cancel all pending buy orders (buystop and buylimit) for EURUSD.

LicenseID,EURUSD,cancellong

Cancel Pending Sell Orders. Cancel all pending sell orders (sellstop and selllimit) for EURUSD.

LicenseID,EURUSD,cancelshort

Advanced Examples

Multi-Level Take Profit. Buy order with 3 TP levels: close 50% at 50 pips, 30% at 100 pips, remaining at 150 pips.

LicenseID,EURUSD,buy,risk=0.01,sl=30,tp1=50,pct1=0.5,tp2=100,pct2=0.3,tp3=150

Multi-TP with Smart Defaults. Buy order with 2 TP levels using smart defaults (50% at first TP, 50% at second).

LicenseID,EURUSD,buy,risk=0.01,sl=30,tp1=50,tp2=100

Mixed TP Types. TP1: 10 currency, TP2: 1% of price, TP3: inherits currency type from tp1.

LicenseID,XAUUSD,buy,vol_lots=0.1,tp1_points=10,tp2_percent=1,tp3=20

Dollar Risk with Currency. Risks $100, SL at 15.00 price distance, TP at 45.00 price distance.

LicenseID,XAUUSD,sell,vol_dollar=100,sl_points=15,tp_points=45

Percentage-Based Risk. Risks 1% of balance at 50 pip SL with explicit pips type.

LicenseID,EURUSD,buy,vol_pctbal_loss=1,sl_pips=50,tp_pips=100

With Trailing Stop. Buy order with trailing stop that activates after 30 pips in profit.

LicenseID,USDJPY,buy,risk=0.05,sl=20,tp=60,trtrig=30,trdist=15,trstep=3

Trailing Stop with Currency. Index trade with explicit currency-based trailing stop activation and distance.

LicenseID,US30,buy,vol_lots=0.5,sl_points=50,tp_points=150,trtrig_points=30,trdist_points=20

Breakeven Example. Buy order with breakeven that activates after 20 pips in profit.

LicenseID,EURUSD,buy,risk=0.01,sl=30,tp=60,betrig=20,bedist=2

Pyramid Trading Strategy. Buy order with pyramid trading enabled, allowing up to 3 entries.

LicenseID,BTCUSD,buy,risk=0.01,sl=500,tp=2000,py

Recovery Mode. Buy order with recovery mode enabled.

LicenseID,EURUSD,buy,risk=0.01,sl=30,tp=50,re

Exit Opposite Positions. If sell positions exist, close them only. If no sell positions, execute the buy order normally.

LicenseID,EURUSD,buy,risk=0.01,sl=30,tp=50,exop

Exit and Enter. Close any sell positions and then execute the buy order (reversal strategy).

LicenseID,EURUSD,buy,risk=0.01,sl=30,tp=50,exent

Ignore Exit Signals. Strategy entries fire normally; position-close actions from this strategy are dropped server-side before reaching the EA.

LicenseID,EURUSD,buy,risk=0.01,sl=30,tp=50,noexit

Parameter Processing Rules

When processing signals, the TradeSgnl EA follows these rules.

Symbol Names

Symbol names in signals must match exactly with the symbol names in your MT5 terminal. For example, if your broker uses "EURUSD.a" in Market Watch, your signal must use the same format.

LicenseID,EURUSD.a,buy,risk=0.01

Symbol Mapping

Alternatively, you can use our Symbol Mapping feature to map symbol names to the correct broker-specific symbols.

Learn about Symbol Mapping

Risk-Based Sizing

When using percentage-based risk (e.g., risk=1), the lot size is calculated as a percentage of your account balance or equity, depending on the EA's settings. The sl= parameter is not required for this calculation.

Example

With risk=1 on a $10,000 account, a 1 lot position will be opened (0.1 lot for a $1,000 account, or 10 lots for a $100,000 account).

Valid Action Types

The EA supports the following action types in signals.

CategoryAction TypesDescription
Market Ordersbuy, long, sell, shortImmediate market entry orders
Closing Positionsclosebuy, closelong, closesell, closeshort, closeallClose existing positions by type or all positions (supports partial closes with pct=)
Replace Orderscloselongbuy, closelongsell, closeshortbuy, closeshortsellClose one side and immediately open the specified direction with given parameters
Pending Ordersbuystop, buylimit, sellstop, selllimitOrders that execute at specified price levels
Cancel Orderscancellong, cancelshortCancel pending orders by type

Signal Format Cheat Sheet

A comprehensive quick reference for all signal formats. Use this as your go-to cheat sheet for creating trading signals.

ActionFormat
Market BuyLicenseID,SYMBOL,buy,risk=VOLUME
Market SellLicenseID,SYMBOL,sell,risk=VOLUME
Buy with SL/TPLicenseID,SYMBOL,buy,risk=VOLUME,sl=PIPS,tp=PIPS
Sell with SL/TPLicenseID,SYMBOL,sell,risk=VOLUME,sl=PIPS,tp=PIPS
Buy StopLicenseID,SYMBOL,buystop,risk=VOLUME,pending=PIPS
Buy LimitLicenseID,SYMBOL,buylimit,risk=VOLUME,pending=PIPS
Sell StopLicenseID,SYMBOL,sellstop,risk=VOLUME,pending=PIPS
Sell LimitLicenseID,SYMBOL,selllimit,risk=VOLUME,pending=PIPS
Close Buy PositionsLicenseID,SYMBOL,closebuy
Close Sell PositionsLicenseID,SYMBOL,closesell
Close All PositionsLicenseID,SYMBOL,closeall
Close All with CommentLicenseID,SYMBOL,closeall,comment=STRATEGY
Partial Close 50%LicenseID,SYMBOL,closebuy,pct=0.5,comment=STRATEGY
Partial Close All 25%LicenseID,SYMBOL,closeall,pct=0.25
Close Long Then BuyLicenseID,SYMBOL,closelongbuy,risk=VOLUME,sl=PIPS,tp=PIPS,comment=STRATEGY
Close Long Then SellLicenseID,SYMBOL,closelongsell,risk=VOLUME,sl=PIPS,tp=PIPS,comment=STRATEGY
Close Short Then BuyLicenseID,SYMBOL,closeshortbuy,risk=VOLUME,sl=PIPS,tp=PIPS,comment=STRATEGY
Close Short Then SellLicenseID,SYMBOL,closeshortsell,risk=VOLUME,sl=PIPS,tp=PIPS,comment=STRATEGY
Buy with Trailing StopLicenseID,SYMBOL,buy,risk=VOLUME,trtrig=PIPS,trdist=PIPS,trstep=PIPS
Sell with Trailing StopLicenseID,SYMBOL,sell,risk=VOLUME,trtrig=PIPS,trdist=PIPS,trstep=PIPS
Buy with BreakevenLicenseID,SYMBOL,buy,risk=VOLUME,betrig=PIPS,bedist=PIPS
Sell with BreakevenLicenseID,SYMBOL,sell,risk=VOLUME,betrig=PIPS,bedist=PIPS
Cancel Pending Buy OrdersLicenseID,SYMBOL,cancellong
Cancel Pending Sell OrdersLicenseID,SYMBOL,cancelshort
Pyramid TradingLicenseID,SYMBOL,buy,risk=VOLUME,py
Recovery ModeLicenseID,SYMBOL,buy,risk=VOLUME,re
Exit Opposite PositionsLicenseID,SYMBOL,buy,risk=VOLUME,exop
Exit and EnterLicenseID,SYMBOL,buy,risk=VOLUME,exent
Ignore Exit SignalsLicenseID,SYMBOL,buy,risk=VOLUME,noexit
Percentage RiskLicenseID,SYMBOL,buy,risk=PERCENTAGE
With CommentLicenseID,SYMBOL,buy,risk=VOLUME,comment=STRATEGY

Pro Tip

Use these formats as templates for your TradingView alerts or webhook configurations. Replace the placeholder values (LicenseID, SYMBOL, VOLUME, PIPS, etc.) with your actual values.

On this page