Trend Detection

Identify the primary trend direction and strength using price action

HuskyDanny Updated

File contents

Trend Detection Workflow

OBJECTIVE: Determine the dominant market trend for the target symbol.

Step 1: Gather Historical Data

  • Use get_historical_prices with 3-month lookback (period="3mo")
  • Identify swing highs and swing lows in the data

Step 2: Classify Trend Structure

  • UPTREND: Higher highs AND higher lows
  • DOWNTREND: Lower highs AND lower lows
  • SIDEWAYS: Mixed or no clear pattern

Step 3: Confirm with Momentum

  • Use stochastic_analysis_tool to check momentum alignment
  • Trend + aligned momentum = STRONG trend
  • Trend + diverging momentum = WEAKENING trend

Step 4: Identify Key Levels

  • In uptrend: Note last higher low as support
  • In downtrend: Note last lower high as resistance

Output Format

Trend: [UPTREND/DOWNTREND/SIDEWAYS] | Strength: [STRONG/MODERATE/WEAK] Key Support: $X.XX | Key Resistance: $Y.YY Momentum: [ALIGNED/DIVERGING] with trend

HuskyDanny/FinancialAgent/tree/main/backend/src/agent/skills/technical/trend-detection commit 85d8724a6a

Frequently asked questions

npx skillmds@latest add huskydanny/trend-detection