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提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。