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").

How to Use
-
Add to Chart: Attach the indicator to any MetaTrader 5 chart.
-
Configure Settings: Adjust input parameters to suit your trading strategy.
-
Interpret Lines:
-
Support Line: Pink line indicating potential price support levels.
-
Resistance Line: Blue line showing potential price resistance levels.
-
-
Monitor Updates: Trend lines update automatically with each new bar.

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!