Trading Dev AcademyFree quant education

Free lesson · Technical analysis

Dynamic support, trend lines and Gann angles

Open interactive lessonPractice calculationsExplore labs

Start with the idea

A moving reference changes with time. State its numerical rule before drawing it on a chart.

Symbols, units & horizon
  • E_t: current EMA in price units
  • C_t: current completed close
  • α: smoothing coefficient in (0,1]
  • E_(t−1): prior EMA
  • P₁,P₂: confirmed anchor prices
  • t₁,t₂: distinct anchor times in bars or stated time units
  • m: price units per time unit
  • K(t): projected line level

When and why to use this

Use distances to causal moving references and trend lines as features or explicit trigger boundaries.

  • A moving average can act as a candidate dynamic support/resistance reference. A touch or bounce remains a hypothesis, not a property of the average.
  • An EMA updates the previous average toward the latest completed value. Its smoothing coefficient controls response speed.
  • A trend line joins two previously confirmed anchors. It becomes available when the second anchor is confirmed; projecting it earlier is hindsight.
  • A Gann 1×1 line means one chosen price unit per chosen time unit. It is not an invariant 45-degree angle when the chart is resized.
  • Specify linear versus logarithmic price axes. A straight line on a log-price axis represents a different price path.
  • Normalize distances by prior volatility and test against a constant-level or simple trend baseline. Reject an interpretation that depends only on visual aspect ratio.
Et=αCt+(1−α)Et−1,m=P2−P1t2−t1,K(t)=P1+m(t−t1)
Specified chart rule · derivation and arithmetic

Dynamic support, trend lines and Gann angles

  1. EMA with prior 100, new close 104 and α=.25 gives .25×104+.75×100=101.
  2. Anchors (0,100) and (4,108) give slope (108−100)/(4−0)=2 price units/bar.
  3. At bar 6, the line projects to 100+2×6=112. A 1×1 line in these units would instead have slope 1.
Work it by hand

The same 2-price-units/bar slope looks steeper or flatter when the screen axes are resized, but its numerical rule does not change.

Use the rule

  • Fix the definition, units and information timestamp.
  • Compute the example and inspect the graph.
  • Compare with a simple baseline on untouched periods after costs.

Before moving on

Write the exact rule, its availability time, an invalidation condition and a fair out-of-sample test.

Python implementation

Self-contained teaching example. Python 3.10+; dependencies and input conventions are shown in the code and notation. Run in your own Python environment.

def ema_step(close,previous,alpha):
    if not 0<alpha<=1: raise ValueError("alpha in (0,1] required")
    return alpha*close+(1-alpha)*previous

def projected_line(t,t1,p1,t2,p2):
    if t1==t2: raise ValueError("Distinct anchor times required")
    slope=(p2-p1)/(t2-t1)
    return p1+slope*(t-t1)

print(ema_step(104,100,.25),projected_line(6,0,100,4,108))

Continue learning

Technical Analysis: Geometry, Structure & Evidence — all lessons
  1. Support, resistance and reversal: start with a price zone
  2. Breakout detection, false breaks and retests
  3. Fibonacci retracements: anchors before ratios
  4. Harmonic patterns: ratio constraints and competing candidates
  5. Elliott Wave: count hypotheses, rules and invalidation
  6. Fair value gaps (FVG): three-bar geometry and fill measurement
  7. Heikin-Ashi: smoothed candles are synthetic prices
  8. Renko: price-driven bricks and the missing time axis
  9. Dynamic support, trend lines and Gann angles
  10. Momentum indicators, oscillators and divergence
  11. Volume, supply/demand zones and what OHLCV cannot reveal
  12. Market structure, BOS and CHOCH as a state machine
  13. Moon phases: encode a calendar hypothesis and try to falsify it

Quantitative finance and development glossary · Python resources and libraries · Research sources and limitations