TenkanSen
TenkanSen in ProBuilder returns the Ichimoku conversion line, the midpoint of the highest high and lowest low over 9 bars. Syntax, formula, and examples.
Syntax
TenkanSen[9,26,52]Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| first period | integer | 9 | Lookback for the TenkanSen calculation itself. |
| second period | integer | 26 | Lookback used by the KijunSen within the same Ichimoku parameter set. |
| third period | integer | 52 | Lookback used by Senkou Span B within the same Ichimoku parameter set. |
The three periods configure the whole Ichimoku system. Only the first one affects the TenkanSen value, but all three are passed so the parameter set stays consistent across the related functions.
Formula
TenkanSen = (Highest[9](high) + Lowest[9](low)) / 2The midpoint of the 9-bar price range. Note that this is a range midpoint, not an average of closes, so the line only moves when a new extreme enters or leaves the window.
How it works
Ichimoku Kinko Hyo is a five-component system, and TenkanSen (conversion line) is its fastest element. Rather than averaging prices, it marks the centre of the recent high-low range: when price trades above the line, the market is in the upper half of its 9-bar range, and below it, in the lower half.
The other components use the same construction at different horizons. KijunSen (base line) is the 26-bar range midpoint. Senkou Span A is the average of TenkanSen and KijunSen projected 26 bars forward, Senkou Span B the 52-bar midpoint projected the same way, and the area between the two spans forms the cloud (Kumo) read as support and resistance. Chikou Span plots the close 26 bars back for confirmation.
Within this system, TenkanSen plays two roles. Its slope gives an immediate short-term trend reading, since the line is flat whenever no new 9-bar extreme has printed. Its crossings with the slower KijunSen are the system's classic trigger, analogous to a fast and slow moving average cross but based on range midpoints.
Examples
Example 1, Conversion and base lines together (Indicator)
// Standard Ichimoku parameter set: 9, 26, 52
conversion = TenkanSen[9,26,52]
base = KijunSen[9,26,52]
RETURN conversion AS "Tenkan Sen", base AS "Kijun Sen"Plots the conversion line against the base line, the fast and slow pair whose crossings drive the basic Ichimoku signal.
Example 2, Manual reconstruction of the line (Indicator)
// Midpoint of the highest high and lowest low over 9 bars
TenkanSenValue = (highest[9](high) + lowest[9](low)) / 2
// Compare with the built-in function; the difference is zero
diff = TenkanSenValue - TenkanSen[9,26,52]
RETURN TenkanSenValue AS "Manual Tenkan", diff AS "Check"Rebuilds TenkanSen from highest and lowest and verifies the result against the built-in function, a useful template for non-standard periods.
Example 3, Tenkan and Kijun cross with cloud filter (ProOrder)
// Ichimoku cross, taken only above the cloud
conversion = TenkanSen[9,26,52]
base = KijunSen[9,26,52]
spanA = SenkouSpanA[9,26,52]
spanB = SenkouSpanB[9,26,52]
aboveCloud = close > MAX(spanA, spanB)
IF NOT OnMarket THEN
IF conversion CROSSES OVER base AND aboveCloud THEN
BUY 1 CONTRACT AT MARKET
ENDIF
ELSIF conversion CROSSES UNDER base THEN
SELL AT MARKET
ENDIFTakes the bullish TenkanSen cross only while price trades above both cloud boundaries, the standard strong-signal configuration, and exits on the opposite cross.
Interpretation
- Price versus the line. Price above TenkanSen places it in the upper half of the short-term range, a bullish short-term posture; below is the bearish counterpart.
- Slope and flatness. A rising line means new 9-bar highs are printing. A flat line means no new extreme has appeared, often coinciding with consolidation around the range midpoint.
- Cross with KijunSen. The conversion line crossing above the base line is the basic bullish trigger, crossing below the bearish one. Ichimoku convention grades these signals by their position relative to the cloud: above the cloud strengthens bullish crosses, below it strengthens bearish ones.
- System context. Ichimoku is designed to be read as a whole. TenkanSen in isolation is simply a fast range midpoint; the cloud and Chikou Span provide the confirmation layers.
Common errors and gotchas
- Passing a single period. The function takes the full Ichimoku triple, so
TenkanSen[9]does not compile. For a custom single-period conversion line, build it manually with(highest[N](high) + lowest[N](low)) / 2. - Expecting a moving average. TenkanSen is a range midpoint, so it stays perfectly flat during quiet stretches and jumps when an extreme leaves the window. Slope-based logic written for averages behaves differently on this line.
- Inconsistent parameter sets. Combining
TenkanSen[9,26,52]withKijunSen[10,30,60]mixes two different Ichimoku configurations. Keep the same triple across all components of one system. - Timeframe conventions. The 9, 26, 52 defaults come from the six-day Japanese trading week. They are convention, not optimisation, and behave differently on intraday charts where the periods no longer map to natural calendar units.
Related instructions
KijunSen, the 26-period base line of the Ichimoku system.SenkouSpanA, leading span A, the projected Tenkan and Kijun average.SenkouSpanB, leading span B, the projected 52-period midpoint.Highest, highest value over a window, used in the midpoint formula.Lowest, lowest value over a window, used in the midpoint formula.Average, simple moving average, the standard alternative to range midpoints.ExponentialAverage, exponentially weighted alternative trend line.
