Skip to content

Trend Determination (Dow Theory Style) #841

@bennycode

Description

@bennycode

Core definition of trends in Dow Theory:

  • Uptrend = Higher Highs (HH) + Higher Lows (HL)
  • Downtrend = Lower Highs (LH) + Lower Lows (LL)

Once a sequence like this is detected:

  • HH → HL → HH → HL → confirms uptrend
  • LL → LH → LL → LH → confirms downtrend

Dow Theory in the real world is not always clean — price action can be noisy. One or two candles might spike out of sequence, but the overall trend structure remains valid. To handle this, we can introduce a buffer or tolerance, often called:

  • Deviation
  • Threshold
  • Leniency
  • Noise buffer

Requirements:

  • Maintain a rolling window of price data (maxCandles)
  • Calculate pivot highs/lows based on a lookback period
  • Using buffer logic to determine the trend
  • Support real-time candle streaming

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions