Skip to content

Repository files navigation

RLER

RLER is a Rust reinforcement-learning paper-trading workbench for NSE equities on 15-minute candles. It is paper-only: it does not place broker orders and it does not provide investment advice.

The current Rust implementation supports tabular Q-learning, CSV/Yahoo candle loading, backtests, paper replay, walk-forward validation, SQLite run history, and a Rust dashboard server. DQN is intentionally deferred.

Quick Start

cargo test --workspace
cargo run -p rler-cli --bin rler -- train --config config.example.json
cargo run -p rler-cli --bin rler -- backtest --config config.example.json
cargo run -p rler-cli --bin rler -- validate --config config.example.json --trainBars 200 --testBars 60
cargo run -p rler-cli --bin rler -- paper --config config.example.json --mode replay
cargo run -p rler-server --bin rler-server

Dashboard URL:

http://localhost:4173

To serve the Rust/Yew dashboard, build the web crate first:

cd crates/rler-web
trunk build
cd ../..
cargo run -p rler-server --bin rler-server

Data

The default config uses data/sample_15m.csv, so the system works offline. CSV files need these columns:

timestamp,open,high,low,close,volume
2026-01-05T03:45:00.000Z,2800,2812,2795,2808,120000

timestamp, time, datetime, or date are accepted for the time column.

Fetch Yahoo candles:

cargo run -p rler-cli --bin rler -- fetch --config config.example.json --provider yahoo --out data/latest_15m.csv

Yahoo chart data is a free unofficial source and can change limits or availability. For serious use, import broker-exported candles through CSV.

Commands

  • fetch: fetch candles from Yahoo and save CSV.
  • train: train one tabular Q-learning model under runs/models.
  • backtest: train on earlier rows and evaluate on later rows.
  • paper: replay paper trading with a saved model.
  • validate: rolling walk-forward validation with Monte Carlo robustness.
  • rler-server: dashboard API and static web server on port 4173.

Architecture

Layer Where
Core engine crates/rler-core
CLI crates/rler-cli
Dashboard server crates/rler-server
Yew dashboard crates/rler-web
Config/data config.example.json, data/

Saved tabular Q-table JSON models with actionSpaceVersion: 1 remain compatible. DQN configs are not supported by the Rust runtime yet.

Project Boundaries

  • Paper-trading only.
  • No real broker execution.
  • No profit guarantee.
  • DQN/deep-RL support is a future phase.

Open Source

RLER is released under the MIT License. See LICENSE for the license text.

About

Single-symbol NSE 15-minute candle reinforcement-learning paper trader.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages