Strategy Comments
How the comment parameter groups trades into strategies, which EA features it scopes, and why some signal flags stick to the whole group.
The comment= parameter is the most important optional parameter in a TradeSgnl signal. It is not a note or a label. It is the key the EA uses to group your trades into a strategy, and almost every advanced feature operates on that group rather than on individual trades.
One line summary
Trades on the same symbol that share a comment are one strategy. Different comments, or the same comment on a different symbol, are separate strategies that never interfere with each other. Trades with no comment fall into one unnamed strategy per symbol.
Why the comment matters
Without a comment, every trade the EA receives on a symbol lands in one shared bucket. A close signal from strategy A closes strategy B's positions. Pyramid targets are calculated across unrelated trades. Direction Lock rejects a valid short because an unrelated long is open.
Give each strategy its own comment and all of that isolation happens automatically.
Grouping
Trades sharing a symbol and comment are managed as one coordinated position: shared pyramid target, shared hedge decision, shared level counter.
Filtering
Close, partial close, reversal, and cancel actions only touch positions whose comment matches the one in the signal.
Isolation
Multiple strategies run on one account and one EA instance without stepping on each other.
Setting the comment
In the Syntax Generator, fill the Comment field at the top of the form next to License and Symbol. It is written into every signal the generator produces.
Open the Syntax Generator guideBy hand, add comment= anywhere in the parameter list:
LicenseID,EURUSD,buy,risk=0.01,sl=50,tp=100,comment=TrendStrategyNaming rules
| Rule | Why |
|---|---|
| Matching is exact and case sensitive | TrendStrategy and trendstrategy are two different strategies. A stray space or a typo silently creates a second group. |
| No spaces around the value | Parameters are split on commas with no spaces. comment= My Strategy will not match comment=MyStrategy. |
| Keep it short | MT5 truncates order comments at around 31 characters, and some brokers rewrite them entirely. After an EA restart the EA rebuilds groups by reading comments back from open positions, so a truncated comment can split one strategy into two. |
Avoid _Hedge and Recovery | Both are reserved. The EA appends _Hedge to hedge positions and Recovery to recovery positions, and it skips any group whose comment contains either string when deciding whether to open a hedge. A comment like Recovery_Grid will never be hedge protected. |
The symbol is part of the key
A strategy group is identified by symbol plus comment, not by the comment on its own. Running comment=Scalper on both EURUSD and GBPUSD gives you two independent groups: separate pyramid targets, separate level counters, separate hedge decisions, and a EURUSD close signal never touches the GBPUSD positions.
That means reusing one comment across symbols is safe. Distinct names per symbol, such as Scalper_EU and Scalper_GU, are still worth using when you want to tell the two apart at a glance in MT5 and in the Analytics dashboard.
Older EA builds
EA versions before 0.64 keyed strategy groups on the comment alone, so the same comment on two symbols merged into one group with targets computed from whichever symbol opened first. If you are on an older build, keep comments unique per symbol until you update.
What the comment controls
| Feature | How the comment is used |
|---|---|
| Pyramid Trading | Defines the group. Combined breakeven, shared profit target, pyramid trailing, level counter, and per level trade limits are all calculated per comment. |
| Direction Lock | Prevents mixing buy and sell inside one comment group. Trades under a different comment are unaffected, and the filter only acts on pyramid-managed strategies. |
| DCA Filter | Compares a new entry against the last entry in the same comment group. Also pyramid-managed strategies only. |
| Hedge Protection | Loss thresholds are evaluated per comment group, and the hedge position is opened with YourComment_Hedge. |
| Recovery System | Recovery trades are opened with YourComment Recovery so they stay identifiable and are excluded from hedging. |
closebuy, closesell, closeall | Only positions matching both the symbol and the comment are closed. Omit the comment and every position on that symbol in that direction closes, regardless of which strategy opened it. |
Partial close (pct=, pct_lots=, pct_percent=) | Same filtering. Remaining positions keep their comment, so repeated partial closes stay on target. |
Reversals (closelongbuy, closeshortsell, and the rest) | The close half is comment filtered, then the new entry is opened under the same comment. |
cancellong, cancelshort | Only pending orders with the matching comment are cancelled. |
exop and exent | Opposite positions are looked up within the symbol and comment before deciding to close or flip. |
noexit | Applied per strategy at the server. Other strategies on the same license still process their exit signals normally. |
| Analytics and Backtesting | Trades are grouped by comment so you can compare strategies side by side. |
A close signal with no comment is not scoped
LicenseID,EURUSD,closebuy closes every buy on EURUSD across all your strategies. Always include the comment in exit signals if the account runs more than one strategy.
Sticky group settings and per signal settings
This is where most confusion starts. Some signal parameters apply only to the trade that carries them. Others are read once, when the strategy group is created, and then govern the whole group until it closes.
| Parameter | Scope | Read when |
|---|---|---|
py | Whole group, sticky | Only on the signal that creates the group. Ignored on every later signal for that comment. |
re | Per trade | Every signal. Only trades carrying re get recovery. |
exop, exent, noexit | Per signal | Every signal. |
sl=, tp=, tp1=, pct=, trailing, breakeven | Per trade | Every signal. |
Why py is sticky
When a signal arrives, the EA checks whether a strategy group with that comment already exists.
- No group exists. This signal creates it. In Signal mode, the presence of
pydecides whether the group is pyramid managed, and the pyramid target, level size, and trade limit are copied from the EA inputs into the group at that moment. - A group already exists. The
pyflag is not read at all. The trade is added to the existing group and inherits whatever the group was created with.
The consequence: removing py from your alert does not turn pyramid management off for a strategy that is already running. The setting is stamped on the group, not on the signal. Adding py to a group that was created without it does nothing either.
How to actually turn pyramid off for a strategy
Close every trade in that comment group. The group is deleted when its last position closes, and the next signal with that comment creates a fresh group that re-reads the py flag. If you need the change to take effect without closing positions, send the new trades under a different comment instead.
Pyramid mode: Enabled versus Signal
The EA input Pyramid Management has three modes, and the difference between the last two is exactly this stamping behaviour.
| Mode | What happens on a new group | Does py matter? |
|---|---|---|
| Disabled | No group is ever pyramid managed. | No. py is ignored entirely. |
| Enabled | Every new group is pyramid managed, automatically. | No. py is ignored, because every group already qualifies. |
| Signal | A new group is pyramid managed only if its first signal carried py. | Yes, but only on the first signal for that comment. |
Use Enabled when every strategy on the terminal should pyramid. Use Signal when you want to pick which strategies pyramid and control it from the alert message.
If the EA loses its saved state files and has to rebuild groups from open positions after a restart, it cannot know which signals carried py. Rebuilt groups are treated as pyramid managed whenever Pyramid Management is Enabled or Signal.
Group lifecycle
Created. The first trade with a new comment creates the strategy group. Pyramid on or off, the pyramid target, level size, and per level trade limit are all fixed at this moment from the EA inputs.
Grows. Later trades with the same comment join the group. Once the group holds two or more trades and has a pyramid target, individual take profits are removed and replaced by the shared strategy target.
Shrinks. Closing individual trades removes them from the group. The rest of the group keeps its settings.
Deleted. When the last position in the group closes, the group is removed along with its chart target line. The stamped settings are gone.
Recreated. The next signal with that comment starts over at step 1 and re-reads py.
Worked example
Pyramid Management is set to Signal. Pyramid Target is 50 pips.
| # | Signal | What the EA does |
|---|---|---|
| 1 | ...,buy,risk=0.01,tp=100,comment=Trend,py | No Trend group exists, so one is created. py is present, so the group is pyramid managed with a 50 pip target. |
| 2 | ...,buy,risk=0.01,tp=100,comment=Trend | Trend exists. py is not read. The trade joins the group. Both trades now share the 50 pip strategy target and their individual take profits are dropped. |
| 3 | ...,buy,risk=0.01,tp=100,comment=Trend | Same again. Still pyramid managed. Dropping py changed nothing. |
| 4 | ...,buy,risk=0.01,tp=100,comment=Trend2 | A different comment, so a brand new group. No py, so Trend2 is not pyramid managed and keeps its own 100 pip take profit per trade. |
| 5 | Strategy target hit, all Trend trades close | The Trend group is deleted. |
| 6 | ...,buy,risk=0.01,tp=100,comment=Trend | No group exists any more, so this creates one. No py, so Trend is now not pyramid managed. |
Rows 3 and 6 are the whole point. The same signal produced different behaviour depending on whether a group with that comment was already open.
Common mistakes
| Symptom | Cause | Fix |
|---|---|---|
| Trades that should pyramid together do not | Comments do not match exactly (case, spaces, a trailing character) | Compare the comments character by character. Use the Syntax Generator so the value is identical in every alert. |
Pyramid keeps running after py was removed | The group was already stamped as pyramid managed | Close every position in that group, or switch the strategy to a new comment. |
Adding py does not enable pyramid on a running strategy | The same reason, in the other direction | Close the group first, or use a new comment. |
| Two unrelated symbols share one target | The same comment was used on both, on an EA build older than 0.64 | Update the EA, or make the comment unique per symbol. |
| A close signal wiped out another strategy | The close signal had no comment= | Add the comment to every exit signal. |
| Direction Lock or DCA Filter rejects a trade unexpectedly | Both filters act on pyramid-managed strategies, and the group is pyramid managed | Check the Pyramid Management mode, and whether py was on the signal that opened the group. Turn the filter off in the EA inputs if you want the strategy to pyramid without it. |
| Hedge protection never triggers for one strategy | The comment contains Recovery or _Hedge | Rename the strategy comment. |
| Groups split in two after an EA restart | The broker truncated or rewrote the order comment | Shorten the comment to well under 31 characters. |
A good default
Name comments Strategy_Symbol, for example Breakout_EU, Breakout_GU, Scalp_XAU. Short, self-describing, no reserved strings, and readable in both MT5 and the Analytics dashboard.
Signal Reference
Learn how to configure and manage trading signals with TradeSgnl. Understand signal formats, webhook setup, and automated signal processing.
Signal Authentication
Learn how to configure secure signal authentication for TradeSgnl. Protect your trading signals with authentication tokens and webhook security.