Plain object keyed by position age in minutes; the value
of the largest key <= age is in effect, null disables the threshold
for that stage
Static_getContext-free resolution of the value for a signal's age.
Receives the full context as arguments — no execution context required.
Age is computed as (when - pendingAt) / 1min from the logical timestamp.
Plain object keyed by position age in minutes
Pending timestamp in milliseconds (when position became active)
Logical timestamp at which the read is happening
Matched value or null
Static_matchContext-free step-function resolution against an explicit age.
Object keys are cast from string to number before matching.
Returns the value of the largest key <= dto.minutesActive (which may
itself be null), or null when the age is below the smallest key
(or the dictionary is empty).
Plain object keyed by position age in minutes
Position age in minutes
Matched value or null
Resolve the value for the CURRENT pending signal's age. Resolves the signal, mode and timestamp from execution context — no context arguments required.
Matched value, or null when there is no pending signal
(position not open yet), no key <= age, or the matched stage is null
Step-function resolution of this instance's dictionary against an explicit age.
Position age in minutes
Matched value or null
Step-function lookup keyed by position age in minutes.
Wraps a plain
Record<number, number | null>dictionary where the key is the minute the threshold starts to apply and the value is the threshold itself (nullmarks a stage with no threshold). Object keys are strings at runtime — they are cast back to numbers internally. Resolution picks the value of the LARGEST key that is<= age; past the last key the last value stays in effect indefinitely.Like State, the class is split into context-free statics and context-bound instance methods:
Level._getValue(levelMap, dto)receives the full context as arguments, while instancegetValue()takes no arguments — it resolves the pending signal, mode and logical timestamp frombacktest.executionContextService/backtest.methodContextService, so it is only available inside strategy lifecycle callbacks (e.g.listenActivePing). Position age is measured from the signal'spendingAtto the logicalwhenof the current tick — never from wall-clock time.Primary use case — dynamic time stop: the loss tolerance (in % pnl) narrows as the position ages, with thresholds derived from winner trajectories.
Example
Example