Quantiacs’ newer Python toolbox uses the qnt namespace and multidimensional xarray data. It should not be mixed with an older quantiacsToolbox dictionary/DataFrame example. This note focuses on loading and understanding data, not a promise that a strategy is ready for live trading.
Choose the toolbox generation
The toolbox setup file identifies the package as qnt version 0.0.507. Use that source version and its dependency constraints in an isolated Python environment; record the repository commit and resolved environment. Access to the data service requires the credentials/setup described by Quantiacs.
The following loader targets the stock-data API shown in the official documentation. It requires that configured toolbox and network/data access; it is not an offline test.
import qnt.data as qndata
data = qndata.stocks.load_spx_data(min_date="2020-01-01")
print(data.dims)
print(data.coords)
close = data.sel(field="close")
liquid = data.sel(field="is_liquid")
print(close.where(liquid > 0).isel(time=slice(-5, None)))
Inspect actual asset identifiers and field names before selecting a symbol. xarray selection uses named dimensions such as field, time, and asset rather than assuming data['CLOSE']['AAPL'] exists.
Conceptual illustration; labels describe responsibilities, not a deployment specification.
An offline shape exercise
With xarray==2024.11.0 and a compatible NumPy installation, this synthetic example illustrates selection without credentials or market downloads:
import numpy as np
import xarray as xr
sample = xr.DataArray(
np.array([[[100.0, 50.0], [101.0, np.nan], [102.0, 52.0]]]),
dims=("field", "time", "asset"),
coords={"field": ["close"], "time": ["day1", "day2", "day3"],
"asset": ["EXAMPLE:A", "EXAMPLE:B"]},
)
series = sample.sel(field="close", asset="EXAMPLE:A")
assert series.values.tolist() == [100.0, 101.0, 102.0]
assert bool(sample.sel(field="close", asset="EXAMPLE:B").isnull().any())
print(series)
The offline exercise’s synthetic values, not historical market prices. A missing value leaves a gap rather than inventing a price.
Research assumptions belong beside a result
Do not forward-fill missing observations blindly or choose only assets known to survive to today. A signal must use information available at its decision time, and execution assumptions must account for subsequent prices, costs, and liquidity. Use the toolbox’s matching backtester and output checks rather than a legacy runts call with an incompatible function signature.
A data loader, a signal, a backtest, and a live execution system are separate components. This article deliberately stops at the data contract.