Trendline EA
- Utilities
- Version: 2.84
- Updated: 26 October 2026
- Activations: 10
Trendline EA MT4 places trades, closes positions and sends alerts from trendlines you draw on the chart. Type a short command into a line's description, for example BoB SL:100 TP:200 V:0.05, and the Expert Advisor acts when price touches, breaks out of or pulls back to that line.
It is semi-automated: you supply the entry commands and draw the lines. The Expert Advisor does not choose a trading strategy, draw or move your lines. It has no on-chart panel.
How to use it
- Attach the Expert Advisor to a chart and allow automated trading.
- Draw a trendline or a horizontal line with the standard MetaTrader tools.
- Open the line properties and type a command in the Description field.
- Keep the terminal running. The Expert Advisor watches the line and performs the command.
To see the command on the chart, enable "Show object descriptions" in the chart properties.
Commands
Trade on touch: BoT or Buy, SoT or Sell.
Trade on breakout: BoB, SoB.
Trade on pullback: BoPB, SoPB.
Trade on false breakout: BoFB, SoFB.
Close positions on touch: CaB selects Buy positions, CaS Sell positions, CaO both. Close commands apply to the chart symbol and the MagicNumber filter; 0 includes all magic numbers. CP vol:0.01 requests a close of 0.01 lots from each matching position.
Alerts: Alert or AoT on touch, AoB on breakout, AoP on pullback, AoFB on false breakout.
Settings you can add: SL stop loss in points, TP take profit in points, V volume in lots.
Examples: "BoB SL:100 TP:200 V:0.05" buys on breakout. "SoPB SL:80 TP:160 V:0.03" sells on pullback. "CaB" closes matching Buy positions. One line can hold several commands, for example "BoT SoB".
How the triggers work
Touch: the selected price crosses the line between ticks. Breakout modes are candle close, distance in points, or candle close with minimum and maximum distance validation. Pullback: the previous candle closed at or above the line for a Buy, or at or below it for a Sell, and price touches the line. False breakout: price reaches the configured minimum distance beyond the line and then touches it again.
Trade management and inputs
By default each command runs once. For entries, Reentry type offers separate modes: after the previous matching order closes, or after the configured minutes since a matching open order's entry. The timed mode can add an order while the earlier one is still open. Close behaviour can allow close commands to repeat.
Lot size can be fixed with LotSize or V:. Trailing stop and breakeven stop are supported. A maximum spread for new entries, minimum and maximum breakout distances, and a minimum false-breakout distance can be set.
Buy touch-based triggers can use Ask or Bid. Distance-mode Buy breakouts use Ask; Buy orders execute at Ask.
Alerts support popup, email, push notification and sound.
Exit-line close commands can close matching positions automatically.
Questions
Does it trade automatically? Once armed, line commands trigger automatically. You choose the lines and entry commands; trailing stop and breakeven use their inputs.
I typed a command and nothing happens. Check the line's Description field, automated trading permission, trigger settings and execution limits.
Does the terminal have to stay open? Yes. Line commands and trade management need MetaTrader 4 running with the Expert Advisor attached.
Can I use horizontal lines? Yes.
Can I reuse a line? Yes. Replace the old command and remove the bracketed execution counters added to the Description.
Can it close one specific trade? There is no ticket-selection command. Close commands select positions by symbol, direction and MagicNumber. For partial closes, use vol:, not V:.
Notes
Results depend entirely on your lines and settings and on market conditions. No trading strategy is included. Testing on a demo account is recommended before live use.

it is brilliant so far, can use the same line again, just what I wanted, add the code in the description field of the selected line