OPEN-SOURCE SCRIPT
Adaptive Square Levels (Prev + Curr Month, Big Labels)

Title:
🔢 Adaptive Square Levels — Monthly Precision Trendlines
Description:
The Adaptive Square Levels indicator dynamically plots mathematical square number levels based on the first trading day’s open of each month.
📌 Key Features:
Plots horizontal trendlines aligned with the nearest square number to the monthly open.
Automatically generates ±10 additional square levels above and below that anchor.
Shows current month and previous month levels only, keeping the chart clean.
Special highlight: levels that are squares of multiples of 3 (9, 36, 81…) appear in orange for easy recognition.
The nearest square line is bold and labeled with a ★ star, making it instantly stand out.
Labels use large fonts, ensuring values are clearly visible alongside price scale.
📊 How It Works:
At the first bar of each new month, the script locks the opening price.
It finds the nearest perfect square to that open.
The indicator then plots horizontal levels extending across the month (finite lines, not rays).
At month change, previous month levels are fixed and new levels start fresh.
⚡ Use Cases:
Identify natural mathematical zones of support/resistance.
Compare current vs. previous month’s adaptive levels.
Use as confluence with price action or other technical tools.
⚠️ Disclaimer:
This script is for educational and analytical purposes only. It is not financial advice. Trading involves risk, and past levels or patterns do not guarantee future performance. Always use with proper risk management.
🔢 Adaptive Square Levels — Monthly Precision Trendlines
Description:
The Adaptive Square Levels indicator dynamically plots mathematical square number levels based on the first trading day’s open of each month.
📌 Key Features:
Plots horizontal trendlines aligned with the nearest square number to the monthly open.
Automatically generates ±10 additional square levels above and below that anchor.
Shows current month and previous month levels only, keeping the chart clean.
Special highlight: levels that are squares of multiples of 3 (9, 36, 81…) appear in orange for easy recognition.
The nearest square line is bold and labeled with a ★ star, making it instantly stand out.
Labels use large fonts, ensuring values are clearly visible alongside price scale.
📊 How It Works:
At the first bar of each new month, the script locks the opening price.
It finds the nearest perfect square to that open.
The indicator then plots horizontal levels extending across the month (finite lines, not rays).
At month change, previous month levels are fixed and new levels start fresh.
⚡ Use Cases:
Identify natural mathematical zones of support/resistance.
Compare current vs. previous month’s adaptive levels.
Use as confluence with price action or other technical tools.
⚠️ Disclaimer:
This script is for educational and analytical purposes only. It is not financial advice. Trading involves risk, and past levels or patterns do not guarantee future performance. Always use with proper risk management.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.