Skip to content

Indicator Description

CDP (Contrarian Daily Price) is a trend indicator that reflects the strength and direction of market trends by calculating price trend changes.

Function Information

  • Function Name: CDP
  • Input Parameters: High, Low, Close
  • Parameter Settings: timeperiod (default: 20)
  • Output: cdp, ah, al, nh, nl

Calculation Principle

CDP is calculated using the following formula:

CDP = (High + Low + Close) / 3
AH = CDP + (High - Low)
AL = CDP - (High - Low)
NH = CDP * 2 - Low
NL = CDP * 2 - High

Where AH/AL are above resistance levels and NH/NL are near resistance/support levels.

Usage Scenarios

  1. Trend direction judgment
  2. Trend strength analysis
  3. Trend reversal identification
  4. Trading signal generation