Join our fan page
- Views:
- 374
- Rating:
- Published:
-
Need a robot or indicator based on this code? Order it on Freelance Go to Freelance
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 LinkHappy trading!

Set Auto TP and SL: The “Set Auto TP and SL” (Take Profit and Stop Loss) feature is a crucial tool in any trading strategy, designed to automate risk and reward management. It allows traders to define fixed price levels where a trade should be automatically closed to either secure profits (TP) or limit losses (SL), removing the need for constant manual monitoring. When this feature is enabled, each position you open will automatically include a predefined Take Profit and Stop Loss level based on your custom parameters, such as a specific number of pips, percentage of balance, or technical levels. This not only saves time but also ensures that your trades are protected from sudden market movements and emotional decision-making.

Monthly VWAP (Volume Weighted Average Price) is an essential MQL5 indicator that calculates and displays the Volume Weighted Average Price for each trading month. It's a powerful tool for understanding long-term market sentiment, identifying key monthly fair value, and informing strategic decisions.

Volatility indicator with a threshold line based on the Generalized AutoRegressive Conditional Heteroskedasticiticy (GARCH) statistical model used for time series analysis and forecasting.

Indicator edition for new platform.