PINE LIBRARY

TCD_scoring_lib

80
Scoring engine for TCD (Trade Consistent & Disciplined).

Takes data from all library modules across 4 timeframes and produces:
- **BUY/SELL scores (0-10):** Multi-timeframe trend alignment scoring
- **CT Buy/Sell scores (0-18):** Counter-trend exhaustion scoring with stretched, structural, and completion signals
- **Trade recommendations:** Scalp (with-trend and counter-trend) and Swing setups with specific entry, stop loss, T1, and T2 levels
- **Validation pipeline:** Direction clamping, SL sanity checks, target hit cascading, proximity filtering, and R:R computation

Pure functions only — no `request.security()` calls. All timeframe data is passed in from the main indicator.

Used by: TCD - Trade Consistent & Disciplined (indicator)

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.