Ichimoku Tenkan-sen

[[tenkan_sen]] produces the Ichimoku conversion line. On each candle, the block finds the highest high and lowest low from the last 9 candles, then returns the midpoint between those two extremes. The output is a numeric series in the same unit as price and is not shifted in time.

Unlike a moving average, Tenkan-sen does not combine every value in the window. It changes only when the midpoint defined by the highest high and lowest low moves, and remains flat while that midpoint stays unchanged. Its period is fixed at 9 candles in this block.

Block declaration

A strategy can contain multiple [[tenkan_sen]] blocks. The block outputs one numeric series (the Tenkan‑sen). This block is a fixed donchian_mid alias with length=9 and offset=0. No source parameter is required because this block always uses the high and low input series.

Examples

Minimal setup

[[tenkan_sen]]
id = "tenkan"

Parametric variant with donchian_mid

If you need to vary length or offset, use [[donchian_mid]]. [[tenkan_sen]] does not accept them.

Parameters

ParameterDescription
id
 String
 Required
Identifier of the Tenkan‑sen series.
symbol
 String
 or Array
 Optional
Market symbol(s) from which this block reads high and low candles. If omitted, the block inherits the [backtest] symbol. For symbol format, arrays, and alignment rules, see Exchanges, Symbols and Timeframes.
timeframe
 String
 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:

[[tenkan_sen]]
id = "tenkan"

Then:

VariableDescription
tenkan or
tenkan[0]
Decimal
Current Tenkan‑sen value.
tenkan[n]
Decimal
Tenkan‑sen value from n candles ago.
tenkan.high_source
tenkan.low_source
String
Names of the input series.
tenkan.symbol
String
Market used.
tenkan.timeframe
String
Timeframe used.

Notes

  • Numeric variables can be combined freely (arithmetic, comparisons, logical operators).
  • Text variables are intended for equality/inequality comparisons.