Rising

[[rising]] checks whether its source increases at every step in a sequence of valid values. The block returns 1.0 when every comparison is a strict increase and 0.0 as soon as the next valid value is flat or below the preceding one.

length counts strict comparisons, not observed values. With length = 3, four consecutive valid values must therefore form three increases.

Block declaration

A strategy can contain multiple [[rising]] blocks. Each block outputs one numeric series, exposed through the block id.

Examples

Minimal setup

This block checks whether the close series rises across three consecutive comparisons.

[[rising]]
id     = "rising"
length = 3

Custom source

This block applies the same test to the hlc3 source.

[[rising]]
id     = "rising_hlc3"
source = "hlc3"
length = 5

Finding the optimal length

This block explores several length values to test different durations of continuous rise.

[[rising]]
id           = "rising"
source       = "close"
length.start = 2
length.stop  = 10
length.step  = 2

Recent rise confirmation

This example uses rising to check that close rises across three consecutive comparisons. The condition becomes true when close_rising is 1.0.

[[rising]]
id     = "close_rising"
source = "close"
length = 3

[[condition]]
id            = "recent_rise_filter"
condition     = "close_rising = 1"
next_block_id = "..."

Parameters

ParameterDescription
id
 String
 Required
Unique identifier for the resulting series.
source
 String
 or Array
 Optional
Input series used for the calculation.
Accepted forms: source = "hl2" or source = ["close", "hl2"].
Each value can be either a standard price source (open, close, high, low, hl2, hlc3, ohlc4, hlcc4, volume) or the id of another indicator.
Default value: "close"
length
 Integer
 Required
Number of strictly rising comparisons to verify; it must be between 1 and 10000.

Usage:
• Fixed: length = value
• Grid search:
 – length.start = min_value
 – length.stop = max_value
 – length.step = value (optional, default 1)
symbol
 String
 or Array
 Optional
Market symbol(s) used when source only consists of standard prices (open, close, high, low, hl2, hlc3, ohlc4, hlcc4, volume).
If source mixes standard prices and indicator ids, symbol is applied only to combinations based on standard prices.
If source contains only indicator ids, symbol is ignored.
If symbol is omitted, the block inherits the symbol defined in [backtest].
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. The Rising block exposes one numeric series and its parameters (length, source, symbol, timeframe).

Assume the block is configured as:

[[rising]]
id     = "rising"
length = 3

Then:

VariableDescription
rising or rising[0]
Decimal
Current test value. It is 1.0 when the source rises across length consecutive comparisons, otherwise 0.0.
rising[n]
Decimal
Test value from n candles ago.
rising.length
Decimal
Length used for the current combination.
rising.source
String
Name of the input series.
rising.symbol
String
Market symbol used by this block.
rising.timeframe
String
Timeframe used for the computation.

Notes

  • The rising block always returns a numeric value, either 0.0 or 1.0.
  • Numeric variables can be combined freely in formulas.
  • Text variables are strings intended only for equality and inequality comparisons.