OPEN-SOURCE SCRIPT
מעודכן ESG-TH SET50 [Itto-Ryu]

ESG-TH SET50 [Itto-Ryu]
FOR ACADEMIC AND EDUCATIONAL PURPOSES ONLY. This script is a research tool that displays publicly announced sustainability data next to a price chart. It is not investment advice, not a recommendation to buy or sell any security, and not a substitute for a company's own disclosures or for the official publications of the data providers named below. Use it to study the relationship between ESG information and Thai equities, not to make trading decisions.
WHAT IT DOES
ESG-TH SET50 puts a Thai stock's sustainability profile in the corner of the chart so you can read it before you read the price. It covers the 50 SET50 constituents (H1 2026) and shows only data that the Stock Exchange of Thailand, the Thai Institute of Directors, S&P Global or the Science Based Targets initiative have published.
TABLE ROWS
- Header: ticker, rating year and the SET ESG Ratings 2025 grade (AAA / AA / A / BBB / NR).
- History 2023 -> 2024 -> 2025: grades of the last three SET rounds with an up / down / same marker versus last year.
- Peers: how many rated companies in the same SET industry group share this grade.
- Index: membership of SETESG, SET50, SET100 and the Thai ESG fund universe.
- CG score (IOD 2025): Thai IOD Corporate Governance Report level, 5 stars Excellent (90+), 4 stars Very Good (80-89), 3 stars Good (70-79). A warning mark means IOD flagged CG-related news that lowered the published range.
- S&P Yearbook 2026: S&P Global Sustainability Yearbook 2026 distinction (Top 1%, Top 5%, Top 10%, Member) or "not selected".
- SBTi climate target: net-zero year, near-term target class and year, "commitment removed", or none on the dashboard.
- Valid until: the last SET ESG Ratings round stays valid until December 2026, when FTSE Russell ESG Scores replace it.
- Index review: next SETESG semi-annual review month (June or December).
- Summary: one-line business description in English or Thai.
- Source: dataset and announcement date.
The chart background is tinted by grade (AAA green, AA teal, A blue, BBB amber, NR grey) so the rating stays visible with the table hidden.
HOW THE DATA IS BUILT
Pine Script cannot fetch external data, so everything is embedded. An open-source Python pipeline downloads the public sources, checks them against the officially announced counts, and generates the lookup as a Pine library. Nothing is estimated or modelled; every value traces to a dated public document:
- SET ESG Ratings 2025 (announced 12 Dec 2025) and the 2023-2024 history table (SET, 16 Dec 2024)
- SETESG, SET50 and SET100 constituents for H1 2026 (SET, 15 Dec 2025)
- Corporate Governance Report 2025 (Thai IOD, data as of 11 Feb 2026)
- S&P Global Sustainability Yearbook 2026 (18 Feb 2026)
- SBTi Target Dashboard export (weekly file; export date recorded in the repository)
INPUTS
- Show table (on): draw the table on the last bar.
- Background tint by grade (on): colour the chart background by grade.
- Language (EN): EN gives the English summary with years in CE; TH gives the Thai summary with years in Buddhist Era.
- Table position (top right): corner of the chart.
- Text size (small): table font size.
WHO IT IS FOR
Students, researchers and investors in Thai equities who want the ESG, governance and climate-target context on the chart, for example when studying Thai ESG fund eligibility, SETESG rebalances, or a company against its industry peers. It generates no signals and gives no buy or sell output.
HOW TO USE
1. Open any SET50 stock on a SET chart. Any timeframe works; the data is per company, not per bar.
2. Read the grade and its three-year trend first, then the peer count to see whether the grade is common in that industry.
3. Treat the CG warning mark, "commitment removed" on the SBTi row, or a grade downgrade as prompts to read the company's own disclosures.
4. Switch Language to TH for Thai text and Buddhist Era years.
COMMON MISTAKES
- Expecting live data: the values are a snapshot of the published rounds listed above and change only when the script is updated.
- Reading NR as "bad": NR means the company did not receive a 2025 rating, which can happen for eligibility reasons, not only for low scores.
- Using it outside SET50: other SET stocks show NR until the full-universe build is released; non-SET symbols show "No data".
DISCLOSURE
- Pine Script v6. Open source under the Mozilla Public License 2.0. The data pipeline and source files are in the repository linked from the author profile.
- Repaint: No. All values are static per company and the table is drawn on the last bar only. The "Index review" month is derived from the current date and simply advances with time.
- Chart type: works on any chart type and timeframe; no OHLC-based logic.
- Originality: embeds public sustainability datasets as a Pine lookup generated from a library template. No code is reused from other TradingView scripts.
- Data ownership: SET ESG Ratings and index lists are published by The Stock Exchange of Thailand; the Corporate Governance Report by the Thai Institute of Directors; the Sustainability Yearbook by S&P Global; climate targets by the Science Based Targets initiative. Only publicly announced results are reproduced. FTSE Russell ESG Scores are not included.
- Academic and educational use only. Not investment advice. Past ratings do not predict future ratings or returns.
Develop by Mr. Thiranat Ngamchitcharoen
FOR ACADEMIC AND EDUCATIONAL PURPOSES ONLY. This script is a research tool that displays publicly announced sustainability data next to a price chart. It is not investment advice, not a recommendation to buy or sell any security, and not a substitute for a company's own disclosures or for the official publications of the data providers named below. Use it to study the relationship between ESG information and Thai equities, not to make trading decisions.
WHAT IT DOES
ESG-TH SET50 puts a Thai stock's sustainability profile in the corner of the chart so you can read it before you read the price. It covers the 50 SET50 constituents (H1 2026) and shows only data that the Stock Exchange of Thailand, the Thai Institute of Directors, S&P Global or the Science Based Targets initiative have published.
TABLE ROWS
- Header: ticker, rating year and the SET ESG Ratings 2025 grade (AAA / AA / A / BBB / NR).
- History 2023 -> 2024 -> 2025: grades of the last three SET rounds with an up / down / same marker versus last year.
- Peers: how many rated companies in the same SET industry group share this grade.
- Index: membership of SETESG, SET50, SET100 and the Thai ESG fund universe.
- CG score (IOD 2025): Thai IOD Corporate Governance Report level, 5 stars Excellent (90+), 4 stars Very Good (80-89), 3 stars Good (70-79). A warning mark means IOD flagged CG-related news that lowered the published range.
- S&P Yearbook 2026: S&P Global Sustainability Yearbook 2026 distinction (Top 1%, Top 5%, Top 10%, Member) or "not selected".
- SBTi climate target: net-zero year, near-term target class and year, "commitment removed", or none on the dashboard.
- Valid until: the last SET ESG Ratings round stays valid until December 2026, when FTSE Russell ESG Scores replace it.
- Index review: next SETESG semi-annual review month (June or December).
- Summary: one-line business description in English or Thai.
- Source: dataset and announcement date.
The chart background is tinted by grade (AAA green, AA teal, A blue, BBB amber, NR grey) so the rating stays visible with the table hidden.
HOW THE DATA IS BUILT
Pine Script cannot fetch external data, so everything is embedded. An open-source Python pipeline downloads the public sources, checks them against the officially announced counts, and generates the lookup as a Pine library. Nothing is estimated or modelled; every value traces to a dated public document:
- SET ESG Ratings 2025 (announced 12 Dec 2025) and the 2023-2024 history table (SET, 16 Dec 2024)
- SETESG, SET50 and SET100 constituents for H1 2026 (SET, 15 Dec 2025)
- Corporate Governance Report 2025 (Thai IOD, data as of 11 Feb 2026)
- S&P Global Sustainability Yearbook 2026 (18 Feb 2026)
- SBTi Target Dashboard export (weekly file; export date recorded in the repository)
INPUTS
- Show table (on): draw the table on the last bar.
- Background tint by grade (on): colour the chart background by grade.
- Language (EN): EN gives the English summary with years in CE; TH gives the Thai summary with years in Buddhist Era.
- Table position (top right): corner of the chart.
- Text size (small): table font size.
WHO IT IS FOR
Students, researchers and investors in Thai equities who want the ESG, governance and climate-target context on the chart, for example when studying Thai ESG fund eligibility, SETESG rebalances, or a company against its industry peers. It generates no signals and gives no buy or sell output.
HOW TO USE
1. Open any SET50 stock on a SET chart. Any timeframe works; the data is per company, not per bar.
2. Read the grade and its three-year trend first, then the peer count to see whether the grade is common in that industry.
3. Treat the CG warning mark, "commitment removed" on the SBTi row, or a grade downgrade as prompts to read the company's own disclosures.
4. Switch Language to TH for Thai text and Buddhist Era years.
COMMON MISTAKES
- Expecting live data: the values are a snapshot of the published rounds listed above and change only when the script is updated.
- Reading NR as "bad": NR means the company did not receive a 2025 rating, which can happen for eligibility reasons, not only for low scores.
- Using it outside SET50: other SET stocks show NR until the full-universe build is released; non-SET symbols show "No data".
DISCLOSURE
- Pine Script v6. Open source under the Mozilla Public License 2.0. The data pipeline and source files are in the repository linked from the author profile.
- Repaint: No. All values are static per company and the table is drawn on the last bar only. The "Index review" month is derived from the current date and simply advances with time.
- Chart type: works on any chart type and timeframe; no OHLC-based logic.
- Originality: embeds public sustainability datasets as a Pine lookup generated from a library template. No code is reused from other TradingView scripts.
- Data ownership: SET ESG Ratings and index lists are published by The Stock Exchange of Thailand; the Corporate Governance Report by the Thai Institute of Directors; the Sustainability Yearbook by S&P Global; climate targets by the Science Based Targets initiative. Only publicly announced results are reproduced. FTSE Russell ESG Scores are not included.
- Academic and educational use only. Not investment advice. Past ratings do not predict future ratings or returns.
Develop by Mr. Thiranat Ngamchitcharoen
הערות שחרור
update information on SET50סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.