Ichimoku Senkou Span A
[[senkou_span_a]] produces one of the two boundaries of the Ichimoku cloud. It calculates each value by averaging Tenkan-sen and Kijun-sen, which are the midpoints of high/low ranges measured over different horizons. tenkan_length and kijun_length define those two horizons.
The result is then shifted forward by offset candles. This projection is a timing offset, not a forecast: the value available on a candle comes from a calculation made offset candles earlier. Senkou Span A and Senkou Span B form the two boundaries of the cloud.
Block declaration
A strategy can contain multiple [[senkou_span_a]] blocks. The block outputs one numeric series (Senkou Span A, shifted +26). No source parameter is required because this block always uses the high and low input series.
Examples
Minimal setup
[[senkou_span_a]]
id = "ssa"Custom fixed setup
This block uses custom tenkan_length, kijun_length, and offset values.
[[senkou_span_a]]
id = "ssa"
tenkan_length = 8
kijun_length = 27
offset = 27Configuring ranges
In this variant, tenkan_length, kijun_length, and offset are defined as ranges so one back-test runs for each parameter combination.
[[senkou_span_a]]
id = "ssa"
tenkan_length.start = 7
tenkan_length.stop = 11
kijun_length.start = 24
kijun_length.stop = 28
offset.start = 24
offset.stop = 28Parameters
| Parameter | Description |
|---|---|
idString Required | Identifier of the Senkou Span A series. |
tenkan_lengthInteger Optional | Tenkan length; must be ≥ 1. Default value: 9.Usage: • Fixed: tenkan_length = value• Grid search: – tenkan_length.start = min_value– tenkan_length.stop = max_value– tenkan_length.step = value (optional, default 1) |
kijun_lengthInteger Optional | Kijun length; must be ≥ 1. Default value: 26.Usage: • Fixed: kijun_length = value• Grid search: – kijun_length.start = min_value– kijun_length.stop = max_value– kijun_length.step = value (optional, default 1) |
offsetInteger Optional | Positive forward projection applied to the computed series; must be ≥ 0. Default value: 26.Usage: • Fixed: offset = value• Grid search: – offset.start = min_value– offset.stop = max_value– offset.step = value (optional, default 1) |
symbolString or Array Optional | Market symbol(s) from which this block reads its candles (high, low, close). If omitted, the block inherits the [backtest] symbol. For symbol format, arrays, and alignment rules, see Exchanges, Symbols and Timeframes. |
timeframeString or Array Optional | Timeframe on which this indicator is computed. If timeframe is omitted, the computation uses the grid’s main timeframe defined in [backtest].For accepted formats and timeframe alignment rules, see Exchanges, Symbols and Timeframes. |
Available variables
Use the identifiers below directly in your expressions.
Assume the block is configured as:
[[senkou_span_a]]
id = "ssa"
tenkan_length = 9
kijun_length = 26
offset = 26Then:
| Variable | Description |
|---|---|
ssa or ssa[0]Decimal | Current Senkou Span A value (series already shifted by +offset). |
ssa[n]Decimal | Senkou Span A value from n candles ago. |
ssa.ssa_len_tInteger | Tenkan length used. |
ssa.ssa_len_kInteger | Kijun length used. |
ssa.ssa_offsetInteger | Forward projection applied to the series. |
ssa.high_sourcessa.low_sourceString | Names of the input series. |
ssa.symbolString | Symbol used. |
ssa.timeframeString | Timeframe used. |
Notes
- Numeric variables can be combined freely (arithmetic, comparisons, logical operators).
- Text variables are intended for equality/inequality comparisons.