SenkouSpanA
SenkouSpanA in ProBuilder returns the leading Ichimoku Cloud boundary, the average of Tenkan-Sen and Kijun-Sen projected forward. Syntax, formula, examples.
Syntax
SenkouSpanA[tenkanPeriod, kijunPeriod, displacement]The function takes no price argument. It is computed from the instrument's highs and lows.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
tenkanPeriod | integer | 9 | Lookback for the Tenkan-Sen (conversion line), the midpoint of the highest high and lowest low over this many bars. |
kijunPeriod | integer | 26 | Lookback for the Kijun-Sen (base line), the midpoint of the highest high and lowest low over this many bars. |
displacement | integer | 26 | Number of bars the span is projected forward on the chart. |
Formula
TenkanSen = (Highest[tenkanPeriod](high) + Lowest[tenkanPeriod](low)) / 2
KijunSen = (Highest[kijunPeriod](high) + Lowest[kijunPeriod](low)) / 2
SenkouSpanA = (TenkanSen + KijunSen) / 2, plotted displacement bars aheadHow it works
Senkou Span A is one of the five lines of the Ichimoku Kinko Hyo system and forms one edge of the Kumo, or cloud. On each bar, ProBuilder averages the Tenkan-Sen and Kijun-Sen midlines and shifts the result forward by displacement bars. Together with SenkouSpanB, the space between the two spans defines the cloud that traders read as a zone of prospective support and resistance.
Because of the forward shift, the cloud value displayed at the current bar was calculated from price data displacement bars in the past. Senkou Span A reacts faster than Senkou Span B since its inputs use shorter lookbacks, so the relative position of the two spans (A above B or B above A) is commonly used to classify the cloud as bullish or bearish.
Examples
Example 1, Plotting the cloud boundaries (Indicator)
// Leading cloud line with default Ichimoku settings
mySenkouSpanA = SenkouSpanA[9, 26, 26]
spanB = SenkouSpanB[9, 26, 52]
RETURN mySenkouSpanA AS "Senkou Span A", spanB AS "Senkou Span B"Computes both cloud boundaries with the classic 9/26/52 configuration and plots them as two lines. The area between them corresponds to the Kumo.
Example 2, Instruments trading above the cloud (ProScreener)
spanA = SenkouSpanA[9, 26, 26]
spanB = SenkouSpanB[9, 26, 52]
cloudTop = MAX(spanA, spanB)
SCREENER[close > cloudTop](close - cloudTop AS "Distance above cloud")Selects instruments whose last price sits above the upper cloud edge, a standard Ichimoku definition of an established uptrend, and ranks them by distance above the cloud.
Example 3, Cloud filter for long entries (ProOrder)
// Trade long only while the cloud is bullish and price holds above it
spanA = SenkouSpanA[9, 26, 26]
spanB = SenkouSpanB[9, 26, 52]
bullishCloud = spanA > spanB
IF NOT LongOnMarket AND bullishCloud AND close > spanA THEN
BUY 1 CONTRACT AT MARKET
ELSIF LongOnMarket AND close < spanB THEN
SELL AT MARKET
ENDIFUses the span ordering as a regime filter and exits when price falls through the far side of the cloud.
Interpretation
| Condition | Reading |
|---|---|
| Price above both spans | Uptrend, cloud acts as support below price. |
| Price below both spans | Downtrend, cloud acts as resistance above price. |
| Price inside the cloud | No clear trend, signals are considered unreliable. |
| Span A above Span B | Bullish cloud (often shaded green). |
| Span B above Span A | Bearish cloud (often shaded red). |
A thick cloud implies a wider support or resistance zone, a thin cloud implies a weaker one that price crosses more readily. Crossings of Span A and Span B are sometimes read as slow trend-change confirmations, well after faster signals such as the Tenkan/Kijun cross.
Common errors and gotchas
- No price argument.
SenkouSpanA[9, 26, 26](close)is invalid. The function is bracket-only and always works from the instrument's highs and lows. - Built-in lag from displacement. The span visible at the current bar derives from data roughly
displacementbars old. Systems that condition on the cloud react late by design, which is intentional in Ichimoku but surprising when compared with non-shifted indicators. - Half the cloud is not the cloud. Testing
close > SenkouSpanA[9, 26, 26]alone ignores Span B. When Span B is above Span A, price can be above Span A yet still inside the cloud. - Whipsaw in ranging markets. In flat conditions the cloud is thin and price crosses it frequently. Cloud-based entries without an additional trend or volatility filter tend to generate rapid alternating signals.
Related instructions
TenkanSen, the Ichimoku conversion line, first input to Span A.KijunSen, the Ichimoku base line, second input to Span A.SenkouSpanB, the slower cloud boundary paired with Span A.Highest, highest value over a lookback, the building block of the midlines.Lowest, lowest value over a lookback.Average, simple moving average for alternative trend baselines.Supertrend, another trend-following support and resistance line.SAR, parabolic stop and reverse, a trailing trend indicator.
