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

The Adaptive Square Levels (Configurable Edition) indicator dynamically plots price levels based on perfect squares — a concept derived from harmonic market behavior and geometric scaling.
Each month, the script automatically detects the new monthly open and generates square levels both above and below the opening price.
This version introduces full configurability, allowing traders to adjust how many square levels they want to visualize on either side of the base level. The indicator also visually separates previous and current month levels for easy reference.
⚙️ Features
🔢 User-Configurable Range: Choose how many levels to plot above and below the base level.
🧮 Mathematically Derived Levels: Based on perfect squares up to a user-defined max price.
📅 Monthly Auto-Reset: Automatically refreshes at the start of each new month.
🎨 Color-Coded Levels:
Orange → Major levels (square roots divisible by 3)
Yellow → Regular levels
Star (★) → Base level (nearest to monthly open)
🕰️ Dual Month Display: Shows both current and previous month levels for trend comparison.
💡 How to Use
Add the indicator to any symbol and timeframe (preferably daily or higher).
Adjust:
Max Price Level → The upper bound of your price universe.
Number of Levels Each Side → Controls the density of levels.
Observe how price reacts around these mathematically significant zones.
Use in confluence with your own price action, volume, or support/resistance analysis.
📊 Ideal For
Swing traders analyzing monthly trend reversals
Price structure and geometry enthusiasts
Traders exploring market harmonics or square-of-nine–based frameworks
🧠 Note
The script doesn’t provide buy/sell signals — it offers a structural map of key levels derived from square relationships.
Use it as a visual guide to align entries and exits with natural market geometry.
סקריפט קוד פתוח
ברוח TradingView אמיתית, היוצר של הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יכולים לבדוק ולאמת את הפונקציונליות שלו. כל הכבוד למחבר! למרות שאתה יכול להשתמש בו בחינם, זכור שפרסום מחדש של הקוד כפוף לכללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.
סקריפט קוד פתוח
ברוח TradingView אמיתית, היוצר של הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יכולים לבדוק ולאמת את הפונקציונליות שלו. כל הכבוד למחבר! למרות שאתה יכול להשתמש בו בחינם, זכור שפרסום מחדש של הקוד כפוף לכללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.