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.
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.
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:
- LicenseID. Your unique license identifier (e.g.,
LicenseID) - Symbol. The trading instrument (e.g.,
EURUSD,BTCUSD) - Action. The trading action (
buy,sell,buystop, etc.) - Volume. Trading size with
risk=prefix (e.g.,risk=0.01) - 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.
| Parameter | Description | Example |
|---|---|---|
sl= | Stop Loss in pips (or currency if enabled) from entry price | sl=50 |
tp= | Take Profit in pips (or currency if enabled) from entry price | tp=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 stop | trtrig=20 |
trdist= | Trailing stop distance in pips | trdist=10 |
trstep= | Pips needed to move trailing stop | trstep=5 |
betrig= | Pips needed to activate breakeven | betrig=15 |
bedist= | Breakeven distance in pips | bedist=2 |
comment= | Comment for the trade | comment=Strategy1 |
py | Enable pyramid trading mode | py |
re | Enable recovery mode | re |
exop | Exit opposite positions only (no new trade if opposite positions exist) | exop |
exent | Exit opposite positions and enter new trade | exent |
noexit | Drop this strategy's position-close signals (closebuy, closesell, closeall) at the server; entries, reversals, and pending-order cancels still execute | noexit |
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.
| Parameter | Description | Example |
|---|---|---|
vol_lots= | Direct lot size | vol_lots=0.5 (0.5 lots) |
vol_pctbal= | Lot size as % of balance | vol_pctbal=1 (1% of balance in lots) |
vol_pcteq= | Lot size as % of equity | vol_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=60Opens a buy order with exactly 0.5 lots.
LicenseID,XAUUSD,sell,vol_dollar=100,sl_points=15,tp_points=45Opens a sell order risking exactly $100. Requires SL for position sizing calculation.
LicenseID,EURUSD,buy,vol_pctbal_loss=1,sl_pips=50,tp_pips=100Opens 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
| Parameter | Description | Example |
|---|---|---|
sl_pips= | SL distance in pips | sl_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 price | sl_percent=1 (1% from entry price) |
sl_price= | SL as absolute price level | sl_price=1.0800 (SL at exactly 1.0800) |
Take Profit Types (Single Level)
| Parameter | Description | Example |
|---|---|---|
tp_pips= | TP distance in pips | tp_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 price | tp_percent=2 (2% from entry price) |
tp_price= | TP as absolute price level | tp_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.1500TP1: 50 pips, TP2: 1% of price, TP3: exact price at 1.1500. Each with explicit type.
tp1_pips=50,tp2=100,tp3=150TP1: 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.
| Parameter | Description | Example |
|---|---|---|
entry_pips= | Pending entry as pips from current price | entry_pips=20 (20 pips from current price) |
entry_price= | Pending entry as absolute price level | entry_price=1.1050 (entry at exactly 1.1050) |
entry_percent= | Pending entry as percent of current price | entry_percent=1 (entry 1% away from current) |
Examples:
LicenseID,EURUSD,buystop,risk=0.01,entry_pips=20,sl=30,tp=50Buy 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=60Buy limit at exactly 1.0950, regardless of EA setting.
LicenseID,BTCUSD,buystop,risk=0.01,entry_percent=2,sl_percent=1,tp_percent=3Buy 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
| Parameter | Description | Example |
|---|---|---|
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=5Trigger uses points for currency. trdist and trstep inherit the points type automatically.
Breakeven Parameters
| Parameter | Description | Example |
|---|---|---|
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=2Trigger 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=5Forex 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=2Index 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.
| Parameter | Description | Example |
|---|---|---|
pct_lots= | Explicit lot amount to close | pct_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=Strategy1Closes 50% of buy positions with comment "Strategy1".
LicenseID,XAUUSD,closesell,pct_lots=0.25Closes 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.01sell (or short). Places a sell order at the current market price.
LicenseID,EURUSD,sell,risk=0.01closebuy (or closelong). Closes all buy positions for the specified symbol.
LicenseID,EURUSD,closebuyclosesell (or closeshort). Closes all sell positions for the specified symbol.
LicenseID,EURUSD,closesellcloseall. Closes all open positions for the specified symbol. Can optionally filter by comment to close only specific strategy positions.
LicenseID,EURUSD,closeallWith comment filter:
LicenseID,EURUSD,closeall,comment=Strategy1When 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=Strategy1Partial 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.5closes 50% of position volume). - Lots Mode: Use exact lot values (
pct=0.5closes 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=Strategy2closeshortbuy. 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=Strategy1Same 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=Strategy1closeshortsell. 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=Strategy2Comment 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
closelongsellorcloseshortbuywhen your strategy signals a trend reversal. - Position Management: Use
closelongbuyorcloseshortsellto 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=50buylimit. 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=50sellstop. 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=50selllimit. 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=50pending=. Required parameter for all pending orders. Specifies the price level for the pending order.
LicenseID,EURUSD,buystop,risk=0.01,pending=20Pending 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,cancellongcancelshort. Cancels all pending sell orders (sellstop and selllimit) for the specified symbol.
LicenseID,EURUSD,cancelshortAdvanced 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.
| Feature | EA Setting | Signal Parameter |
|---|---|---|
| Trailing Stop | Trailing Mode: Disabled/Enabled/Signal | trtrig, trdist, trstep (requires Signal mode in EA) |
| Pyramid Trading | Pyramid Mode: Disabled/Enabled/Signal | py (requires Signal mode in EA) |
| Recovery System | Recovery Mode: Disabled/Enabled/Signal | re (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=5trtrig=. Trailing stop will be activated after the trade gains this number of pips. For example, withtrtrig=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, withtrdist=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, withtrstep=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=2betrig=. Breakeven will be activated after the trade gains this number of pips. For example, withbetrig=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. Withbedist=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,pypy. 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,rere. 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,exopexop. 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,exentexent. 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,noexitnoexit. 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=200tp1=, 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.5will close 50% of the position whentp1is 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 specifiedpctvalue. - 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_StrategyThis 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=100with 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.01Market Sell Order. Simple sell order for GBPUSD with 0.01 lots.
LicenseID,GBPUSD,sell,risk=0.01Buy 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=50Buy Order with Comment. Buy order with stop-loss, take-profit, and strategy comment.
LicenseID,EURUSD,buy,risk=0.01,sl=30,tp=50,comment=Strategy1Closing Positions
Close Specific Position Type. Close all buy positions for EURUSD.
LicenseID,EURUSD,closebuyClose All Positions. Close all open positions for EURUSD.
LicenseID,EURUSD,closeallClose All Positions with Comment. Close all EURUSD positions that have the comment "Strategy1".
LicenseID,EURUSD,closeall,comment=Strategy1Partial 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=Strategy1Partial 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.25Replace 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=Strategy1Close 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=Strategy2Close 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=Strategy3Close 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=Strategy4Pending Orders
Buy Stop Pending Order. Buy stop order 20 pips above current price.
LicenseID,EURUSD,buystop,risk=0.01,pending=20,sl=30,tp=50Buy Limit Pending Order. Buy limit order 20 pips below current price.
LicenseID,EURUSD,buylimit,risk=0.01,pending=20,sl=30,tp=50Sell Stop Pending Order. Sell stop order 25 pips below current price.
LicenseID,GBPUSD,sellstop,risk=0.02,pending=25,sl=40,tp=80Sell Limit Pending Order. Sell limit order 25 pips above current price.
LicenseID,GBPUSD,selllimit,risk=0.02,pending=25,sl=40,tp=80Cancel Pending Buy Orders. Cancel all pending buy orders (buystop and buylimit) for EURUSD.
LicenseID,EURUSD,cancellongCancel Pending Sell Orders. Cancel all pending sell orders (sellstop and selllimit) for EURUSD.
LicenseID,EURUSD,cancelshortAdvanced 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=150Multi-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=100Mixed 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=20Dollar 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=45Percentage-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=100With 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=3Trailing 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=20Breakeven 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=2Pyramid Trading Strategy. Buy order with pyramid trading enabled, allowing up to 3 entries.
LicenseID,BTCUSD,buy,risk=0.01,sl=500,tp=2000,pyRecovery Mode. Buy order with recovery mode enabled.
LicenseID,EURUSD,buy,risk=0.01,sl=30,tp=50,reExit 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,exopExit and Enter. Close any sell positions and then execute the buy order (reversal strategy).
LicenseID,EURUSD,buy,risk=0.01,sl=30,tp=50,exentIgnore 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,noexitParameter 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.01Symbol Mapping
Alternatively, you can use our Symbol Mapping feature to map symbol names to the correct broker-specific symbols.
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.
| Category | Action Types | Description |
|---|---|---|
| Market Orders | buy, long, sell, short | Immediate market entry orders |
| Closing Positions | closebuy, closelong, closesell, closeshort, closeall | Close existing positions by type or all positions (supports partial closes with pct=) |
| Replace Orders | closelongbuy, closelongsell, closeshortbuy, closeshortsell | Close one side and immediately open the specified direction with given parameters |
| Pending Orders | buystop, buylimit, sellstop, selllimit | Orders that execute at specified price levels |
| Cancel Orders | cancellong, cancelshort | Cancel 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.
| Action | Format |
|---|---|
| Market Buy | LicenseID,SYMBOL,buy,risk=VOLUME |
| Market Sell | LicenseID,SYMBOL,sell,risk=VOLUME |
| Buy with SL/TP | LicenseID,SYMBOL,buy,risk=VOLUME,sl=PIPS,tp=PIPS |
| Sell with SL/TP | LicenseID,SYMBOL,sell,risk=VOLUME,sl=PIPS,tp=PIPS |
| Buy Stop | LicenseID,SYMBOL,buystop,risk=VOLUME,pending=PIPS |
| Buy Limit | LicenseID,SYMBOL,buylimit,risk=VOLUME,pending=PIPS |
| Sell Stop | LicenseID,SYMBOL,sellstop,risk=VOLUME,pending=PIPS |
| Sell Limit | LicenseID,SYMBOL,selllimit,risk=VOLUME,pending=PIPS |
| Close Buy Positions | LicenseID,SYMBOL,closebuy |
| Close Sell Positions | LicenseID,SYMBOL,closesell |
| Close All Positions | LicenseID,SYMBOL,closeall |
| Close All with Comment | LicenseID,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 Buy | LicenseID,SYMBOL,closelongbuy,risk=VOLUME,sl=PIPS,tp=PIPS,comment=STRATEGY |
| Close Long Then Sell | LicenseID,SYMBOL,closelongsell,risk=VOLUME,sl=PIPS,tp=PIPS,comment=STRATEGY |
| Close Short Then Buy | LicenseID,SYMBOL,closeshortbuy,risk=VOLUME,sl=PIPS,tp=PIPS,comment=STRATEGY |
| Close Short Then Sell | LicenseID,SYMBOL,closeshortsell,risk=VOLUME,sl=PIPS,tp=PIPS,comment=STRATEGY |
| Buy with Trailing Stop | LicenseID,SYMBOL,buy,risk=VOLUME,trtrig=PIPS,trdist=PIPS,trstep=PIPS |
| Sell with Trailing Stop | LicenseID,SYMBOL,sell,risk=VOLUME,trtrig=PIPS,trdist=PIPS,trstep=PIPS |
| Buy with Breakeven | LicenseID,SYMBOL,buy,risk=VOLUME,betrig=PIPS,bedist=PIPS |
| Sell with Breakeven | LicenseID,SYMBOL,sell,risk=VOLUME,betrig=PIPS,bedist=PIPS |
| Cancel Pending Buy Orders | LicenseID,SYMBOL,cancellong |
| Cancel Pending Sell Orders | LicenseID,SYMBOL,cancelshort |
| Pyramid Trading | LicenseID,SYMBOL,buy,risk=VOLUME,py |
| Recovery Mode | LicenseID,SYMBOL,buy,risk=VOLUME,re |
| Exit Opposite Positions | LicenseID,SYMBOL,buy,risk=VOLUME,exop |
| Exit and Enter | LicenseID,SYMBOL,buy,risk=VOLUME,exent |
| Ignore Exit Signals | LicenseID,SYMBOL,buy,risk=VOLUME,noexit |
| Percentage Risk | LicenseID,SYMBOL,buy,risk=PERCENTAGE |
| With Comment | LicenseID,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.
Syntax Generator
Build TradeSgnl signals visually without typing JSON or alert syntax. Configure entries, exits, stops, multi-level take profits, and advanced features through a guided form. Includes Test Signal verification, saved presets, and three output modes for TradingView.
Signal Authentication
Learn how to configure secure signal authentication for TradeSgnl. Protect your trading signals with authentication tokens and webhook security.