Skip to content

aether_quant.hello

The hello world as a library call (V6.6.5): what aq hello does, for a notebook or a script.

The hello world as a library call (V6.6.5): what aq hello does, for a notebook or a script.

from aether_quant import hello report = hello.run(offline=True) # the bundled sample; offline=False downloads from Coinbase's public candles print(hello.render_text(report)) report.equity.plot() # the shipped rule's equity curve (needs matplotlib)

HELLO_RULE module-attribute

HELLO_RULE: dict[str, object] = {'id': 't3_crypto_trend_blend_x_eos', 'kind': 'time_series', 'family': 'crypto_trend', 'universe': ['crypto'], 'rebalance_every': 5, 'params': {'lookback_a': 20, 'lookback_b': 60, 'lookback_c': 120}}

RESEARCH_TRIALS module-attribute

RESEARCH_TRIALS = 217

HelloReport dataclass

Everything aq hello prints, plus the equity curves.

benchmark_equity class-attribute instance-attribute

benchmark_equity: Series = field(repr=False)

btc_buy_hold instance-attribute

btc_buy_hold: StatsRow

coins instance-attribute

coins: tuple[str, ...]

data_source instance-attribute

data_source: str

dsr_grid instance-attribute

dsr_grid: float | None

elapsed_s class-attribute instance-attribute

elapsed_s: float = 0.0

end instance-attribute

end: str

equal_weight instance-attribute

equal_weight: StatsRow

equity class-attribute instance-attribute

equity: Series = field(repr=False)

grid_sharpes instance-attribute

grid_sharpes: tuple[float, ...]

haircut_sharpe instance-attribute

haircut_sharpe: float

min_track_record_years instance-attribute

min_track_record_years: float

pbo instance-attribute

pbo: float | None

psr instance-attribute

psr: float

start instance-attribute

start: str

strategy instance-attribute

strategy: StatsRow

to_dict

to_dict() -> dict[str, object]

JSON-ready (finite numbers, curves as {date: value}).

StatsRow dataclass

One column of the report.

average_gross instance-attribute

average_gross: float

cagr instance-attribute

cagr: float

calmar instance-attribute

calmar: float

cost_bps instance-attribute

cost_bps: float

max_drawdown instance-attribute

max_drawdown: float

name instance-attribute

name: str

sharpe instance-attribute

sharpe: float

sortino instance-attribute

sortino: float

turnover instance-attribute

turnover: float

volatility instance-attribute

volatility: float

from_result classmethod

from_result(name: str, result: BacktestResult) -> StatsRow

known_at_sessions

known_at_sessions(closes: DataFrame, sessions: list[str]) -> pd.DataFrame

Closes known on each session: the bar dated before it (a crypto bar dated D closes at the midnight after D).

load_closes

load_closes(*, offline: bool = False, start: str = '2022-01-01', end: str | None = None, cache_dir: Path | None = None, get_json: Callable[[str], object] | None = None) -> tuple[pd.DataFrame, str, str | None]

(closes, source, notice). Downloads the 11 coins from Coinbase's public candles (about 6 months before start, for the 120-session lookback) unless offline; any failure falls back to the bundled sample, with a one-line notice.

render_html

render_html(report: HelloReport) -> str

A self-contained page: the table, the checks and the equity curve against BTC (no scripts, no external files).

render_text

render_text(report: HelloReport) -> str

The plain-text report aq hello prints.

rule_weights

rule_weights(closes: DataFrame, *, start: str, end: str, params: dict[str, float] | None = None, rebalance_every: int | None = None) -> pd.DataFrame

The rule's decisions as a calendar dates x coins frame (rows without a decision are NaN), from start to end.

run

run(offline: bool = False, *, start: str = '2022-01-01', end: str | None = None, cache: bool = True) -> HelloReport

Load the data (download unless offline, falling back to the sample) and run the whole demo.

run_hello

run_hello(closes: DataFrame, *, start: str = '2022-01-01', end: str | None = None, data_source: str = 'sample') -> HelloReport

The whole demo on a calendar dates x coins frame of closes (needs ~6 months of history before start).

save

save(report: HelloReport, *, html_path: str | Path | None = None, json_path: str | Path | None = None) -> None

Write the HTML page and/or the JSON report.