Skip to main content

RL-pricing

A reproducibility lab for trading AI. RL-pricing re-tests published claims about deep RL agents, LLM trading agents and forecasters under one pre-registered protocol. This package holds the lab's instruments:

  • rl-pricing bench: a causal backtesting benchmark. Policies decide at the close and fill at the next open with fees; learned policies run over several seeds; frozen policies are scored on a live forward-test track; and a decision ledger records LLM agents' trades before each US market open.
  • rl-pricing --mode train|backtest|ensemble|lstm: the share-trading toolkit that trains and backtests Stable-Baselines3 agents (A2C, PPO, DDPG, TD3, SAC), a rolling ensemble and an LSTM forecaster on daily equity data.

Score your own policy

A policy maps the history up to today's close to long-only target weights, which fill at the next open. Put it in a submission directory:

# my-submissions/low-vol/policy.py
import numpy as np

from rl.bench.policy import Policy


class LowVolHalf(Policy):
    """Equal-weight the calmer half of the listed assets."""

    def act(self, view):
        closes = view.history.window(64).close
        vol = np.nanstd(np.diff(np.log(closes), axis=0), axis=0)
        vol = np.where(view.listed & np.isfinite(vol), vol, np.inf)
        keep = np.argsort(vol)[: max(1, view.listed.sum() // 2)]
        weights = np.zeros(len(view.tickers))
        weights[keep] = 1 / len(keep)
        return weights

and describe it in my-submissions/low-vol/submission.json:

{"name": "Low-vol half", "kind": "other", "policy": "policy.py:LowVolHalf", "trials": 1}

A submission can also name a built-in policy, such as "policy": "rl.bench.policies.baselines:Momentum" or "policy": "rl.bench.policies.sb3:SB3Policy" with "params": {"algo": "ppo"}. Then score it against 1/N buy-and-hold:

pip install rl-pricing
rl-pricing bench tasks
rl-pricing bench run --task synthetic --submission low-vol \
    --submissions-root my-submissions --out-root board
rl-pricing bench leaderboard --out-root board --no-readme

synthetic runs offline; the real tasks (us-sectors, us-multi-asset, crypto-majors, …) download their data on first use into datasets/bench/, or $RL_PRICING_DATA.

The import package is rl, so this distribution can't share an environment with the unrelated rl (GNU Readline bindings) distribution. The policy interface, the submission.json fields, the record formats and the rl-pricing commands follow semantic versioning; see the changelog.

The training toolkit's environment, preprocessing and training code are adapted from FinRL, which is MIT-licensed.

Metadata

Release files for rl-pricing 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rl-pricing 1.0.0
File Size Uploaded Provenance Actions
rl_pricing-1.0.0.tar.gz 201.4 kB With provenance Details for rl_pricing-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rl-pricing 1.0.0
File Interpreter ABI Platform Actions
rl_pricing-1.0.0-py3-none-any.whl Python 3 none any Details for rl_pricing-1.0.0-py3-none-any.whl

Total release size: 347.5 kB

Release files / rl_pricing-1.0.0.tar.gz

Download URL rl_pricing-1.0.0.tar.gz
Size 201.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e1597c1c92416809e17bcc8a5667054a573fb6a2fa74a14d50849a87a153a950
BLAKE2b-256 checksum
How to use checksums
6942a613a06c1e5de0ce62cc99e8471468a352370d3119455fdea5772538cb38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / rl_pricing-1.0.0-py3-none-any.whl

Download URL rl_pricing-1.0.0-py3-none-any.whl
Size 146.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7080bf9d53c8d2119285554c846dbafb19260f99d0be631b91f3e00fbfed0460
BLAKE2b-256 checksum
How to use checksums
e9374154f85a3116c02f83082a9f09bc6d1e915c583d14cfe54fffa360a70047
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Security for rl-pricing 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for rl_pricing-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page