PROTECTED SOURCE SCRIPT
40 Market Breadth

This is a Market Breadth Indicator designed to track how many stocks within a specific group (in this case, 40 Thai stocks from the SET index) are trading above or below a chosen Moving Average.
It’s essentially a "health check" for a sector or index: if most stocks are above their MA, the trend is broad and strong; if only a few are, the market might be fragile.
This Pine Script is a Market Breadth Indicator designed to track how many stocks within a specific group (in this case, 40 Thai stocks from the SET index) are trading above or below a chosen Moving Average.
It’s essentially a "health check" for a sector or index: if most stocks are above their MA, the trend is broad and strong; if only a few are, the market might be fragile.
Core Functions
Customizable Symbol List: It takes a list of up to 40 stock tickers (defaulting to major Thai stocks like ADVANC, AOT, PTT).
Breadth Calculation: It checks the price of every stock in that list against a Moving Average (SMA or EMA).
Visual Output:
Green Line: Number of stocks trading above the MA.
Red Line: Number of stocks trading below the MA.
50% Line: A baseline to see if the majority (bullish) or minority (bearish) are performing well.
It’s essentially a "health check" for a sector or index: if most stocks are above their MA, the trend is broad and strong; if only a few are, the market might be fragile.
This Pine Script is a Market Breadth Indicator designed to track how many stocks within a specific group (in this case, 40 Thai stocks from the SET index) are trading above or below a chosen Moving Average.
It’s essentially a "health check" for a sector or index: if most stocks are above their MA, the trend is broad and strong; if only a few are, the market might be fragile.
Core Functions
Customizable Symbol List: It takes a list of up to 40 stock tickers (defaulting to major Thai stocks like ADVANC, AOT, PTT).
Breadth Calculation: It checks the price of every stock in that list against a Moving Average (SMA or EMA).
Visual Output:
Green Line: Number of stocks trading above the MA.
Red Line: Number of stocks trading below the MA.
50% Line: A baseline to see if the majority (bullish) or minority (bearish) are performing well.
Mã được bảo vệ
Tập lệnh này được đăng dưới dạng mã nguồn đóng. Tuy nhiên, bạn có thể sử dụng tự do và không giới hạn – tìm hiểu thêm tại đây.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã được bảo vệ
Tập lệnh này được đăng dưới dạng mã nguồn đóng. Tuy nhiên, bạn có thể sử dụng tự do và không giới hạn – tìm hiểu thêm tại đây.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.