generated from bennycode/ts-node-starter
-
-
Notifications
You must be signed in to change notification settings - Fork 113
Open
Description
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
Labels
No labels