跳转至

Lite Reference

Lightweight Tradelearn 1.x style API.

Back to API Reference

Lite public facade.

Backtest

Tradelearn Lite quick backtest facade.

run

run(**kwargs) -> LiteStats

Run the backtest and return statistics.

optimize

optimize(**kwargs) -> LiteStats

Simple grid search optimization.

plot

plot(*args, **kwargs)

Return market replay charts for the most recent Lite run.

report

report(path: str = 'report.html', benchmark=None, sections=None)

Write a Tradelearn report for the most recent Lite run.

log_mlflow

log_mlflow(experiment_name: str = 'tradelearn-lite', run_name: str | None = None, *, uri: str | None = None, params: dict[str, Any] | None = None, tags: dict[str, Any] | None = None, nested: bool = False, log_mlflow: bool = True, upload_artifacts: bool = True, log_artifacts: bool | None = None, artifact_path: str | None = None, log_report: bool = True, log_plot: bool = False, mlflow_module: Any | None = None) -> str

Log the most recent Lite run to MLflow.

Strategy

Tradelearn Lite strategy facade.

position

position(ticker: str | None = None) -> Any

Return the Tradelearn Lite position view for a ticker.

I

I(funcval: Callable | DataFrame | Series | Any, *args, name: str | None = None, plot: bool = True, overlay: bool | None = None, color: str | None = None, scatter: bool = False, **kwargs) -> Any

Declare a Tradelearn Lite gradually revealed indicator.

target_percent

target_percent(ticker: str, target: float)

Move one ticker toward a target portfolio weight.

history_panel

history_panel(lookback: int | None = None) -> Any

Return recent multi-asset OHLCV bars.

target_weights

target_weights(weights: Mapping[str, float] | Series, *, close_missing: bool = True) -> list[Any]

Move the portfolio toward the requested ticker weights.

cash is accepted as a reserved key and is not translated into an order.

target_equal

target_equal(tickers: Sequence[str], *, weight: float = 1.0, close_missing: bool = True) -> list[Any]

Assign an equal combined target weight to the selected tickers.

close_all

close_all() -> list[Any]

Close all known Lite data-feed positions.

start_on_bar

start_on_bar(n: int) -> None

Start next no earlier than bar index n.