Tirone Levels: Eight Formulas and Reachable Price Conditions
This example calculates eight Tirone levels from rolling high H, rolling low L and current close C. It plots five mean-method lines using a fixed 20-bar window. Because the current bar participates in the extrema and mean, several seemingly plausible touch or breakout rules cannot occur against the current calculated levels.
Inspect the Pine ScriptEight outputs, five visible lines
Let R = H − L. The three midpoint-method outputs are top = H − R/3, center = L + R/2, and bottom = L + R/3. Top and bottom are the two third divisions; center is an additional midpoint. The three interior lines do not divide the range into three equal sections.
The mean-method anchor is A = (H + L + C)/3. Extreme High = A + R; Resistance High = 2A − L; Adjusted Mean = A; Resistance Low = 2A − H; Extreme Low = A − R. H and L come from the whole rolling window, while C is the current bar’s close. A is not an average of all closing prices in that window.
The MQL5 publication of Three Tirone Levels documents the three midpoint formulas. This page’s five-line mean variant is defined by the complete Pine source below. Match the actual formula and anchor window when comparing implementations instead of assuming the shared name guarantees identical output.
Reproduce all eight values
Use a hypothetical fully available window with H = 120, L = 90 and current close C = 108. The range is 30 and A = 106. This is arithmetic, not a market sample or backtest.
| Output | Calculation | Value |
|---|---|---|
| Top | 120 − 30/3 | 110 |
| Center | 90 + 30/2 | 105 |
| Bottom | 90 + 30/3 | 100 |
| Extreme High | 106 + 30 | 136 |
| Resistance High | 2 × 106 − 90 | 122 |
| Adjusted Mean | (120 + 90 + 108)/3 | 106 |
| Resistance Low | 2 × 106 − 120 | 92 |
| Extreme Low | 106 − 30 | 76 |
Extreme High minus Extreme Low is 2R = 60. Resistance High minus Resistance Low is R = 30. Neither width depends on C when H and L are fixed. If only close rises by 3, A and both extreme levels rise by 1, while both resistance levels rise by 2. The two extreme levels shift together, not at asymmetric speeds merely because the trend is up.
A is not necessarily the range midpoint. Here it is 106 versus midpoint 105. More generally, C > A is equivalent to C > (H + L)/2. A close above the adjusted mean is a position relative to the rolling range, not independent proof that a trend will continue.
Check whether a proposed signal is mathematically possible
For valid available OHLC data, L ≤ C ≤ H. If R is positive, Extreme High − H = A − L is at least R/3, and L − Extreme Low = H − A is at least R/3. The outer lines therefore lie strictly beyond the window extremes. Neither the current high nor low can touch its corresponding current extreme line.
The current close is also strictly between Resistance Low and Resistance High: Resistance High − C = (2H − L − C)/3 ≥ R/3, and C − Resistance Low = (C + H − 2L)/3 ≥ R/3. A current close above Resistance High or below Resistance Low cannot trigger in a nonzero range. A wick may cross a resistance line, which is a different condition.
If R = 0 and prices are valid, H, L and C coincide and all eight levels collapse to that value. Equality in this degenerate case is not evidence of an extreme move. No standard deviation, probability distribution or confidence interval enters these formulas.
Consequently, staying inside the current extreme lines for 15 bars is an algebraic consequence, not a separately validated ranging-market filter. Historical claims of repeated touches or closes outside these current levels do not fit this implementation. A level fixed on an earlier bar can be reached later, but must be identified as a previous or frozen reference.
A previous level is a separate trading specification
Starting from the example above, the prior Resistance High is 122. Suppose the next bar sets H = 125 and closes at 124 while L remains 90. The newly computed A is 113 and Resistance High is 136. Close 124 crossed the prior 122, yet remains below its own bar’s 136. Testing the previous completed value and testing the current value are different algorithms.
Before adding an entry, specify which bar fixes the level, how long it remains eligible, whether the event uses close or an intrabar extreme, and when an order can be submitted. A future current-bar level cannot justify an earlier fill. The copied indicator contains no order or alert implementation.
Changing the lookback affects retained extrema and their expiry. Increasing it cannot reduce the high-low range on the same complete data, but does not multiply that range in proportion to length. Length 30 can have exactly the same extremes as length 10. A narrower range may reflect an old extreme leaving the window and does not alone predict an imminent breakout.
Inputs, display and timeframe limits
The copied script fixes length at 20, returns eight values and plots only the five mean-method outputs. It has no length input or midpoint visibility toggle. Pineify’s separate Visual Editor configuration exposes length and drawing controls for both methods; those controls are not present in this pasted example.
The calculation executes on the active chart timeframe, with no session reset, higher-timeframe request or bar-close gate. Current high, low and close can change the live lines before close. The helper has no explicit requirement that all 20 historical bars exist; verify the intended warm-up before using the output.
Twenty four-hour bars represent 80 hours of bar intervals: about 3.33 days on a continuous 24-hour market, with different calendar coverage on session-based markets. Twenty daily bars are not universally one calendar month.
The center of a Donchian range uses (H + L)/2. An anchored Fibonacci drawing uses chosen endpoints and configured ratios, while automated variants can update endpoints. These distinctions concern construction and timing; they do not establish one method as more realistic or profitable. No measured win rate, best market or reliable touch frequency is established here.
Pine Script v6: implementation and limits
The full source retains the existing rolling formulas and five plot calls. The unused custom-source helper does not introduce an adjustable source. Inspect which level and time are referenced before adapting this indicator into a strategy.
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Pineify
//@version=6
indicator(title="Tirone Levels", overlay=true, max_labels_count=500)
// Custom price source selector
p_custom_sources() =>
[open, high, low, close, volume]
// Tirone Levels implementation
p_ta_tirone_levels(simple int length) =>
ll = ta.lowest(low, length)
hh = ta.highest(high, length)
// Midpoint method
tlh = hh - ((hh - ll) / 3)
clh = ll + ((hh - ll) / 2)
blh = ll + ((hh - ll) / 3)
// Mean method
am = (hh + ll + close) / 3
eh = am + (hh - ll)
el = am - (hh - ll)
rh = 2 * am - ll
rl = 2 * am - hh
[tlh, clh, blh, eh, rh, am, rl, el]
// Indicator call with default length 20
[p_ind_1_topLevel, p_ind_1_centerLevel, p_ind_1_bottomLevel, p_ind_1_extremeHigh, p_ind_1_resistanceHigh, p_ind_1_adjustedMean, p_ind_1_resistanceLow, p_ind_1_extremeLow] = p_ta_tirone_levels(20)
// Mean Method plots
plot(p_ind_1_extremeHigh, title="Tirone Levels - Extreme High", color=color.rgb(242, 54, 69, 0), linewidth=1)
plot(p_ind_1_resistanceHigh, title="Tirone Levels - Resistance High", color=color.rgb(242, 54, 69, 0), linewidth=1)
plot(p_ind_1_adjustedMean, title="Tirone Levels - Adjusted Mean", color=color.rgb(120, 123, 134, 0), linewidth=1)
plot(p_ind_1_resistanceLow, title="Tirone Levels - Resistance Low", color=color.rgb(76, 175, 80, 0), linewidth=1)
plot(p_ind_1_extremeLow, title="Tirone Levels - Extreme Low", color=color.rgb(76, 175, 80, 0), linewidth=1)
Specify a checkable adaptation in Pineify
Ask the Pine Script AI Coding Agent for explicit length and display controls. If researching level crossings, specify previous completed or frozen references and a confirmation policy. Verify the numeric examples, available history and execution timing before interpreting test results.
Open Pine Script AI Coding AgentEducational indicator analysis. No measured trading performance is established here. Syntax validation does not prove formula equivalence, execution assumptions or profitability.