Data & series¶
The price series and bar access every strategy reads from.
Start with the topic guide for worked examples. Signatures below show the available arguments.
Price series¶
close / open / high / low / volume / timestamp¶
indexable price/history series — close[0] is current and close[1] previous
Each field is an indexable series. Use [0] for the current value and nonnegative offsets for history; close() separately requests an exit. The property examples below use close and apply to the other field views too.
Read-only properties¶
close.df— Dataframe view of the price series; ordinary rules can use indexed values directly.close.symbols— Instrument identifiers associated with this series view.close.timeframe— Timeframe identifier for this series view.
Functions¶
security(symbol: str, timeframe: str, field: str = close, n: int = 500) -> _SecuritySeries¶
symbol is an exact instrument identifier, timeframe a supported identifier such as 1d, field one of open/high/low/close/volume (default close), and n a positive history limit (default 500). Returns an indexable series: [0] is the newest completed observation at the requested timeframe. Forming higher-timeframe bars are omitted. See timeframes.