Trend Lines
Draws automatic trend lines from the turning points of the smoothed price and follows each one until price breaks away from it.
What you see
- Thin lines that start at a peak or a trough of the price. Lines built from peaks (resistance) and lines built from troughs (support) are drawn the same way.
- Intact lines are grey and run to the latest close. A line that price has broken ends at the close of the breaking candle: green for a break up through a peak line, red for a break down through a trough line.
- A line in Line Color for the smoothed price the turning points are taken from. With Period (DEMA) at 1 it simply follows the closes.
If no trend line qualifies, the turning points themselves are shown as dots, red for peaks and green for troughs.
How it works
The close is smoothed with a DEMA and its peaks and troughs are found. Peaks are paired with lower peaks and troughs with higher troughs; the line through each pair is projected to the right candle by candle. It counts as broken when a close moves beyond the projection by more than Trend Line Deviation %. Lines whose length in candles falls outside Min / Max Trend Line length are discarded.
How to read it
In active markets many lines overlap, especially over the most recent candles. Focus on long lines that started at clear turning points. Breaks through a line that held for a long time carry more weight than breaks of short ones. Raise Min Trend Line length to hide short lines and lower the deviation to have lines end sooner.
Using it in strategies
The output value is the smoothed price line (the DEMA of the close), not a trend line – the lines themselves are not available as outputs. In WickScript: use indicator "Trend Line Indicator" with DEMAPeriod 5 as tl, then tl.value. For the Trade Setup it behaves like a moving average.
Settings
Open the settings with the slider icon next to the indicator (Indicators, F3). Numeric settings can be swept as Step 1 / Step 2 parameters when you run a strategy.
Inputs
| Setting | Type | Default | Description |
|---|---|---|---|
| Period (DEMA) | Number | 1 | Smoothing of the close before turning points are searched. 1 = no smoothing; larger values ignore small wiggles. (min 1) |
| Min. Range (High/Low) | Number | 3 | Minimum number of candles between two consecutive peaks (or troughs). (min 2) |
| Max. Range (High/Low) | Number | 5 | How many candles before a point it has to stand out against to count as a peak or trough. (min 2) |
| Min Trend Line length | Number | 2 | Shortest line that is kept, in candles. (min 2) |
| Max Trend Line length | Number | 80 | Longest line that is kept, in candles. (min 2) |
| Trend Line Deviation % | Number | 3.5 | How far, in percent, a close must move beyond the projected line to break it. (min 0) |
Styles
| Setting | Type | Default | Description |
|---|---|---|---|
| Line Color | Color | #b5b6b6 |
Outputs
These values can be used in Trade Setup triggers, filters and exits (see Trade Setup) and in WickScript.
| Output | In WickScript | Description |
|---|---|---|
| value | value | The smoothed close (DEMA) used to find the turning points. |
Use in WickScript
use indicator creates this indicator inside a script, with settings by their ID. Each output is a field of the name after as. See WickScript indicators.
wickscript 1
indicator "Trend Lines from the list" on chart
use indicator "Trend Line" with DEMAPeriod 1 as myTrendline
show myTrendline.value as line "value"