INVITE-ONLY SCRIPT
已更新 TT Square of 9 Inner

Display price and time lines derived from WD Gann's Square of 9.
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
SHIB and high priced assets like $BTC.
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.
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:
Time Factors
Time Factors are used to measure time.
This script supports the following time factors:
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.
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.
版本注释
Minor performance updates.版本注释
Fix bug when the most recent bar sets an ATH.版本注释
Fix bug affecting the line style of price lines.版本注释
Add more price lines below the lowest price.版本注释
Add more price lines above the highest high and below the lowest low.版本注释
Add seconds, minutes, and hours as time factors.版本注释
Add optional labels to identify square out points.版本注释
Performance improvements版本注释
Use optimized Moon library版本注释
Correct bug affecting the display of the square out points when the anchor point is not visible on the chart.版本注释
Correct bug preventing the display of synodic time factors.版本注释
Add bar count as a supported time factorDisplay the time factor values and Square of 9 angles in the Data Window
版本注释
Correct error by upgrading the Venus helio library to v6版本注释
Update method of drawing future time lines.版本注释
Update to calculate square of 9 time bars based on the timestamp of the end time of the bar.版本注释
Correct issue with counting degrees on the first bar.版本注释
Correct bug in calculating calendar days and calendar weeks.版本注释
Correct issue with bar count time factor.版本注释
Use the latest Moon library with a minor calculation correction.版本注释
Update with data through 2026仅限邀请脚本
只有作者授权的用户才能访问此脚本。您需要申请并获得使用许可。通常情况下,付款后即可获得许可。更多详情,请按照下方作者的说明操作,或直接联系yyctrade。
请注意,此私密、仅限邀请脚本未经脚本版主审核,是否符合网站规则尚未确定。 TradingView不建议您付费购买或使用任何脚本,除非您完全信任其作者并了解其工作原理。您也可以在我们的社区脚本找到免费的开源替代方案。
作者的说明
This script is part of the Time Trades service. To get access sign up at time-trades.com Refer to the User Guide here: https://publish.obsidian.md/time-trades/Getting+Started/What+Is+Time+Trades
Time Trades is a data service that combines machine learning and Gann techniques to provide time centric forecasts. These are intended to be combined with your existing price analysis to provide a trading edge.
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
仅限邀请脚本
只有作者授权的用户才能访问此脚本。您需要申请并获得使用许可。通常情况下,付款后即可获得许可。更多详情,请按照下方作者的说明操作,或直接联系yyctrade。
请注意,此私密、仅限邀请脚本未经脚本版主审核,是否符合网站规则尚未确定。 TradingView不建议您付费购买或使用任何脚本,除非您完全信任其作者并了解其工作原理。您也可以在我们的社区脚本找到免费的开源替代方案。
作者的说明
This script is part of the Time Trades service. To get access sign up at time-trades.com Refer to the User Guide here: https://publish.obsidian.md/time-trades/Getting+Started/What+Is+Time+Trades
Time Trades is a data service that combines machine learning and Gann techniques to provide time centric forecasts. These are intended to be combined with your existing price analysis to provide a trading edge.
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。