Pythagorean Time Price Geometry Ver 1.0Pythagorean Time Price Geometry — Ver 1.0
By Timepricedecoder
Overview
This indicator applies W.D. Gann's Time = Price principle using Pythagorean geometry to project natural time cycles and price grid levels directly on the chart.
Gann believed that financial markets move in geometric harmony — that price and time are not independent variables, but two sides of the same equation. When they balance, the market reaches a natural turning point.
This script operationalises that idea using the Pythagorean theorem — the ancient mathematical relationship where in a right-angled triangle, the square of the hypotenuse equals the sum of squares of the other two sides (a² + b² = c²). In market terms:
Side A (time) — the number of bars in the anchor swing
Side B (price) — the range of the anchor swing (High − Low)
Side C (hypotenuse) — the natural cycle projection derived from both
By selecting a Pythagorean Triple (sets of whole numbers satisfying a² + b² = c², such as 3-4-5, 5-12-13, 8-15-17), the script scales the time-price relationship into a precise geometric ratio. This ratio then defines the grid cell size, the cycle length, and the angle of the diagonal — all derived from a single anchor swing.
The result is a self-organising grid that maps where price should find support or resistance, and when time cycles are due to complete — giving the trader a structured, geometry-based framework rather than arbitrary indicator levels.
When time and price arrive at the same Pythagorean node simultaneously — the market is squaring — and that is where the highest-probability signals are generated.
Core Concepts
Time = Price Squaring
Price range and time duration are treated as the two legs of a right triangle. When they balance — the market is at a Square — reversals or accelerations are most likely.
Pythagorean Nodes
From the anchor swing (High → Low or Low → High), the script calculates:
Sq — Square of the swing (time leg = price leg). Highest grade signal
Hyp — Hypotenuse projection. Major cycle marker
½Hyp — Half Hypotenuse. Minor cycle node
½Sq — Early warning zone
These project forward as repeating time cycles across the chart.
Harmonic Grid
Price is divided into cells derived from the Pythagorean triple ratio (B/A × Range). The grid repeats both in time (columns) and price (rows), creating a natural map of support, resistance, and time confluence.
Signal Tiers
🟨 BUY/SELL-Sq — Time node + Price grid level align. Strongest signal
🟩 BUY/SELL-T — Time node only. Moderate signal
⬜ BUY/SELL-P — Price grid level only. Weakest, disabled by default
Confluence Zones ⚡
⚡ — Quarter cycle node
⚡⚡ — Half cycle node
⚡⚡⚡ — Full cycle node (highest confluence)
Recommended Settings
StyleGann NumberDivisorTripleSwing WidthScalping221/44-3-5NarrowShort Term441/24-3-5NormalMedium Term881/23-4-5NormalLong Term176Full3-4-5Wide
InstrumentType SettingNotesOptionsOptionsGrid origin auto-adjustedIndicesIndicesUse 88, 1/2 divisorStocksStocksUse Adaptive stabilityFuturesFuturesUse 44 or 88
Grid Stability
Strict — Anchors rarely shift. Best for trending markets
Adaptive — Default. Balances stability and responsiveness
Relaxed — Reanchors more freely. Best for ranging markets
How To Use
Let the script auto-detect the swing anchor (or set manually)
Watch for Sq labels on vertical cycle lines — these are key dates
Enter on BUY-Sq / SELL-Sq signals with candle confirmation
Use ⚡⚡⚡ confluence zones as high-alert turning point windows
The active zone box shows current grid cell position (Upper = bullish bias, Lower = bearish bias)
Disclaimer
This script is published for educational purposes only. It does not constitute financial advice. Past signal accuracy does not guarantee future results. The swing detection uses Daily OHLC data with lookahead enabled — results may differ slightly on live bars versus historical bars. Always use proper risk management. Trade at your own risk. Indicator

Gann Square of 9 Vibration Levels [LuxAlgo]The Gann Square of 9 Vibration Levels indicator provides a technical framework for identifying potential support and resistance levels based on Gann's "Square of 9" mathematical relationships.
🔶 USAGE
This tool calculates price "vibrations" or displacements from a specific anchor point using angular degrees. In Gann theory, specific angles (90°, 180°, etc.) are believed to represent points of high resonance where price action is likely to stall or reverse.
The indicator offers two primary methods for anchoring:
Auto Pivot: Automatically detects recent high or low pivots based on a user-defined lookback period. If a new low is found, it calculates upward vibrations; if a new high is found, it calculates downward vibrations.
Manual: Allows the user to input a specific price point to act as the "Square of 9" center, from which all angular levels are projected.
Traders can use these levels to anticipate market turns or set price targets. When price approaches a Cardinal or Ordinal level, it may indicate a zone of exhaustion or a breakout point.
🔶 DETAILS
The script utilizes the core Gann Square of 9 formula to translate angular degrees into price levels:
Price = (sqrt(Anchor) + (Degree / 180) * Direction)^2
The indicator distinguishes between two types of vibration levels:
🔹 Cardinal Levels (90°, 180°, 270°, 360°): These represent the "cross" in the Square of 9 and are traditionally considered the strongest points of vibration. They are displayed with solid lines.
🔹 Ordinal Levels (45°, 135°, 225°, 315°): These represent the "corners" of the Square of 9 and provide secondary points of interest. They are displayed with dashed lines.
The inclusion of a real-time dashboard provides a quick reference for the current anchor price, the specific degree of each active level, and its corresponding price value, ensuring traders can see exact targets without cluttering the main chart area.
🔶 SETTINGS
🔹 Calculation Settings
Anchor Type: Choose between "Auto pivot" (dynamic) or "Manual" (static) price anchoring.
Manual Anchor Price: The price used for calculations when Anchor Type is set to Manual.
Pivot Lookback: The number of bars used to detect high/low pivots for the Auto mode.
Vibration Direction: Determines if the indicator projects levels "Up", "Down", or in "Both" directions from the anchor.
🔹 Visual Settings
Show Cardinal Levels (90°): Toggles the visibility of the primary cross levels.
Show Ordinal Levels (45°): Toggles the visibility of the secondary corner levels.
Show Level Labels: Displays the degree and price value next to each line on the chart.
Cardinal/Ordinal Color: Customizes the colors for the different level types.
🔹 Dashboard
Dashboard: Enables or disables the on-screen data table.
Position: Moves the dashboard to different corners of the chart.
Size: Adjusts the scale of the dashboard text and cells.
Indicator

Indicator

Indicator

Statistics • Chi Square • P-value • SignificanceThe Statistics • Chi Square • P-value • Significance publication aims to provide a tool for combining different conditions and checking whether the outcome is significant using the Chi-Square Test and P-value.
🔶 USAGE
The basic principle is to compare two or more groups and check the results of a query test, such as asking men and women whether they want to see a romantic or non-romantic movie.
–––––––––––––––––––––––––––––––––––––––––––––
| | ROMANTIC | NON-ROMANTIC | ⬅︎ MOVIE |
–––––––––––––––––––––––––––––––––––––––––––––
| MEN | 2 | 8 | 10 |
–––––––––––––––––––––––––––––––––––––––––––––
| WOMEN | 7 | 3 | 10 |
–––––––––––––––––––––––––––––––––––––––––––––
|⬆︎ SEX | 10 | 10 | 20 |
–––––––––––––––––––––––––––––––––––––––––––––
We calculate the Chi-Square Formula, which is:
Χ² = Σ ( (Observed Value − Expected Value)² / Expected Value )
In this publication, this is:
chiSquare = 0.
for i = 0 to rows -1
for j = 0 to colums -1
observedValue = aBin.get(i).aFloat.get(j)
expectedValue = math.max(1e-12, aBin.get(i).aFloat.get(colums) * aBin.get(rows).aFloat.get(j) / sumT) //Division by 0 protection
chiSquare += math.pow(observedValue - expectedValue, 2) / expectedValue
Together with the 'Degree of Freedom', which is (rows − 1) × (columns − 1) , the P-value can be calculated.
In this case it is P-value: 0.02462
A P-value lower than 0.05 is considered to be significant. Statistically, women tend to choose a romantic movie more, while men prefer a non-romantic one.
Users have the option to choose a P-value, calculated from a standard table or through a math.ucla.edu - Javascript-based function (see references below).
Note that the population (10 men + 10 women = 20) is small, something to consider.
Either way, this principle is applied in the script, where conditions can be chosen like rsi, close, high, ...
🔹 CONDITION
Conditions are added to the left column ('CONDITION')
For example, previous rsi values (rsi ) between 0-100, divided in separate groups
🔹 CLOSE
Then, the movement of the last close is evaluated
UP when close is higher then previous close (close )
DOWN when close is lower then previous close
EQUAL when close is equal then previous close
It is also possible to use only 2 columns by adding EQUAL to UP or DOWN
UP
DOWN/EQUAL
or
UP/EQUAL
DOWN
In other words, when previous rsi value was between 80 and 90, this resulted in:
19 times a current close higher than previous close
14 times a current close lower than previous close
0 times a current close equal than previous close
However, the P-value tells us it is not statistical significant.
NOTE: Always keep in mind that past behaviour gives no certainty about future behaviour.
A vertical line is drawn at the beginning of the chosen population (max 4990)
Here, the results seem significant.
🔹 GROUPS
It is important to ensure that the groups are formed correctly. All possibilities should be present, and conditions should only be part of 1 group.
In the example above, the two top situations are acceptable; close against close can only be higher, lower or equal.
The two examples at the bottom, however, are very poorly constructed.
Several conditions can be placed in more than 1 group, and some conditions are not integrated into a group. Even if the results are significant, they are useless because of the group formation.
A population count is added as an aid to spot errors in group formation.
In this example, there is a discrepancy between the population and total count due to the absence of a condition.
The results when rsi was between 5-25 are not included, resulting in unreliable results.
🔹 PRACTICAL EXAMPLES
In this example, we have specific groups where the condition only applies to that group.
For example, the condition rsi > 55 and rsi <= 65 isn't true in another group.
Also, every possible rsi value (0 - 100) is present in 1 of the groups.
rsi > 15 and rsi <= 25 28 times UP, 19 times DOWN and 2 times EQUAL. P-value: 0.01171
When looking in detail and examining the area 15-25 RSI, we see this:
The population is now not representative (only checking for RSI between 15-25; all other RSI values are not included), so we can ignore the P-value in this case. It is merely to check in detail. In this case, the RSI values 23 and 24 seem promising.
NOTE: We should check what the close price did without any condition.
If, for example, the close price had risen 100 times out of 100, this would make things very relative.
In this case (at least two conditions need to be present), we set 1 condition at 'always true' and another at 'always false' so we'll get only the close values without any condition:
Changing the population or the conditions will change the P-value.
In the following example, the outcome is evaluated when:
close value from 1 bar back is higher than the close value from 2 bars back
close value from 1 bar back is lower/equal than the close value from 2 bars back
Or:
close value from 1 bar back is higher than the close value from 2 bars back
close value from 1 bar back is equal than the close value from 2 bars back
close value from 1 bar back is lower than the close value from 2 bars back
In both examples, all possibilities of close against close are included in the calculations. close can only by higher, equal or lower than close
Both examples have the results without a condition included (5 = 5 and 5 < 5) so one can compare the direction of current close.
🔶 NOTES
• Always keep in mind that:
Past behaviour gives no certainty about future behaviour.
Everything depends on time, cycles, events, fundamentals, technicals, ...
• This test only works for categorical data (data in categories), such as Gender {Men, Women} or color {Red, Yellow, Green, Blue} etc., but not numerical data such as height or weight. One might argue that such tests shouldn't use rsi, close, ... values.
• Consider what you're measuring
For example rsi of the current bar will always lead to a close higher than the previous close, since this is inherent to the rsi calculations.
• Be careful; often, there are na -values at the beginning of the series, which are not included in the calculations!
• Always keep in mind considering what the close price did without any condition
• The numbers must be large enough. Each entry must be five or more. In other words, it is vital to make the 'population' large enough.
• The code can be developed further, for example, by splitting UP, DOWN in close UP 1-2%, close UP 2-3%, close UP 3-4%, ...
• rsi can be supplemented with stochRSI, MFI, sma, ema, ...
🔶 SETTINGS
🔹 Population
• Choose the population size; in other words, how many bars you want to go back to. If fewer bars are available than set, this will be automatically adjusted.
🔹 Inputs
At least two conditions need to be chosen.
• Users can add up to 11 conditions, where each condition can contain two different conditions.
🔹 RSI
• Length
🔹 Levels
• Set the used levels as desired.
🔹 Levels
• P-value: P-value retrieved using a standard table method or a function.
• Used function, derived from Chi-Square Distribution Function; JavaScript
LogGamma(Z) =>
S = 1
+ 76.18009173 / Z
- 86.50532033 / (Z+1)
+ 24.01409822 / (Z+2)
- 1.231739516 / (Z+3)
+ 0.00120858003 / (Z+4)
- 0.00000536382 / (Z+5)
(Z-.5) * math.log(Z+4.5) - (Z+4.5) + math.log(S * 2.50662827465)
Gcf(float X, A) => // Good for X > A +1
A0=0., B0=1., A1=1., B1=X, AOLD=0., N=0
while (math.abs((A1-AOLD)/A1) > .00001)
AOLD := A1
N += 1
A0 := A1+(N-A)*A0
B0 := B1+(N-A)*B0
A1 := X*A0+N*A1
B1 := X*B0+N*B1
A0 := A0/B1
B0 := B0/B1
A1 := A1/B1
B1 := 1
Prob = math.exp(A * math.log(X) - X - LogGamma(A)) * A1
1 - Prob
Gser(X, A) => // Good for X < A +1
T9 = 1. / A
G = T9
I = 1
while (T9 > G* 0.00001)
T9 := T9 * X / (A + I)
G := G + T9
I += 1
G *= math.exp(A * math.log(X) - X - LogGamma(A))
Gammacdf(x, a) =>
GI = 0.
if (x<=0)
GI := 0
else if (x
Chisqcdf = Gammacdf(Z/2, DF/2)
Chisqcdf := math.round(Chisqcdf * 100000) / 100000
pValue = 1 - Chisqcdf
🔶 REFERENCES
mathsisfun.com, Chi-Square Test
Chi-Square Distribution Function
Indicator

Indicator

Strategy

Gann Square of 144This indicator will create lines on the chart based on W.D. Gann's Square of 144. All the inputs will be detailed below
Why create this indicator?
I didn't find it on Tradingview (at least with open source). But the main reason is to study the strategy and be able to draw it fast. Manually drawing the square is not hard, but moving all together to the right spots and scale was time-consuming.
It has a lot of inputs...
Yes, each square point divisible by 6 has information with some options, so the user can create any configuration he wants. Also, it has the advantage of having the square built in seconds and adjusting itself on each new calculation.
About the inputs
Starting Date
This input will be used when the "Set Upper/Lower Prices and Start Bar Automatically" checkbox is not selected. The indicator will calculate all the line locations on the chart using the selected start date. When selecting this input, change the Manual Max and Min Prices to the better calculation
Manual Max/Min Price
This input will be used when the "Set Upper/Lower Prices and Start Bar Automatically" checkbox is not selected. The indicator will calculate all the line's locations on the chart using these prices
Set Upper/Lower Prices and Start Bar Automatically
Selects if the starting date will be automatically selected by the system or based on the input data. When it's set, the indicator will use the most recent bar as the middle point of the square, using the higher price as the Upper Price and the lowest price as the Lower Price in the latest 72 bars (or more based on the Candles Per Division parameter)
Update at a new bar
When this option is market, the indicator will update all created lines to match the new bar position, together with all the possible new Upper/Lower prices. Let it unchecked to watch the progression of the price while the square remains fixed in the chart.
Top X-Axis
When checked, it will display the labels on the Top of the square
Bottom X-Axis
When checked, it will display the labels on the Bottom of the square
Left X-Axis
When checked, it will display the labels on the left of the square
Right X-Axis
When checked, it will display the labels on the right of the square
Show Prices on the Right Y-Axis
When checked, it will display the prices together with the labels on the right of the square
Show Vertical Divisions
Show the lines that will divide the square into 9 equal parts
Show Extra Lines
Show unique lines that will come from the Top and bottom middle of the square, connecting the center to the 36 and 108 levels
Show Grid
When selected, it will display a grid in the square
Line Patterns
A selector with some options of built-in lines configuration. When any option besides None is selected, it will override the lines inputs below
Numbers Color
Select the color of each number on the Axis
Vertical Lines Color
Select the color of the vertical lines
Grid Color
Select the grid line color
Connections from corners to N
Each corner is represented by 2 characters, so they all fit in a single line
It will indicate where the line starts and where it ends
┏ ↓ = Top Left to Bottom
┏ → = Top Left to Right
┗ ↑ = Bottom Left to Top
┗ → = Bottom Left to Right
┓ ← = Top Right to Left
┓ ↓ = Top Right to Bottom
┛ ← = Bottom Right to Left
┛ ↑ = Bottom Right to Top
Besides selecting what line will be created, it's possible to select the color, the style, and the extension
How to use this indicator
When you dig into Gann's books for more information about the square of 144, you find that it was part of his setup with multiple indicators (technical and fundamental, and astrological). It is not a "one indicator" setup, so it's hard to say that you will find entries, exits, stop loss, and take profit in this. Still, it will help see trendiness, support, and resistance levels.
Mixing this with other indicators is probably a good idea, but some may find this indicator the only one needed.
Some aspects of the square
The end of the square is important, so where it starts is crucial. The end is important because it is where the price and time expire. The other parts of the square are defined based on their start and end, so placing them right is essential.
So, where to set the start of the square?
The last major low is the most indicated. The minimum price will be the lowest, and the max price will be the last major Top. Note that the indicator uses 1 candle on each point.
After finding the start, the minimum, and the maximum prices for the square, it will draw all lines. Another essential part of the square is The Midpoint.
The midpoint is the most crucial part of the square and is the best way to see if you positioned the square correctly. When the price is inside the square, using the starting candle as the start, a second higher low or a lower high occurs in that spot. When using the Vertical lines in the indicator, it's the middle square inside Gann's square.
The other divisions will be opposing each other most of the time. So if the price is rising in the 1/3 of the square, it's common to see the price fall in the 3/3 of the square.
More information about these aspects here
Considerations
This indicator was meant for price targets and a time calculator for possible support/resistances in the chart. It was created by William Delbert Gann and was part of his setup for trading almost a century ago. The lines will form geometric figures, which Gann used with high accuracy to predict tops/bottoms and when they would occur.
Indicator

Indicator

Indicator

Indicator

Indicator
