OPEN-SOURCE SCRIPT
ที่อัปเดต: Candle Statistics | by beidou_123

Script Description
Candle Statistics is a quantitative market analysis indicator that provides a structured statistical overview of recent price behavior using candlestick classification.
The script analyzes historical candles over four user-defined lookback periods and classifies each candle into one of three categories:
Key Features
Users can define four independent candle windows (e.g., 15, 60, 240, 480 bars).
A Doji is identified when the candle body is small relative to total price range, ensuring consistency across instruments and timeframes.
For each lookback period, the script computes the Bullish Percentage, defined as:
Bullish % = Bullish Candles ÷ (Bullish + Bearish Candles)
Doji candles are intentionally excluded from this calculation to avoid diluting directional bias.
If Bullish % > 50%, the value is displayed using a user-defined bullish dominance color
If Bullish % ≤ 50%, the value is displayed using a user-defined bearish dominance color
All results are presented in a compact, non-intrusive table displayed directly on the main chart.
Table position is fully configurable.
Intended Use
It is not a signal generator, but a statistical context tool that helps traders assess whether recent price action is dominated by bullish pressure, bearish pressure, or indecision.
Disclaimer
This indicator is provided for educational and analytical purposes only and does not constitute financial or investment advice.
Candle Statistics is a quantitative market analysis indicator that provides a structured statistical overview of recent price behavior using candlestick classification.
The script analyzes historical candles over four user-defined lookback periods and classifies each candle into one of three categories:
Key Features
- Fully customizable lookback periods
Users can define four independent candle windows (e.g., 15, 60, 240, 480 bars).
- Standardized Doji definition
A Doji is identified when the candle body is small relative to total price range, ensuring consistency across instruments and timeframes.
- Directional dominance calculation
For each lookback period, the script computes the Bullish Percentage, defined as:
Bullish % = Bullish Candles ÷ (Bullish + Bearish Candles)
Doji candles are intentionally excluded from this calculation to avoid diluting directional bias.
- Visual dominance highlighting
If Bullish % > 50%, the value is displayed using a user-defined bullish dominance color
If Bullish % ≤ 50%, the value is displayed using a user-defined bearish dominance color
- On-chart statistics table
All results are presented in a compact, non-intrusive table displayed directly on the main chart.
Table position is fully configurable.
Intended Use
- This indicator is designed for:
- Market structure analysis
- Trend bias evaluation
- Volatility and indecision studies
- Systematic filtering in discretionary or rule-based trading systems
It is not a signal generator, but a statistical context tool that helps traders assess whether recent price action is dominated by bullish pressure, bearish pressure, or indecision.
Disclaimer
This indicator is provided for educational and analytical purposes only and does not constitute financial or investment advice.
เอกสารเผยแพร่
change chartสคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
hello
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
hello
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน