Series and Indexing¶
Series values represent time-indexed samples with bounded history.
Market Series Forms¶
PalmScript exposes market series through source-qualified forms only:
Rules:
<alias>.<field>refers to that source on the script base interval<alias>.<interval>.<field>refers to that source on the named interval- bare market identifiers such as
closeare rejected - higher source interval references require a matching
use <alias> <interval>declaration
Current-Sample Semantics¶
When a series is used without indexing, the expression evaluates to the current sample of that series on the current execution step.
Indexing¶
Indexing has the form:
Rules:
nmust be a non-negative integer literal- dynamic indexing is rejected
- only series values may be indexed
x[0]refers to the current samplex[1]refers to the previous samplex[n]refers to the samplenupdates ago on that series' own update clock
If insufficient history exists, the indexed expression evaluates to na.
Update Clock Ownership¶
Every series advances on its own update clock.
Examples:
bn.close[1]follows the base intervalbb.1h.close[1]follows sourcebbon the one-hour clock
Derived series inherit the update clocks of their inputs. A slower series is not re-counted on faster clocks when it has not advanced.
Missing Samples¶
Series may produce na for the current sample when:
- there is insufficient history
- the source feed is missing on a base-clock step from the union of declared-source base timestamps
- the series is a higher-interval feed that has not yet closed once
- an indicator is still warming up
Time Series¶
time is a numeric series whose sample is the candle open time in Unix milliseconds UTC.
Rules:
- base
timeexposes the base-interval candle open time - higher-interval
timeexposes that higher-interval candle open time - source-qualified
timefollows the same source and interval selection rules as the price and volume fields