Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

MetaTrader 5 Indicator | AutoTrendLines Indicator for MQL5

Features

  • Two Extremums (Type 1): Draws trend lines based on two extremum points (highs/lows) identified within user-defined bar ranges.

  • Extremum and Delta (Type 2): Combines an extremum point with a minimal delta point for more dynamic trend lines.

  • Customizable parameters for line width, colors, and extremum side ranges.

  • Lines are drawn as support (pink) and resistance (blue) with selectable and adjustable properties.

Input Parameters

  • Line Type: Choose between EXM_EXM (Two Extremums) or EXM_DELTA (Extremum and Delta).

  • Left Extremum Side: Number of bars to check for the left extremum (default: 20).

  • Right Extremum Side: Number of bars for the right extremum in Type 1 (default: 3).

  • Offset from Current Bar: Bar offset for Type 2 calculations (default: 3).

  • Account for Bar Before Extremum: Include the bar before the extremum in Type 2 (default: false).

  • Lines Width: Set the thickness of trend lines (default: 1).

  • Support/Resistance Line Color: Customize colors (default: pink for support, blue for resistance).

  • Instance Name: Unique identifier for the indicator instance (default: "AutoTrendLines1"). MetaTrader Experts, Indicators, Scripts and Libraries

How to Use

  1. Add to Chart: Attach the indicator to any MetaTrader 5 chart.

  2. Configure Settings: Adjust input parameters to suit your trading strategy.

  3. Interpret Lines:

    • Support Line: Pink line indicating potential price support levels.

    • Resistance Line: Blue line showing potential price resistance levels.

  4. Monitor Updates: Trend lines update automatically with each new bar.
    MetaTrader Experts, Indicators, Scripts and Libraries

Notes

  • Requires sufficient historical data (minimum bars calculated based on input settings).

  • The current unformed bar is excluded from calculations.

  • Extremum points are bars with lower lows or higher highs compared to surrounding bars

    Feedback

    If you have suggestions or encounter issues, please leave a comment on the MQL5 CodeBase page or contact me through the MQL5 community. Your feedback is valuable for improving this tool!

    Contact me: MQL5 Link

    Happy trading!


61217