Open Portal

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 guide

By hand, add comment= anywhere in the parameter list:

LicenseID,EURUSD,buy,risk=0.01,sl=50,tp=100,comment=TrendStrategy

Naming rules

RuleWhy
Matching is exact and case sensitiveTrendStrategy and trendstrategy are two different strategies. A stray space or a typo silently creates a second group.
No spaces around the valueParameters are split on commas with no spaces. comment= My Strategy will not match comment=MyStrategy.
Keep it shortMT5 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 RecoveryBoth 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

FeatureHow the comment is used
Pyramid TradingDefines the group. Combined breakeven, shared profit target, pyramid trailing, level counter, and per level trade limits are all calculated per comment.
Direction LockPrevents 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 FilterCompares a new entry against the last entry in the same comment group. Also pyramid-managed strategies only.
Hedge ProtectionLoss thresholds are evaluated per comment group, and the hedge position is opened with YourComment_Hedge.
Recovery SystemRecovery trades are opened with YourComment Recovery so they stay identifiable and are excluded from hedging.
closebuy, closesell, closeallOnly 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, cancelshortOnly pending orders with the matching comment are cancelled.
exop and exentOpposite positions are looked up within the symbol and comment before deciding to close or flip.
noexitApplied per strategy at the server. Other strategies on the same license still process their exit signals normally.
Analytics and BacktestingTrades 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.

ParameterScopeRead when
pyWhole group, stickyOnly on the signal that creates the group. Ignored on every later signal for that comment.
rePer tradeEvery signal. Only trades carrying re get recovery.
exop, exent, noexitPer signalEvery signal.
sl=, tp=, tp1=, pct=, trailing, breakevenPer tradeEvery 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 py decides 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 py flag 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.

ModeWhat happens on a new groupDoes py matter?
DisabledNo group is ever pyramid managed.No. py is ignored entirely.
EnabledEvery new group is pyramid managed, automatically.No. py is ignored, because every group already qualifies.
SignalA 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.

#SignalWhat the EA does
1...,buy,risk=0.01,tp=100,comment=Trend,pyNo 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=TrendTrend 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=TrendSame again. Still pyramid managed. Dropping py changed nothing.
4...,buy,risk=0.01,tp=100,comment=Trend2A 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.
5Strategy target hit, all Trend trades closeThe Trend group is deleted.
6...,buy,risk=0.01,tp=100,comment=TrendNo 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

SymptomCauseFix
Trades that should pyramid together do notComments 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 removedThe group was already stamped as pyramid managedClose every position in that group, or switch the strategy to a new comment.
Adding py does not enable pyramid on a running strategyThe same reason, in the other directionClose the group first, or use a new comment.
Two unrelated symbols share one targetThe same comment was used on both, on an EA build older than 0.64Update the EA, or make the comment unique per symbol.
A close signal wiped out another strategyThe close signal had no comment=Add the comment to every exit signal.
Direction Lock or DCA Filter rejects a trade unexpectedlyBoth filters act on pyramid-managed strategies, and the group is pyramid managedCheck 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 strategyThe comment contains Recovery or _HedgeRename the strategy comment.
Groups split in two after an EA restartThe broker truncated or rewrote the order commentShorten 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.

On this page