Skip to content
All library documents

A Line-Crossing Expert Advisor for Automated Entries and Stops

Article BigQuant

Summary

This semiautomatic Expert Advisor opens a trade when price crosses a chart line. It supports trendlines, angle-based trendlines, vertical lines, and horizontal lines, with options to follow the line’s stated direction or restrict entries to buys or sells. Crossings are detected at the opening of a new bar by comparing consecutive open prices. Once a qualifying crossing occurs, the line is marked inactive to prevent another entry. Trendline behavior also depends on whether the line extends to the right, and untriggered finite lines can expire when their endpoint falls behind the latest bar.

Position size, stop loss, take profit, slippage, and order handling settings are configurable. The advisor adjusts invalid stop distances to the symbol’s minimum allowed level and reduces oversized lots when possible; it skips an order if even the minimum lot cannot be funded. The description explains execution logic and safeguards but provides no backtest, profitability evidence, or guidance for selecting line placements or risk parameters.

Key ideas

  • The advisor opens trades when bar-opening prices indicate a crossing of a chart line.
  • Supported line types include trend, angle-based trend, vertical, and horizontal lines.
  • Entry direction can follow the line description or be restricted to buying or selling.
  • Triggered lines become inactive, and finite trendlines may expire after their endpoint passes.
  • The advisor includes configurable position size and stops, with adjustments for symbol limits and available funds.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.