AutoTrendLines - MetaTrader 5 Script | Forex Indicator Download - MT4/MT5 Resources



When a new bar appears, the indicator defines points to draw the trend line, and if the coordinates of the points change, it redraws the trend line. When determining points, the current bar will be ignored. The support line is drawn at a low level and the resistance line is drawn at a high level. There are two points of judgment in the indicator. The two types are described below using the support line as an example.
Main parameters:
Type 1. Through two extreme values.

Type 2. extreme value and delta.
а) Consider drawing a line starting to the right of the left point.

а) The bar to the right of the left point is not considered when drawing the line.

*Extreme value refers to a bar with N bars on its left and right sides, with higher lows and lower highs. In fact, the extrema are actually the same as N fractals.
**Delta is calculated using the following formula:
Support: (right price - left price) / (right column index - left column index)
Resistance: (left price - right price) / (right column index - left column index)
suggestion:
Attachment download
📎 autotrendlines.mq5 (11.63 KB)
Source: MQL5 #1220
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •