TT Square of 9 Inner

The Square of 9 is an infinite sequence of numbers arranged in a clockwise pattern around a square.
This can be used to calculate price and time lines based on the angle of the price or time value relative to the center cell.
Adding to a Chart
After adding the script to your chart, you are prompted to confirm the price and time to anchor the indicator to. Click on a major pivot high or low price to get the best results.
Anchor Point
The anchor time and price identify where the script starts counting time and price from. You can change it on the Settings dialog, or by right-clicking the indicator on the chart and choosing 'Reset Points'.
Price Lines
Price Lines display horizontal lines at specific prices, relative to the anchor price, and are calculated based on the following inputs:
Price per Cell is used to scale the Square of 9 and allows it to work on both low priced securities like
The price of the security divided by the price per cell should be in the 3-4 digit range.
For example Bitcoin (currently +/- $100,000) should have a price per cell of around 100, because 100,000 / 100 = 1,000 which is 4 digits. There is no hard and fast rule here. You could use 50 or 200 depending on your use case.
Price Angles allow you to choose how many lines to show with each lap that price makes around the Square of 9.
- 0° prices shows a price line with every completed cycle around the Square of 9.
- 180° prices shows a price line with every half cycle around the Square of 9.
- 120° and 240° prices shows a price line with every 1/3 of a cycle around the Square of 9.
- 90° and 270° prices shows a price line with every 1/4 of a cycle around the Square of 9.
To get more price lines on the chart, reduce the Price Per Cell.
To get fewer price lines on the chart, increase the Price Per Cell.
This is an example of price lines effectively identifying support and resistance levels, anchored to the low of the lowest wick. The red (0°) and yellow (180°) lines identify good support/resistance lines.
Time Lines
Time Lines are more complex than price lines because there are multiple ways to count time, whereas there's only one way to count price.
Time Lines display vertical lines at calculated based on the following inputs:
- 0° times shows a time line with every completed Square of 9 cycle that the selected Time Factors make.
- 180° times show a time line with every half-cycle around the Square of 9 for the selected Time Factors.
- 120° and 240° times show a time line with every 1/3 of a cycle around the Square of 9.
- 90° and 270° times show a time line with every 1/4 of a cycle around the Square of 9.
Time Factors
Time Factors are used to measure time.
This script supports the following time factors:
- Calendar Days: The number of calendar days from the anchor point.
- Weeks: The number of weeks from the anchor point.
- Ascendant: The degrees of movement of the ascendant at the specified location from the anchor point.
- Sidereal Moon: The degrees of movement of the Moon relative to the background stars (sidereal) from the anchor point.
- Synodic Moon: The degrees of movement of the Moon relatie to the Sun (Moon/Sun Synodic) from the anchor point. This is the same as the lunar phase.
- Mercury Helio: The degrees of movement of heliocentric Mercury from the anchor point.
- Venus Helio: The degrees of movement of heliocentric Venus from the anchor point.
- Sun: The degrees of movement of the Sun from the anchor point.
- Mars Helio: The degrees of movement of heliocentric Mars from the anchor point.
- Mercury/Venus Synodic: The degrees of movement of the Mercury/Venus synodic pair from the anchor point.
- Mercury/Earth Synodic: The degrees of movement of the Mercury/Earth synodic pair from the anchor point.
- Mercury/Mars Synodic: The degrees of movement of the Mercury/Mars synodic pair from the anchor point.
- Venus/Earth Synodic: The degrees of movement of the Venus/Earth synodic pair from the anchor point.
- Venus/Mars Synodic: The degrees of movement of the Venus/Mars synodic pair from the anchor point.
- Earth/Mars Synodic: The degrees of movement of the Earth/Mars synodic pair from the anchor point.
Use time lines to look for potential changes in trend around those times.
Troubleshooting
Missing Price Lines
Sometimes you will notice price lines are missing. This usually means that the Price per Cell is too large. For example, you may have a Price per Cell of 1 for a security that trades at $1.50. You can solve this by ensuring the security price divided by Price per Cell has 3 or 4 digits. So in this example, change Price per Cell to 0.001
Another explanation for missing price lines is that no price lines are selected. You'll need to select at least one of the 4 price line options to see a price line.
Missing Time Lines
If all time lines are missing, that could be due to the following reasons:
* No time lines are selected.
* The time line selected doesn't align with the chart timeframe. For example if you choose a slow time line like 'Weeks' for an intraday chart, you likely won't see a line.
Uneven Price Lines
Price lines are drawn based on the progress of price around the square of 9, and the size of the square increases as price increases. So the distance between price lines will increase as price goes up, and decrease as price goes down.
This is expected behaviour.
Uneven Time Lines
Time lines are drawn based on the progress of time (calendar days, weeks, or degrees) around the square of 9, and the size of the square increases as price increases. Plus some of the time factors are elliptical like the Ascendant (moves faster during some parts of the day than others), and Mercury. This fact combined with the increasing size of the square of 9 can make the time lines appear asymmetric with some closer and others farther apart.
This is expected behaviour.
Runtime Error
You will occasionally see a runtime error like below:
This happens when a Square of 9 indicator is anchored to a point say 6 months ago, and you drop down to a 4 minute chart. There's simply too many bars between the anchor point and the current point in time.
To workaround this issue, change your chart interval to a higher timeframe like 30 minutes or 4 hours to reduce the number of bars the script needs to analyze.
Display the time factor values and Square of 9 angles in the Data Window
Script su invito
Solo gli utenti approvati dall'autore possono accedere a questo script. È necessario richiedere e ottenere l'autorizzazione per utilizzarlo. Tale autorizzazione viene solitamente concessa dopo il pagamento. Per ulteriori dettagli, seguire le istruzioni dell'autore riportate di seguito o contattare direttamente yyctrade.
Si noti che questo script privato, ad invito, non è stato esaminato dai moderatori e la sua conformità con il Regolamento non è stata accertata. TradingView NON consiglia di pagare o utilizzare uno script a meno che non ci si fidi pienamente del suo autore e non si comprenda il suo funzionamento. Puoi anche trovare alternative gratuite e open-source nei nostri script della comunità.
Istruzioni dell'autore
Attenzione: prima di richiedere l'accesso, leggi la nostra guida per gli script su invito.
Declinazione di responsabilità
Script su invito
Solo gli utenti approvati dall'autore possono accedere a questo script. È necessario richiedere e ottenere l'autorizzazione per utilizzarlo. Tale autorizzazione viene solitamente concessa dopo il pagamento. Per ulteriori dettagli, seguire le istruzioni dell'autore riportate di seguito o contattare direttamente yyctrade.
Si noti che questo script privato, ad invito, non è stato esaminato dai moderatori e la sua conformità con il Regolamento non è stata accertata. TradingView NON consiglia di pagare o utilizzare uno script a meno che non ci si fidi pienamente del suo autore e non si comprenda il suo funzionamento. Puoi anche trovare alternative gratuite e open-source nei nostri script della comunità.
Istruzioni dell'autore
Attenzione: prima di richiedere l'accesso, leggi la nostra guida per gli script su invito.