# Sentarl Trading Eval

> Evaluates a sentiment-aware reinforcement learning agent's ability to generate profitable and stable trading strategies across diverse market conditions, transaction cost regimes, and varying levels of financial news coverage. It benchmarks performance against a sentiment-free RL ablation and a buy-and-hold strategy using standard financial return and risk metrics. Use when the user wants to benchmark on 20-Asset Financial Time Series & News Corpus (2018-2020), or asks about evaluating this task. Reports Total Return (TR).

- Skill: `qhjqhj00/sentarl-trading-eval` (Agent Skill)
- Install (CLI): `npx skillmds add qhjqhj00/sentarl-trading-eval`
- Raw SKILL.md: https://api.skillmd.com/api/skills/qhjqhj00/sentarl-trading-eval/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: qhjqhj00 (https://skillmd.com/u/qhjqhj00)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/qhjqhj00/sentarl-trading-eval

---


# sentarl-trading-eval

> Intelligent Trading Systems: A Sentiment-Aware Reinforcement Learning Approach — Paiva et al. (2021) (arXiv:2112.02095, 2021)

## What this evaluates

Evaluates a sentiment-aware reinforcement learning agent's ability to generate profitable and stable trading strategies across diverse market conditions, transaction cost regimes, and varying levels of financial news coverage. It benchmarks performance against a sentiment-free RL ablation and a buy-and-hold strategy using standard financial return and risk metrics.

## Datasets

- **20-Asset Financial Time Series & News Corpus (2018-2020)** — total 5267; splits: train (3377), test (374); repo https://github.com/xicocao/its-sentarl

## Metrics

- `Total Return (TR)` **(primary)** — range: percent
  - Accumulated return over the initial wealth: TR = (sum_{t=1}^T ρ_t^{Trader}) / ψ, where ψ is the initial cash required to buy φ shares at t=1.
- `Annualized Return (AR)` — range: percent
  - Normalizes TR across different evaluation periods: AR = (1 + TR)^(D/365) - 1, where D is the total number of trading days in the test set.
- `Sharpe Ratio (SR)` — range: other
  - Measures performance stability across trials/periods: SR = avg(TR_k) / std(TR_k), where k indexes different random initializations and rolling windows.

## Input / output format

**Input**: Hourly price time series, corresponding financial news headlines, and pre-computed sentiment scores aggregated into the agent's state representation.

**Output**: Discrete trading action (buy/sell/hold) for a fixed position size (φ=1 share) at each hourly timestep.

## Scoring recipe

```python
def compute_metrics(returns, initial_wealth, trading_days, all_tr_trs):
    TR = sum(returns) / initial_wealth
    AR = (1 + TR) ** (trading_days / 365) - 1
    SR = np.mean(all_tr_trs) / np.std(all_tr_trs)
    return TR, AR, SR
```

## Common pitfalls

- News coverage is highly sparse (~25% average), meaning sentiment features are missing for most hourly price points and must be handled carefully during state construction.
- RL performance is highly sensitive to weight initialization; results must be averaged over multiple random seeds (5 used) to be statistically reliable.
- Transaction costs drastically alter strategy viability; metrics must be evaluated and reported under both zero-cost and high-cost (0.25%) regimes.

## Evidence (verbatim from paper)

> We report standard metrics for measuring the performance of autonomous trading agents. Initially, we have the TR given by the accumulated return from each instant (Eq. 6) over the initial wealth ψ as formulated below... Then, a metric such as the annualized return (AR) is recommended to compare research with data with different periods and sizes... Ultimately, the TR for all trials of a model k – meaning the different initializations and periods – determine the SR metric, formulated with inspiration from previous work [4, 17] as SR = avg(TR_k) / std(TR_k).

## Citation

```bibtex
@misc{paiva2021intelligent,
  title={Intelligent Trading Systems: A Sentiment-Aware Reinforcement Learning Approach},
  author={Paiva et al. (2021)},
  year={2021},
  note={arXiv:2112.02095}
}
```

- arXiv: 2112.02095

