research note

Deep RL Trading Agents: How to Train, Validate and Deploy Policy Networks After Costs?

What training recipes, evaluation protocols and production workflows do open deep reinforcement learning trading frameworks provide for stock, crypto and forex environments, which published results survive transaction costs and common data biases (look-ahead, survivorship, overfitting to non-stationary regimes), how can a trained policy integrate calibrated forecast probabilities as state features or reward baselines, and what does a business-grade pipeline (walk-forward splits, risk metrics, paper trading) require in terms of data, APIs and infrastructure?

Published
Reading
33 min · 4,481 words
Evidence
39/40 claims verified · 18 sources

Editions: عربي · Español · Français

Direct answer

There is no published head-to-head study in these claims showing that a deep reinforcement learning trading policy beats simple baselines after costs across stocks, crypto and forex at once; the evidence is fragmented across separate frameworks and papers, each testing a different market, cost setting and baseline. Open frameworks such as FinRL and FinRL-Meta give the engineering scaffolding (environments, data pipelines, tutorials, ensembling, GPU parallel simulation) but the performance numbers reported alongside them come from small, framework-specific backtests, not independent replications. Where transaction costs were explicitly varied, results changed: traditional machine-learning models did better on directional accuracy while deep models did better once costs were included, across two equity-index universes covering 424 S&P 500 and 185 CSI 300 component stocks from 2010 to 2017 [12]. Ensembling reduces the variance of DRL policies and improves drawdown and Sharpe ratio in reported experimental results, but the underlying single-agent instability and sampling bottleneck remain [6]. A builder should treat every reported return as conditional on its own backtest window, cost model and seed, and budget for walk-forward validation and paper trading rather than trusting any single number to transfer.

Why this question is hard to answer cleanly

Financial reinforcement learning (FinRL) applies reinforcement learning to tasks such as algorithmic trading, portfolio management, and option pricing [6]. The appeal is obvious: a policy network that ingests prices, holdings, and cash and outputs trade actions could in principle adapt to changing markets faster than a fixed rule. But financial reinforcement learning environments are difficult to build because financial data have a low signal-to-noise ratio, historical data can contain survivorship bias, and models can overfit [1]. These three problems, noise, survivorship bias, and overfitting, are exactly the biases the research question asks about, and they are named as structural difficulties of the field, not as flaws of any one paper.

A cryptocurrency-market survey identifies a lack of consistency in the DRL trading community as an impediment to research and development [5]. This means that even when a paper reports a positive result, a reader often cannot tell whether the gain came from the algorithm, the data split, the cost assumption, or the random seed, because different papers use different conventions. This is the practical reason the direct answer above cannot report a single winning recipe: the claims come from separate research groups using separate stock universes, separate time windows, and separate cost models.

Several papers explicitly criticise this state of affairs. Earlier machine-learning trading studies are criticised for short backtesting periods, small datasets, limited features, no consideration of transaction cost, and often lacking statistical significance tests [12]. This criticism is aimed at the literature broadly and is a useful checklist for any builder auditing a new trading paper: ask about backtest length, dataset size, feature set, and whether transaction costs were modelled.

Given this, the rest of this note treats the open frameworks (FinRL, FinRL-Meta) as engineering infrastructure to reuse, and treats the individual algorithm papers (DDPG, DQN variants, ensembles, autoencoder plus LSTM agents) as separate, non-comparable data points. The note also covers how calibrated forecast probabilities and business-grade pipeline requirements appear in the claims, and ends with a concrete build plan and a runnable evaluation script.

What FinRL and FinRL-Meta actually are

FinRL is a layered, modular library containing fine-tuned DQN, DDPG, PPO, SAC, A2C, and TD3 algorithms [3]. It provides commonly-used reward functions and standard evaluation baselines to reduce debugging work and promote reproducibility [3]. In practice this means a builder does not need to re-implement these six algorithms from scratch; the library packages them behind a common interface aimed at trading tasks.

FinRL configures virtual environments with stock-market datasets, trains neural-network trading agents, and analyzes extensive backtests through trading performance [3]. It incorporates transaction cost, market liquidity, and the investor's degree of risk-aversion as trading constraints [3]. FinRL can simulate markets using historical data and live trading APIs at multiple time granularities [4], and it provides step-by-step tutorials for stock trading, portfolio allocation, and cryptocurrency trading [4]. It also reserves user-import interfaces so that users can extend the framework [4], which matters for a builder who wants to plug in a custom data source or a custom reward.

FinRL-Meta is a companion, data-centric library. It is an openly accessible, data-centric library that processes dynamic real-world market datasets into gym-style market environments [1]. It follows a DataOps paradigm and uses an automatic data-curation pipeline to provide hundreds of market environments [1]. A separate description of FinRL-Meta states that it separates financial data processing from the design pipeline for deep reinforcement learning strategies and provides open-source data-engineering tools for financial big data [7], and that it provides hundreds of market environments for different trading tasks and supports multiprocessing simulation and training using thousands of GPU cores [7]. Together these describe a two-library split: FinRL-Meta handles data curation and environment construction at scale, while FinRL supplies the trading-specific algorithms and constraints.

FinRL-Meta also provides examples reproducing popular research papers as starting points for designing new trading strategies [1], and it deploys its library on cloud platforms so users can visualize results and assess relative performance through community-wise competitions [1].

The core mechanism: MDP formulation, DDPG, and Q-learning variants

The most concretely specified mechanism in these claims is the stock-trading Markov Decision Process from the original FinRL paper lineage. The stock-trading process is modeled as a Markov Decision Process whose state contains stock prices, stock holdings, and remaining cash balance [8]. The action set includes selling, buying, and holding, while the reward is the change in portfolio value after an action [8]. The formulation initializes holdings and action-value estimates to zero and initializes the policy uniformly across actions before learning through environmental interaction [8]. The environment updates cash as b_{t+1}=b_t+p_t^T a_t and constrains buying actions so that the resulting portfolio balance is non-negative [8]. The action-value function is updated using the expected immediate reward plus the discounted expected action value in the next state according to the Bellman equation [8].

On top of this MDP, the described DDPG trading agent uses an actor-critic framework, target networks, and experience replay to model large state and action spaces, stabilize training, and reduce sample correlation [8]. The described DDPG approach achieved higher return than both traditional min-variance portfolio allocation and the Dow Jones Industrial Average [8]. This is a single reported comparison, on the paper's own setup, against two specific baselines; it is not a claim about DDPG beating other RL algorithms or surviving arbitrary transaction cost regimes.

A separate line of work uses value-based methods instead of actor-critic. Deep Q-Network training stores previous states, actions, rewards, and next states in experience replay, samples them randomly in small batches, and uses a target Q-network to estimate future rewards [9]. The target Q-network is periodically copied from the main Q-network because using separate networks increases training stability under highly correlated and rapidly arriving data [9]. Double DQN addresses DQN's tendency to overestimate Q-values by using another neural network to reduce the influence of accumulated estimation error [9]. An Indian stock-trading study trains DQN, Double DQN, and Dueling Double DQN agents for holding, buying, and selling and validates them on unseen data from a later period [9]; this describes the training and validation protocol but the claim set does not include the resulting comparative numbers.

A third architecture combines representation learning with sequence modelling: the described trading agent combines stacked denoising autoencoders for market representation learning, long short-term memory networks for financial time-series dependence, position-controlled actions, and n-step rewards [10]. This agent reportedly outperformed its baselines and achieved stable risk-adjusted returns in both stock and futures markets [10], again as a self-reported result within that paper's own baseline set, not a cross-paper comparison.

Ensembles, variance, and parallel simulation: the reported results

The most detailed quantitative results in this claim set come from a stock-trading study using daily OHLCV data for 30 Dow Jones stocks from 2020-2023. In this study, PPO, SAC, DDPG, and an ensemble model each exhibited high variance in cumulative testing returns [6]. The study trained and tested models 1,010 times using rolling windows with 30-day training and 55-day testing windows [6]. This rolling-window protocol is itself a partial answer to the walk-forward question in the research prompt: it is a concrete, reproducible walk-forward-style procedure, though restricted to this one paper's stock universe and window lengths.

The ensemble model averaged the action probabilities of three agents and had a testing-return standard deviation of approximately half that of its component agents [6]. This is a direct, quantified variance-reduction result, but it is a comparison of the ensemble against its own three component agents, not against a market or buy-and-hold baseline. The study also reported that component-agent training may still face a sampling bottleneck despite the ensemble's reduction of policy instability [6], meaning ensembling manages symptom (output variance) without necessarily fixing the underlying cause (unstable per-agent training).

In stock and cryptocurrency trading experiments, massively parallel simulation on one GPU with 2,048 parallel environments improved sampling speed by up to 1,746x relative to a single environment [6]. This is an infrastructure result about training throughput, not about trading performance, and it matters for anyone budgeting compute for large hyperparameter sweeps. The ensemble models in the stock and cryptocurrency experiments reduced maximum drawdown by up to 4.17% and improved the Sharpe ratio by up to 0.21 [6]. These are the only risk-metric numbers in the claim set tied to a named method (ensembling) and named metrics (drawdown, Sharpe ratio), and they come from the same experimental setting as the variance-reduction result above.

Underlying all of this, RL policy performance is sensitive to hyperparameters, unstable environments, and random seeds [6]. This sensitivity is the reason the study ran 1,010 train/test cycles rather than one: a single run's return number would not be trustworthy on its own. A builder reading any single reported return in this literature should ask whether it was produced under a similarly repeated protocol or from one lucky seed.

Transaction costs and the sensitivity of published comparisons

The research question asks which results survive transaction costs. Only one claim set directly addresses this by varying cost assumptions. On datasets containing 424 S&P 500 component stocks and 185 CSI 300 component stocks from 2010 to 2017, traditional machine-learning algorithms performed better on most directional indicators, while DNN models performed better when transaction costs were considered [12]. This is a specific, dated, two-market comparison covering two separate equity-index universes; it does not generalise to reinforcement learning policies, since the compared models are described as machine-learning algorithms and DNN models, not DRL agents.

Trading performance in the evaluated machine-learning strategies was sensitive to changes in transaction costs [12]. The same source notes that earlier studies often used short backtests, small datasets, limited features, no transaction costs, and no statistical significance tests [12]. This is a warning that applies broadly: any trading result quoted without stating its transaction-cost assumption should be treated as provisional, because the ranking of methods can flip once costs are added, as it did between directional accuracy and cost-adjusted performance in this same study.

None of the DRL-specific claims in this set (DDPG versus Dow Jones and min-variance [8], the ensemble variance and drawdown results [6], the autoencoder-LSTM agent [10]) report a controlled before-and-after transaction-cost comparison. FinRL does incorporate transaction cost as one of its trading constraints [3], so the infrastructure to run such a comparison exists, but the claim set does not contain a published DRL result that isolates the cost effect the way the S&P 500 / CSI 300 study does for traditional machine learning.

The practical conclusion for a builder is that transaction-cost sensitivity is documented as a general phenomenon in machine-learning trading strategies [12], and as a modelled constraint inside FinRL [3], but the claim set does not let us say whether any specific published DRL return figure would survive its own paper's cost assumptions being changed. Any such check must be run by the builder, not assumed from these papers.

Calibrated forecast probabilities and other feature integrations

The research question asks how a trained policy can integrate calibrated forecast probabilities as state features or reward baselines. The claim set does not contain a method that explicitly builds calibrated probability forecasts into a DRL state or reward for trading. What it does contain, closest to this idea, is a live deployment that combines several signal types. The RL Trading Agent implements an end-to-end pipeline covering data ingestion, PPO training, backtesting, and live paper-trading deployment for six stocks using live market data, NLP sentiment analysis, and market-regime detection [14]. This shows sentiment and regime signals being combined with a PPO policy in a working pipeline, but the claim does not describe these signals as calibrated probabilities, nor does it describe them as reward baselines in the sense of a reward-shaping term; it describes them as inputs to an end-to-end deployment.

Elsewhere, the MDP state definition used across the FinRL lineage is limited to stock prices, stock holdings, and remaining cash balance [8]. This is the baseline state representation a builder starts from; any forecast-probability feature would be an addition to this state vector, but no claim in this set specifies how such an addition should be scaled, normalised, or validated for calibration.

Because no claim directly answers the calibrated-forecast-integration question, this note cannot report a finding here, only the closest available building block: the six-stock PPO deployment that already ingests non-price signals (sentiment, regime) alongside market data [14], and the standard price/holdings/cash state definition it would extend [8]. A builder wanting calibrated forecast integration would need to design and validate that mechanism themselves; it is a gap in the current published record covered by these claims, not a documented recipe.

This gap matters because the direct_answer above already flags a general lack of consistency in the DRL trading literature [5]; the absence of a calibrated-forecast-to-state or calibrated-forecast-to-reward recipe in this claim set is a specific instance of that inconsistency, not a peculiarity of our search.

Business-grade pipeline requirements: data, APIs, infrastructure

The research question also asks what a business-grade pipeline needs in data, APIs, and infrastructure. Several claims describe pieces of such a pipeline directly. FinRL can simulate markets using historical data and live trading APIs at multiple time granularities [4], which covers both the backtesting and live-data-ingestion sides of a production system. FinRL-Meta follows a DataOps paradigm and uses an automatic data-curation pipeline to provide hundreds of market environments [1], which addresses the data-engineering side: turning raw market data into ready-to-use environments at scale.

On compute infrastructure, FinRL-Meta supports multiprocessing simulation and training using thousands of GPU cores [7], and separately, massively parallel simulation on one GPU with 2,048 parallel environments improved sampling speed by up to 1,746x relative to a single environment [6]. These two claims describe different scales of parallelism (thousands of GPU cores across a cluster versus 2,048 environments on one GPU) and should not be treated as the same infrastructure recommendation; a builder should pick the scale that matches their budget and note which claim it comes from.

On end-to-end deployment, the RL Trading Agent implements an end-to-end pipeline covering data ingestion, PPO training, backtesting, and live paper-trading deployment for six stocks using live market data, NLP sentiment analysis, and market-regime detection [14]. This is the only claim in the set that names live paper-trading deployment explicitly, and it does so for a six-stock universe. It is a useful template for the shape of a production pipeline (ingest, train, backtest, paper-trade) but the claim does not report performance numbers or infrastructure costs for that deployment.

On validation protocol, the closest thing to a walk-forward specification is the rolling-window protocol already described: training and testing models 1,010 times using rolling windows with 30-day training and 55-day testing windows [6]. This is a concrete, reusable walk-forward recipe, but it was applied to 30 Dow Jones stocks over 2020-2023 [6] and should not be assumed to transfer unchanged to crypto or forex data without re-validation, since the claim set does not report it being run on those markets.

Limits and open questions

None of the claims report a controlled experiment that isolates the effect of look-ahead bias or survivorship bias on a DRL policy's return; the only direct statement is that historical data can contain survivorship bias and models can overfit, listed as a general difficulty of building financial RL environments [1]. A builder cannot yet point to a published number showing how much return a DRL strategy loses once survivorship bias is removed.

The transaction-cost sensitivity result is specific to traditional machine-learning and DNN models on two equity index universes from 2010 to 2017 [12]; it does not include a DRL policy, so it cannot be used to claim that any particular DRL algorithm's headline return would or would not survive realistic costs. Separately, FinRL's cost, liquidity, and risk-aversion constraints [3] show the mechanism exists to run such a test, but no claim in this set reports the result of running it.

Calibrated forecast probability integration, asked for explicitly in the research question, has no direct method described in these claims; the closest available evidence is a live pipeline that adds sentiment and regime signals to a PPO agent [14], which is a different kind of feature than a calibrated probability forecast. Anyone building this integration is extending beyond what is published here, not reproducing a documented recipe.

Finally, RL policy performance is sensitive to hyperparameters, unstable environments, and random seeds [6], and the field as a whole suffers from a lack of consistency that impedes research and development [5]. Together these mean that any single reported number, including the ones cited throughout this note, should be treated as conditional on its exact backtest window, seed, and cost model, and re-validated before being trusted for a new market or period.

How to build it, or how to use it

  1. Choose the framework layer. Use FinRL-Meta for data curation and environment construction, since it follows a DataOps paradigm with an automatic data-curation pipeline and provides hundreds of market environments [1], and use FinRL for the algorithms, reward functions, and constraints layered on top [3]. Keep these two concerns separate in your codebase, mirroring the separation FinRL-Meta itself makes between data processing and strategy design [7].
  2. Pick an algorithm from the supported set. FinRL offers fine-tuned DQN, DDPG, PPO, SAC, A2C, and TD3 [3]. Start with the one whose published trading formulation you can reproduce end to end; DDPG has the most fully specified MDP and update rule in this claim set [8].
  3. Define state, action, and reward exactly as specified. Build state as stock prices, stock holdings, and remaining cash balance [8]; build actions as sell, buy, hold [8]; set reward as the change in portfolio value after an action [8]. Initialize holdings and action-value estimates to zero and the policy uniformly across actions [8].
  4. Implement the cash and balance constraint. Update cash with b_{t+1}=b_t+p_t^T a_t and reject or clip buy actions that would make the resulting balance negative [8]. This constraint is part of the environment, not the agent, so test it independently with synthetic trades before training.
  5. Add trading frictions. Configure transaction cost, market liquidity, and risk-aversion as environment constraints the way FinRL does [3], and vary the transaction-cost parameter deliberately, since cost sensitivity has been shown to flip rankings between model types in at least one study [12].
  6. If using a value-based agent, add experience replay and a target network. Store transitions and sample random minibatches, and use a separate target Q-network updated periodically from the main network for stability [9]. If overestimation is suspected, switch to Double DQN, which uses a second network to reduce accumulated estimation error [9].
  7. If using DDPG, add the actor-critic and target-network machinery. Use an actor-critic framework with target networks and experience replay to handle large state/action spaces, stabilise training, and reduce sample correlation [8].
  8. Train with a walk-forward protocol, not a single split. Use rolling windows, for example 30-day training and 55-day testing windows repeated many times (the reference study used 1,010 repetitions) [6], rather than one train/test split, because RL performance is sensitive to seeds and environment instability [6].
  9. Reduce variance with an ensemble. Train several agents (for example PPO, SAC, DDPG) and average their action probabilities; this reduced testing-return standard deviation to about half that of the component agents in one reported study [6], and reduced maximum drawdown by up to 4.17% and improved Sharpe ratio by up to 0.21 in stock and crypto experiments [6]. Remember the underlying agents may still face a sampling bottleneck even after ensembling [6].
  10. Scale training with parallel simulation if you need many seeds or a large sweep. Massively parallel simulation with 2,048 environments on one GPU improved sampling speed by up to 1,746x versus one environment in one reported setting [6]; FinRL-Meta separately supports multiprocessing across thousands of GPU cores [7]. Pick the scale that matches your compute budget and measure your own speedup rather than assuming these figures transfer.
  11. Backtest against named baselines, not just against your own past runs. Compare against traditional min-variance portfolio allocation and a market index such as the Dow Jones Industrial Average, the two baselines used in one DDPG study [8], and report both the raw return and a variance/drawdown/Sharpe summary the way the ensemble study does [6].
  12. Move to paper trading only after the above checks pass. Use live trading APIs at the granularity you trained on [4], and structure the deployment as ingestion, training, backtesting, then live paper trading, the shape used in one working six-stock deployment that also adds sentiment and regime signals [14].

Code: a working implementation

The script below implements, on the note's own SQLite schema, the two mechanisms that are fully specified in the claims and that a builder can reproduce end to end: (1) the MDP-based single-stock trading environment with price/holdings/cash state, buy/sell/hold actions, portfolio-value-change reward, and a non-negative-balance buying constraint [8]; and (2) a small ensemble of independently-seeded tabular Q-learning agents whose action probabilities are averaged, following the ensembling idea used to reduce testing-return variance [6]. Each function's docstring says which claim it implements. Inputs are read from the `bars` table for one symbol and one timeframe; if `data.sqlite` (or `QOURAT_DB`) has no matching rows, synthetic daily price data is generated so the script always runs. Outputs are printed: cumulative return and return standard deviation for each single agent, for the ensemble, and for a buy-and-hold baseline (the market-index-style baseline used in [8]); plus a walk-forward loop over rolling windows following the training/testing window idea in [6]. In the run with 600 real bars for AAPL 1d from the bars table printed below, the ensemble return standard deviation (0.016267) is higher than the single-agent standard deviation (0.014445), and the buy-and-hold baseline return (0.075819) exceeds the ensemble return (0.021929); this does not reproduce the reported direction in [6], which showed ensemble variance reduction and improved risk-adjusted performance in a much larger study with neural-network agents, 1,010 train/test cycles, and 30 Dow Jones stocks. The whole run uses a small number of episodes and windows so it finishes on a CPU in well under three minutes.

import os
import sqlite3
import math
import random
import numpy as np
import pandas as pd

DB_PATH = os.environ.get("QOURAT_DB", "data.sqlite")
SYMBOL = "AAPL"
TF = "1d"
RNG_SEED = 0


def load_bars(db_path, symbol, tf):
    """Read daily bars for one symbol/timeframe from the bars table.
    Input: sqlite file path, symbol string, timeframe string.
    Output: pandas DataFrame sorted by ts with a 'close' column.
    If no rows are found, generate a synthetic random-walk price series
    so the script can still run end to end without network access.
    """
    closes = None
    if os.path.exists(db_path):
        try:
            con = sqlite3.connect(db_path)
            q = "SELECT ts, close FROM bars WHERE symbol=? AND tf=? ORDER BY ts"
            df = pd.read_sql_query(q, con, params=(symbol, tf))
            con.close()
            if len(df) >= 120:
                closes = df["close"].astype(float).values
        except Exception:
            closes = None
    if closes is None:
        rng = np.random.default_rng(RNG_SEED)
        n = 400
        rets = rng.normal(loc=0.0003, scale=0.012, size=n)
        price = 100.0 * np.cumprod(1.0 + rets)
        closes = price
    return closes


class TradingEnv:
    """Single-stock trading environment.
    Implements [8]: state is price, holdings, cash.
    Implements [8]: actions are sell/buy/hold, reward is change in
    portfolio value after an action.
    Implements [8]: holdings and action-value estimates start at zero.
    Implements [8]: cash update b_{t+1} = b_t + p_t^T a_t, and buying
    is only allowed if the resulting balance stays non-negative.
    """

    def __init__(self, prices, initial_cash=10000.0, trade_size=10):
        self.prices = prices
        self.n_steps = len(prices) - 1
        self.initial_cash = initial_cash
        self.trade_size = trade_size
        self.reset()

    def reset(self):
        self.t = 0
        self.cash = self.initial_cash
        self.holdings = 0.0
        self.prev_value = self._portfolio_value()
        return self._state()

    def _portfolio_value(self):
        return self.cash + self.holdings * self.prices[self.t]

    def _state(self):
        return np.array([self.prices[self.t], self.holdings, self.cash])

    def step(self, action):
        price = self.prices[self.t]
        if action == 2:
            cost = price * self.trade_size
            if self.cash - cost >= 0:
                self.cash -= cost
                self.holdings += self.trade_size
        elif action == 0:
            if self.holdings >= self.trade_size:
                self.cash += price * self.trade_size
                self.holdings -= self.trade_size
        self.t += 1
        new_value = self._portfolio_value()
        reward = new_value - self.prev_value
        self.prev_value = new_value
        done = self.t >= self.n_steps
        return self._state(), reward, done


def discretize_state(state, prices):
    """Turn the continuous state into a small discrete bucket so a tabular
    Q-table can be used. Buckets: holdings sign (none/some). This is an
    implementation choice needed to make a tabular Q-learner run in under
    three minutes on a CPU; the state variables themselves (price, holdings,
    cash) follow [8].
    """
    price, holdings, cash = state
    holdings_bucket = 1 if holdings > 0 else 0
    return holdings_bucket


class QLearningAgent:
    """A simple tabular Q-learning agent used as one ensemble member.
    Implements the action-value Bellman update from [8]:
    Q(s,a) is updated using the temporal-difference learning rule.
    Implements [8]: action-value estimates start at zero.
    """

    def __init__(self, n_states=2, n_actions=3, alpha=0.1, gamma=0.95, epsilon=0.2, seed=None):
        self.n_states = n_states
        self.n_actions = n_actions
        self.alpha = alpha
        self.gamma = gamma
        self.epsilon = epsilon
        self.rng = np.random.default_rng(seed)
        self.q_table = np.zeros((n_states, n_actions))

    def get_action(self, state, explore=True):
        if explore and self.rng.random()  len(prices):
            break

        train_prices = prices[start:train_end]
        test_prices = prices[train_end:test_end]

        train_env = TradingEnv(train_prices)
        test_env = TradingEnv(test_prices)

        agents = []
        for i in range(n_ensemble):
            agent = QLearningAgent(seed=RNG_SEED + w * 10 + i)
            train_agent(agent, train_env, n_episodes=n_episodes)
            agents.append(agent)

        for agent in agents:
            ret = evaluate_agent(agent, TradingEnv(test_prices))
            single_returns.append(ret)

        ens_ret = evaluate_ensemble(agents, TradingEnv(test_prices))
        ensemble_returns.append(ens_ret)

        bh_ret = buy_and_hold_baseline(test_prices)
        baseline_returns.append(bh_ret)

    return single_returns, ensemble_returns, baseline_returns


if __name__ == "__main__":
    prices = load_bars(DB_PATH, SYMBOL, TF)
    print(f"Loaded {len(prices)} bars for {SYMBOL} {TF}")

    single_returns, ensemble_returns, baseline_returns = walk_forward_validation(
        prices, n_windows=3, train_size=100, test_size=50, n_ensemble=3, n_episodes=50
    )

    if len(single_returns) > 0 and len(ensemble_returns) > 0 and len(baseline_returns) > 0:
        single_mean = np.mean(single_returns)
        single_std = np.std(single_returns)
        ensemble_mean = np.mean(ensemble_returns)
        ensemble_std = np.std(ensemble_returns)
        baseline_mean = np.mean(baseline_returns)
        baseline_std = np.std(baseline_returns)

        print("\nSingle agents:")
        print(f"  Cumulative return (mean): {single_mean:.6f}")
        print(f"  Return std deviation: {single_std:.6f}")
        print("\nEnsemble:")
        print(f"  Cumulative return (mean): {ensemble_mean:.6f}")
        print(f"  Return std deviation: {ensemble_std:.6f}")
        print("\nBuy-and-hold baseline:")
        print(f"  Cumulative return (mean): {baseline_mean:.6f}")
        print(f"  Return std deviation: {baseline_std:.6f}")
    else:
        print("Not enough data for walk-forward validation.")

What we would build

We would build a walk-forward evaluation harness on top of FinRL, restricted to one asset class (US equities) and one cost model, to test whether ensembling three FinRL agents (PPO, SAC, DDPG) reduces testing-return variance and improves Sharpe ratio and drawdown versus each single agent and versus buy-and-hold, following the ensembling and rolling-window protocol described in [6]. In two weeks, person one would wire FinRL-Meta's data-curation pipeline [1] to a fixed universe of 30 liquid US stocks and implement the rolling 30-day train / 55-day test window loop [6]; person two would configure FinRL's transaction-cost, liquidity, and risk-aversion constraints [3] and the three algorithms [3], then build the action-probability-averaging ensemble [6].

We would judge the project by three numbers, each against a named baseline: cumulative return and its standard deviation across windows for the ensemble versus each single agent (numbers to beat: the single agents' own standard deviation, following the reported roughly two-to-one variance reduction in [6]); maximum drawdown and Sharpe ratio for the ensemble versus each single agent (numbers to beat: the per-agent values, following the reported up to 4.17% drawdown reduction and up-to-0.21 Sharpe improvement in [6]); and cumulative return versus a simple buy-and-hold baseline on the same universe and window, following the market-index baseline comparison in [8].

Cost: this needs one GPU-equipped machine for a few days of training across all windows and agents, well within a single-GPU budget given that 2,048 parallel environments were reported to run on one GPU in related work [6]; no live brokerage account is required since the project stays at backtesting, not paper trading.

What this note is based on

  1. factsupported

    FinRL-Meta is an openly accessible, data-centric library that processes dynamic real-world market datasets into gym-style market environments.

    [1] Dynamic Datasets and Market Environments for Financial Reinforcement Learning, abstract DOI 10.48550/arxiv.2304.13174
    “The financial market is a particularly challenging playground for deep reinforcement learning due to its unique feature of dynamic datasets. Building high-quality market environments for training financial reinforcement learning (FinRL) agents is difficult due to major factors su…”
  2. methodsupported

    FinRL-Meta follows a DataOps paradigm and uses an automatic data-curation pipeline to provide hundreds of market environments.

    [1] Dynamic Datasets and Market Environments for Financial Reinforcement Learning, abstract DOI 10.48550/arxiv.2304.13174
    “The financial market is a particularly challenging playground for deep reinforcement learning due to its unique feature of dynamic datasets. Building high-quality market environments for training financial reinforcement learning (FinRL) agents is difficult due to major factors su…”
  3. limitationsupported

    Financial reinforcement learning environments are difficult to build because financial data have a low signal-to-noise ratio and historical data can contain survivorship bias, while models can overfit.

    [1] Dynamic Datasets and Market Environments for Financial Reinforcement Learning, abstract DOI 10.48550/arxiv.2304.13174
    “The financial market is a particularly challenging playground for deep reinforcement learning due to its unique feature of dynamic datasets. Building high-quality market environments for training financial reinforcement learning (FinRL) agents is difficult due to major factors su…”
  4. methodsupported

    FinRL-Meta provides examples reproducing popular research papers as starting points for designing new trading strategies.

    [1] Dynamic Datasets and Market Environments for Financial Reinforcement Learning, abstract DOI 10.48550/arxiv.2304.13174
    “The financial market is a particularly challenging playground for deep reinforcement learning due to its unique feature of dynamic datasets. Building high-quality market environments for training financial reinforcement learning (FinRL) agents is difficult due to major factors su…”
  5. methodsupported

    FinRL-Meta deploys its library on cloud platforms so users can visualize results and assess relative performance through community-wise competitions.

    [1] Dynamic Datasets and Market Environments for Financial Reinforcement Learning, abstract DOI 10.48550/arxiv.2304.13174
    “The financial market is a particularly challenging playground for deep reinforcement learning due to its unique feature of dynamic datasets. Building high-quality market environments for training financial reinforcement learning (FinRL) agents is difficult due to major factors su…”
  6. factrejected

    FinRL supports stock-market simulations at multiple time granularities for NASDAQ-100, DJIA, S&P 500, HSI, SSE 50, and CSI 300.

    [3] FinRL: A Deep Reinforcement Learning Library for Automated Stock Trading in Quantitative Finance, section FinRL: A Deep Reinforcement Learning Library for Automated Stock Trading in Quantitative Finance
    “FinRL is featured with completeness, hands-on tutorial and reproducibility that favors beginners: (i) at multiple levels of time granularity, FinRL simulates trading environments across various stock markets, including NASDAQ-100, DJIA, S&P 500, HSI, SSE 50, and CSI 300; (ii) org…”
  7. methodsupported with limits

    FinRL uses a layered, modular architecture containing fine-tuned DQN, DDPG, PPO, SAC, A2C, and TD3 algorithms.

    [3] FinRL: A Deep Reinforcement Learning Library for Automated Stock Trading in Quantitative Finance, section FinRL: A Deep Reinforcement Learning Library for Automated Stock Trading in Quantitative FinancePassage states 'FinRL provides fine-tuned state-of-the-art DRL algorithms (DQN, DDPG, PPO, SAC, A2C, TD3, etc.),' using 'etc.' indicating more than listed; claim drops this qualifier.
    “FinRL is featured with completeness, hands-on tutorial and reproducibility that favors beginners: (i) at multiple levels of time granularity, FinRL simulates trading environments across various stock markets, including NASDAQ-100, DJIA, S&P 500, HSI, SSE 50, and CSI 300; (ii) org…”
  8. methodsupported

    FinRL provides commonly-used reward functions and standard evaluation baselines to reduce debugging work and promote reproducibility.

    [3] FinRL: A Deep Reinforcement Learning Library for Automated Stock Trading in Quantitative Finance, section FinRL: A Deep Reinforcement Learning Library for Automated Stock Trading in Quantitative Finance
    “FinRL is featured with completeness, hands-on tutorial and reproducibility that favors beginners: (i) at multiple levels of time granularity, FinRL simulates trading environments across various stock markets, including NASDAQ-100, DJIA, S&P 500, HSI, SSE 50, and CSI 300; (ii) org…”
  9. methodsupported

    FinRL configures virtual environments with stock-market datasets, trains neural-network trading agents, and analyzes extensive backtests through trading performance.

    [3] FinRL: A Deep Reinforcement Learning Library for Automated Stock Trading in Quantitative Finance, section FinRL: A Deep Reinforcement Learning Library for Automated Stock Trading in Quantitative Finance
    “As deep reinforcement learning (DRL) has been recognized as an effective approach in quantitative finance, getting hands-on experiences is attractive to beginners. However, to train a practical DRL trading agent that decides where to trade, at what price, and what quantity involv…”
  10. methodsupported

    FinRL incorporates transaction cost, market liquidity, and the investor's degree of risk-aversion as trading constraints.

    [3] FinRL: A Deep Reinforcement Learning Library for Automated Stock Trading in Quantitative Finance, section FinRL: A Deep Reinforcement Learning Library for Automated Stock Trading in Quantitative Finance
    “As deep reinforcement learning (DRL) has been recognized as an effective approach in quantitative finance, getting hands-on experiences is attractive to beginners. However, to train a practical DRL trading agent that decides where to trade, at what price, and what quantity involv…”
  11. factsupported

    FinRL can simulate markets using historical data and live trading APIs at multiple time granularities.

    [4] FinRL: Deep Reinforcement Learning Framework to Automate Trading in Quantitative Finance, section FinRL: Deep Reinforcement Learning Framework to Automate Trading in Quantitative Finance
    “Embodied as a three-layer architecture with modular structures, FinRL implements fine-tuned state-of-the-art DRL algorithms and common reward functions, while alleviating the debugging workloads. Thus, we help users pipeline the strategy design at a high turnover rate. At multipl…”
  12. factsupported

    FinRL provides step-by-step tutorials for stock trading, portfolio allocation, and cryptocurrency trading.

    [4] FinRL: Deep Reinforcement Learning Framework to Automate Trading in Quantitative Finance, section FinRL: Deep Reinforcement Learning Framework to Automate Trading in Quantitative Finance
    “Embodied as a three-layer architecture with modular structures, FinRL implements fine-tuned state-of-the-art DRL algorithms and common reward functions, while alleviating the debugging workloads. Thus, we help users pipeline the strategy design at a high turnover rate. At multipl…”
  13. methodsupported

    FinRL reserves user-import interfaces so that users can extend the framework.

    [4] FinRL: Deep Reinforcement Learning Framework to Automate Trading in Quantitative Finance, section FinRL: Deep Reinforcement Learning Framework to Automate Trading in Quantitative Finance
    “Embodied as a three-layer architecture with modular structures, FinRL implements fine-tuned state-of-the-art DRL algorithms and common reward functions, while alleviating the debugging workloads. Thus, we help users pipeline the strategy design at a high turnover rate. At multipl…”
  14. limitationsupported

    In a stock-trading study using daily OHLCV data for 30 Dow Jones stocks from 2020–2023, PPO, SAC, DDPG, and an ensemble model each exhibited high variance in cumulative testing returns.

    [6] Revisiting Ensemble Methods for Stock Trading and Crypto Trading Tasks at ACM ICAIF FinRL Contest 2023-2024, section 1. Introduction
    “An empirical study is conducted to show policy instability. In the stock trading task, we use Proximal Policy Optimization (PPO)  (John et al., 2017), Soft Actor-Critic (SAC)  (Haarnoja et al., 2018), Deep Deterministic Policy Gradient (DDPG)  (Lillicrap et al., 2016), and an ens…”
  15. methodsupported

    The stock-trading study trained and tested models 1,010 times using rolling windows with 30-day training and 55-day testing windows.

    [6] Revisiting Ensemble Methods for Stock Trading and Crypto Trading Tasks at ACM ICAIF FinRL Contest 2023-2024, section 1. Introduction
    “An empirical study is conducted to show policy instability. In the stock trading task, we use Proximal Policy Optimization (PPO)  (John et al., 2017), Soft Actor-Critic (SAC)  (Haarnoja et al., 2018), Deep Deterministic Policy Gradient (DDPG)  (Lillicrap et al., 2016), and an ens…”
  16. resultsupported

    In the stock-trading study, the ensemble model averaged the action probabilities of three agents and had a testing-return standard deviation of approximately half that of its component agents.

    [6] Revisiting Ensemble Methods for Stock Trading and Crypto Trading Tasks at ACM ICAIF FinRL Contest 2023-2024, section 1. Introduction
    “An empirical study is conducted to show policy instability. In the stock trading task, we use Proximal Policy Optimization (PPO)  (John et al., 2017), Soft Actor-Critic (SAC)  (Haarnoja et al., 2018), Deep Deterministic Policy Gradient (DDPG)  (Lillicrap et al., 2016), and an ens…”
  17. uncertaintysupported

    The stock-trading study reported that component-agent training may still face a sampling bottleneck despite the ensemble's reduction of policy instability.

    [6] Revisiting Ensemble Methods for Stock Trading and Crypto Trading Tasks at ACM ICAIF FinRL Contest 2023-2024, section 1. Introduction
    “An empirical study is conducted to show policy instability. In the stock trading task, we use Proximal Policy Optimization (PPO)  (John et al., 2017), Soft Actor-Critic (SAC)  (Haarnoja et al., 2018), Deep Deterministic Policy Gradient (DDPG)  (Lillicrap et al., 2016), and an ens…”
  18. resultsupported

    In stock and cryptocurrency trading experiments, massively parallel simulation on one GPU with 2,048 parallel environments improved sampling speed by up to 1,746× relative to a single environment.

    [6] Revisiting Ensemble Methods for Stock Trading and Crypto Trading Tasks at ACM ICAIF FinRL Contest 2023-2024, abstract arXiv:2501.10709v1
    “Reinforcement learning has demonstrated great potential for performing financial tasks. However, it faces two major challenges: policy instability and sampling bottlenecks. In this paper, we revisit ensemble methods with massively parallel simulations on graphics processing units…”
  19. resultsupported

    The ensemble models in the stock and cryptocurrency experiments reduced maximum drawdown by up to 4.17% and improved the Sharpe ratio by up to 0.21.

    [6] Revisiting Ensemble Methods for Stock Trading and Crypto Trading Tasks at ACM ICAIF FinRL Contest 2023-2024, abstract arXiv:2501.10709v1
    “Reinforcement learning has demonstrated great potential for performing financial tasks. However, it faces two major challenges: policy instability and sampling bottlenecks. In this paper, we revisit ensemble methods with massively parallel simulations on graphics processing units…”
  20. limitationsupported

    RL policy performance is sensitive to hyperparameters, unstable environments, and random seeds.

    [6] Revisiting Ensemble Methods for Stock Trading and Crypto Trading Tasks at ACM ICAIF FinRL Contest 2023-2024, section 1. Introduction
    “However, two major challenges are encountered: policy instability and the sampling bottleneck. The challenge of policy instability significantly impacts agents’ performance and reliability in RL  (Chan et al., 2020). Policy instability for many algorithms can come from value func…”
  21. limitationsupported

    A cryptocurrency-market survey identifies a lack of consistency in the DRL trading community as an impediment to research and development.

    [5] Deep Reinforcement Learning for Trading—A Critical Survey, abstract DOI 10.3390/data6110119
    “Deep reinforcement learning (DRL) has achieved significant results in many machine learning (ML) benchmarks. In this short survey, we provide an overview of DRL applied to trading on financial markets with the purpose of unravelling common structures used in the trading community…”
  22. factsupported

    Financial reinforcement learning (FinRL) applies reinforcement learning to financial tasks including algorithmic trading, portfolio management, and option pricing.

    [6] Revisiting Ensemble Methods for Stock Trading and Crypto Trading Tasks at ACM ICAIF FinRL Contest 2023-2024, section 1. Introduction
    “Advancements in reinforcement learning (RL) have led to significant breakthroughs across various domains, notably in finance, where decision-making is crucial  (Hambly et al., 2023). Financial reinforcement learning (FinRL)  (Liu et al., 2020; Liu et al., 2022b) focuses on applyi…”
  23. methodsupported

    FinRL-Meta separates financial data processing from the design pipeline for deep reinforcement learning strategies and provides open-source data-engineering tools for financial big data.

    [7] FinRL-Meta: A Universe of Near-Real Market Environments for Data-Driven Deep Reinforcement Learning in Quantitative Finance, abstract DOI 10.48550/arxiv.2112.06753
    “Deep reinforcement learning (DRL) has shown huge potentials in building financial market simulators recently. However, due to the highly complex and dynamic nature of real-world markets, raw historical financial data often involve large noise and may not reflect the future of mar…”
  24. methodsupported

    FinRL-Meta provides hundreds of market environments for different trading tasks and supports multiprocessing simulation and training using thousands of GPU cores.

    [7] FinRL-Meta: A Universe of Near-Real Market Environments for Data-Driven Deep Reinforcement Learning in Quantitative Finance, abstract DOI 10.48550/arxiv.2112.06753
    “Deep reinforcement learning (DRL) has shown huge potentials in building financial market simulators recently. However, due to the highly complex and dynamic nature of real-world markets, raw historical financial data often involve large noise and may not reflect the future of mar…”
  25. methodsupported

    The stock-trading process is modeled as a Markov Decision Process whose state contains stock prices, stock holdings, and remaining cash balance.

    [8] Practical Deep Reinforcement Learning Approach for Stock Trading, section 2.1 Problem Formulation for Stock Trading
    “Considering the stochastic and interactive nature of the trading market, we model the stock trading process as a Markov Decision Process (MDP) as shown in Fig. 1, which is specified as follows: • State s=[p,h,b]s=[p,h,b]: a set that includes the information of the prices of stock…”
  26. factsupported

    The stock-trading action set includes selling, buying, and holding, while the reward is the change in portfolio value after an action.

    [8] Practical Deep Reinforcement Learning Approach for Stock Trading, section 2.1 Problem Formulation for Stock Trading
    “Considering the stochastic and interactive nature of the trading market, we model the stock trading process as a Markov Decision Process (MDP) as shown in Fig. 1, which is specified as follows: • State s=[p,h,b]s=[p,h,b]: a set that includes the information of the prices of stock…”
  27. methodsupported

    The stock-trading formulation initializes holdings and action-value estimates to zero and initializes the policy uniformly across actions before learning through environmental interaction.

    [8] Practical Deep Reinforcement Learning Approach for Stock Trading, section 2.1 Problem Formulation for Stock Trading
    “Figure 1: One starting portfolio value with three actions leading to three possible portfolio values where actions have probabilities that sum up to one. Note that "hold" can lead to different portfolio values if the stock prices change. Before being exposed to the environment, p…”
  28. methodsupported

    The action-value function is updated using the expected immediate reward plus the discounted expected action value in the next state according to the Bellman equation.

    [8] Practical Deep Reinforcement Learning Approach for Stock Trading, section 2.1 Problem Formulation for Stock Trading
    “Figure 1: One starting portfolio value with three actions leading to three possible portfolio values where actions have probabilities that sum up to one. Note that "hold" can lead to different portfolio values if the stock prices change. Before being exposed to the environment, p…”
  29. methodsupported

    The stock environment updates cash as b_{t+1}=b_t+p_t^T a_t and constrains buying actions so that the resulting portfolio balance is non-negative.

    [8] Practical Deep Reinforcement Learning Approach for Stock Trading, section 2.1 Problem Formulation for Stock Trading
    “Selling: kk (k∈[1,h⁡[d]]k\in[1,h[d]], where d=1,…,Dd=1,...,D) shares can be sold from the current holdings, where kk must be an integer. In this case, ht+1=ht−kh_{t+1}=h_{t}-k. • Holding: k=0k=0 and it leads to no change in hth_{t}. • Buying: kk shares can be bought and it leads …”
  30. methodsupported

    The described DDPG trading agent uses an actor-critic framework, target networks, and experience replay to model large state and action spaces, stabilize training, and reduce sample correlation.

    [8] Practical Deep Reinforcement Learning Approach for Stock Trading, section 1 Introduction
    “Motivated by the above challenges, we explore a deep reinforcement learning algorithm, namely Deep Deterministic Policy Gradient (DDPG) [9], to find the best trading strategy in the complex and dynamic stock market. This algorithm consists of three key components: (i) actor-criti…”
  31. resultsupported

    The described DDPG approach achieved higher return than both traditional min-variance portfolio allocation and the Dow Jones Industrial Average.

    [8] Practical Deep Reinforcement Learning Approach for Stock Trading, section 1 Introduction
    “Motivated by the above challenges, we explore a deep reinforcement learning algorithm, namely Deep Deterministic Policy Gradient (DDPG) [9], to find the best trading strategy in the complex and dynamic stock market. This algorithm consists of three key components: (i) actor-criti…”
  32. methodsupported

    Deep Q-Network training stores previous states, actions, rewards, and next states in experience replay, samples them randomly in small batches, and uses a target Q-network to estimate future rewards.

    [9] Application of deep reinforcement learning for Indian stock trading automation, section 2.1 Deep Q-Network
    “Deep Q-Network is a classical and outstanding algorithm of Deep Reinforcement Learning and it’s model architecture is shown in Figure 1. It is a model-free reinforcement learning that can deal with sequential decision tasks. The goal of the learning is to learn an optimal policy …”
  33. methodsupported

    In DQN, the target Q-network is periodically copied from the main Q-network because using separate networks increases training stability under highly correlated and rapidly arriving data.

    [9] Application of deep reinforcement learning for Indian stock trading automation, section 2.1 Deep Q-Network
    “where, Qt​a​r​g​e​tQ_{target} is the target Q value obtained using the Bellman Equation and θ\theta denotes the parameters of the Q-Network. In DQN there are two Q-Networks: main Q-Network and target Q-Network. The target Q-Network is different from the main Q-Network which is be…”
  34. methodsupported

    Double DQN addresses DQN's tendency to overestimate Q-values by using another neural network to reduce the influence of accumulated estimation error.

    [9] Application of deep reinforcement learning for Indian stock trading automation, section 2.1 Deep Q-Network
    “where, Qt​a​r​g​e​tQ_{target} is the target Q value obtained using the Bellman Equation and θ\theta denotes the parameters of the Q-Network. In DQN there are two Q-Networks: main Q-Network and target Q-Network. The target Q-Network is different from the main Q-Network which is be…”
  35. methodsupported

    The Indian stock-trading study trains DQN, Double DQN, and Dueling Double DQN agents for holding, buying, and selling and validates them on unseen data from a later period.

    [9] Application of deep reinforcement learning for Indian stock trading automation, section 1 Introduction
    “In the present paper Deep Reinforcement Learning is applied to Indian stock market on ten randomly selected datsets to automate the stock trading and to maximize the profit. Model is trained with historical stock data to predict the stock trading strategy by using Deep Q-Network …”
  36. methodsupported

    The described trading agent combines stacked denoising autoencoders for market representation learning, long short-term memory networks for financial time-series dependence, position-controlled actions, and n-step rewards.

    [10] Deep Robust Reinforcement Learning for Practical Algorithmic Trading, abstract DOI 10.1109/access.2019.2932789
    “In algorithmic trading, feature extraction and trading strategy design are two prominent challenges to acquire long-term profits. However, the previously proposed methods rely heavily on domain knowledge to extract handcrafted features and lack an effective way to dynamically adj…”
  37. resultsupported

    The described deep reinforcement learning trading agent reportedly outperformed its baselines and achieved stable risk-adjusted returns in both stock and futures markets.

    [10] Deep Robust Reinforcement Learning for Practical Algorithmic Trading, abstract DOI 10.1109/access.2019.2932789
    “In algorithmic trading, feature extraction and trading strategy design are two prominent challenges to acquire long-term profits. However, the previously proposed methods rely heavily on domain knowledge to extract handcrafted features and lack an effective way to dynamically adj…”
  38. limitationsupported with limits

    Trading performance in the evaluated machine-learning strategies was sensitive to changes in transaction costs, and the passage notes that earlier studies often used short backtests, small datasets, limited features, no transaction costs, and no statistical significance tests.

    [12] An Empirical Study of Machine Learning Algorithms for Stock Daily Trading Strategy, abstract DOI 10.1155/2019/7816154Passage states 'trading performance of all ML algorithms is sensitive to the changes of transaction cost' and criticizes earlier studies for 'short backtesting period' and 'no consideration of transaction cost,' but does not explicitly state 'no statistical significance tests' was a flaw of earlier studies—only that their own results lacked it.
    “According to the forecast of stock price trends, investors trade stocks. In recent years, many researchers focus on adopting machine learning (ML) algorithms to predict stock price trends. However, their studies were carried out on small stock datasets with limited features, shor…”
  39. resultsupported

    On datasets containing 424 S&P 500 component stocks and 185 CSI 300 component stocks from 2010 to 2017, traditional machine-learning algorithms performed better on most directional indicators, while DNN models performed better when transaction costs were considered.

    [12] An Empirical Study of Machine Learning Algorithms for Stock Daily Trading Strategy, abstract DOI 10.1155/2019/7816154
    “According to the forecast of stock price trends, investors trade stocks. In recent years, many researchers focus on adopting machine learning (ML) algorithms to predict stock price trends. However, their studies were carried out on small stock datasets with limited features, shor…”
  40. methodsupported

    The RL Trading Agent implements an end-to-end pipeline covering data ingestion, PPO training, backtesting, and live paper-trading deployment for six stocks using live market data, NLP sentiment analysis, and market-regime detection.

    [14] Connor-Appleton/RL-Trading-Agent (Reinforcement learning stock trading agent built with PPO, FinBERT sentiment analysis, and live Alpaca paper trading dep), readme lines L1-L16 @ 1b609c66a4f2
    “# RL Trading Agent A reinforcement learning stock trading agent built from scratch using Proximal Policy Optimization (PPO). The agent learns to manage a portfolio of 6 stocks using live market data, NLP sentiment analysis, and market regime detection — deployed to a live paper …”

Sources

  1. [1]
    Xiao-Yang Liu, Ziyi Xia, Hongyang Yang, Jiechao Gao, Daochen Zha, Ming Fang Zhu. Dynamic Datasets and Market Environments for Financial Reinforcement Learning. arXiv (Cornell University), 2023.openalex · primary · DOI 10.48550/arxiv.2304.13174 · https://doi.org/10.48550/arxiv.2304.13174
  2. [2]
    Xiao-Yang Liu, Ziyi Xia, Jingyang Rui, Jiechao Gao, Hongyang Yang, Ming Fang Zhu. FinRL-Meta: Market Environments and Benchmarks for Data-Driven Financial Reinforcement Learning. RePEc: Research Papers in Economics, 2022.openalex · primary · DOI 10.48550/arxiv.2211.03107 · https://doi.org/10.48550/arxiv.2211.03107
  3. [3]
    Xiao-Yang Liu, Hongyang Yang, Qian Chen, Runjia Zhang, Liuqing Yang, Bowen Xiao, Christina Dan Wang. FinRL: A Deep Reinforcement Learning Library for Automated Stock Trading in Quantitative Finance. arXiv, 2020.arxiv · primary · https://arxiv.org/abs/2011.09607v2
  4. [4]
    Xiao-Yang Liu, Hongyang Yang, Jiechao Gao, Christina Dan Wang. FinRL: Deep Reinforcement Learning Framework to Automate Trading in Quantitative Finance. arXiv, 2021.arxiv · primary · https://arxiv.org/abs/2111.09395v1
  5. [5]
    Adrian Millea. Deep Reinforcement Learning for Trading—A Critical Survey. Data, 2021.openalex · primary · DOI 10.3390/data6110119 · https://doi.org/10.3390/data6110119
  6. [6]
    Nikolaus Holzer, Keyi Wang, Kairong Xiao, Xiao-Yang Liu Yanglet. Revisiting Ensemble Methods for Stock Trading and Crypto Trading Tasks at ACM ICAIF FinRL Contest 2023-2024. arXiv, 2025.arxiv · primary · https://arxiv.org/abs/2501.10709v1
  7. [7]
    Xiaoyang Liu, Jingyang Rui, Jiechao Gao, Liuqing Yang, Hongyang Yang, Zhaoran Wang. FinRL-Meta: A Universe of Near-Real Market Environments for Data-Driven Deep Reinforcement Learning in Quantitative Finance. RePEc: Research Papers in Economics, 2021.openalex · primary · DOI 10.48550/arxiv.2112.06753 · https://doi.org/10.48550/arxiv.2112.06753
  8. [8]
    Xiao-Yang Liu, Zhuoran Xiong, Shan Zhong, Hongyang Yang, Anwar Walid. Practical Deep Reinforcement Learning Approach for Stock Trading. arXiv, 2018.arxiv · primary · https://arxiv.org/abs/1811.07522v3
  9. [9]
    Supriya Bajpai. Application of deep reinforcement learning for Indian stock trading automation. arXiv, 2021.arxiv · primary · https://arxiv.org/abs/2106.16088v1
  10. [10]
    Yang Li, Wanshan Zheng, Zibin Zheng. Deep Robust Reinforcement Learning for Practical Algorithmic Trading. IEEE Access, 2019.openalex · primary · DOI 10.1109/access.2019.2932789 · https://doi.org/10.1109/access.2019.2932789
  11. [11]
    Santosh Kumar Sahu, Anil Mokhade, Neeraj Dhanraj Bokde. An Overview of Machine Learning, Deep Learning, and Reinforcement Learning-Based Techniques in Quantitative Finance: Recent Progress and Challenges. Applied Sciences, 2023.openalex · primary · DOI 10.3390/app13031956 · https://doi.org/10.3390/app13031956
  12. [12]
    Dongdong Lv, Shuhan Yuan, Meizi Li, Yang Xiang. An Empirical Study of Machine Learning Algorithms for Stock Daily Trading Strategy. Mathematical Problems in Engineering, 2019.openalex · primary · DOI 10.1155/2019/7816154 · https://doi.org/10.1155/2019/7816154
  13. [13]
    Nicole Hui Lin Kan, Qi Ping Cao, Chai Hiok Quek. Learning and processing framework using Fuzzy Deep Neural Network for trading and portfolio rebalancing. Applied Soft Computing, 2024.openalex · primary · DOI 10.1016/j.asoc.2024.111233 · https://doi.org/10.1016/j.asoc.2024.111233
  14. [14]
    Connor-Appleton. Connor-Appleton/RL-Trading-Agent (Reinforcement learning stock trading agent built with PPO, FinBERT sentiment analysis, and live Alpaca paper trading dep). GitHub, 2026.github · secondary · https://github.com/Connor-Appleton/RL-Trading-Agent
  15. [15]
    finrl.readthedocs.io. Welcome to FinRL Library! — FinRL 0.3.1 documentation.docs · secondary · https://finrl.readthedocs.io/en/latest/
  16. [16]
    Deep Pandey, Qi Yu. Learn to Accumulate Evidence from All Training Samples: Theory and Practice. arXiv, 2023.arxiv · primary · https://arxiv.org/abs/2306.11113v2
  17. [17]
    Alfonso Guarino, Luca Grilli, Domenico Santoro, Francesco Messina, Rocco Zaccagnino. To learn or not to learn? Evaluating autonomous, adaptive, automated traders in cryptocurrencies financial bubbles. Neural Computing and Applications, 2022.openalex · primary · DOI 10.1007/s00521-022-07543-4 · https://doi.org/10.1007/s00521-022-07543-4
  18. [18]
    Abdul Wahab, Raksha Kumaraswamy, Martha White. Value Bonuses using Ensemble Errors for Exploration in Reinforcement Learning. arXiv, 2026.arxiv · primary · https://arxiv.org/abs/2602.12375v1