# Uczenie ze wzmocnieniem w handlu i alokacji portfela

EN: **Reinforcement learning for trading and portfolio allocation** · id `rltrading` · aliases: deep reinforcement learning trading, DRL portfolio, FinRL, RL w tradingu

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [AI w finansach](https://aiatlasgraph.com/t/finance.md) › [Inwestowanie ilościowe i handel algorytmiczny](https://aiatlasgraph.com/t/quanttrading.md) › Uczenie ze wzmocnieniem w handlu i alokacji portfela

## Description

- PL: Handel i alokacja portfela jako MDP oraz trenowanie agentów głębokiego RL (PPO, SAC, DDPG) w środowiskach rynkowych z kosztami transakcyjnymi.
- EN: Trading and portfolio allocation as an MDP, training deep RL agents (PPO, SAC, DDPG) in market environments with transaction costs.

## In one sentence

- PL: Agent uczy się kupować, sprzedawać i rozkładać pieniądze między aktywa metodą prób i błędów w symulacji rynku.
- EN: An agent learns to buy, sell and spread money across assets by trial and error in a market simulation.

## Problem it solves

- PL: Inwestowanie to ciąg decyzji, w którym każdy ruch zmienia kolejne możliwości, a sama prognoza nie mówi, co zrobić.
- EN: Investing is a chain of decisions where each move changes the next options, and a forecast alone does not say what to do.

## What it does

- PL: Jak gracz trenujący na powtórkach meczów: setki razy rozgrywa historię rynku i wzmacnia ruchy, które dawały zysk przy rozsądnym ryzyku.
- EN: Like a player training on match replays: replays market history hundreds of times and reinforces moves that paid off at sensible risk.

## Everyday example

- PL: Studentka uruchamia otwartą bibliotekę, trenuje agenta na notowaniach z kilku lat i porównuje jego wynik z prostym kupnem indeksu.
- EN: A student runs an open library, trains an agent on several years of prices and compares it with simply buying the index.

## This concerns you if you…

- PL: uczysz się uczenia ze wzmocnieniem na praktycznym przykładzie
- PL: eksperymentujesz z automatycznym inwestowaniem
- EN: are learning reinforcement learning on a practical example
- EN: experiment with automated investing

## Keywords

FinRL · deep reinforcement learning · PPO · SAC · DDPG · portfolio allocation · trading environment · optimal execution

## How it works

- PL: Stan obejmuje ceny, wskaźniki i bieżący portfel, akcją jest zmiana pozycji, a nagrodą zmiana wartości portfela pomniejszona o koszty i karę za ryzyko. Agentów trenuje się algorytmami głębokiego RL w środowiskach zbudowanych z danych historycznych i ocenia backtestem na okresie spoza treningu.
- EN: The state holds prices, indicators and current holdings, the action changes positions, and the reward is the change in portfolio value minus costs and a risk penalty. Agents are trained with deep RL algorithms in environments built from historical data and judged by backtests on a held-out period.

## Limits

- PL: Środowisko z danych historycznych nie reaguje na zlecenia agenta, więc pomija wpływ na cenę. Agent łatwo przeucza się do jednego okresu rynkowego, a wyniki bywają niestabilne między uruchomieniami. Większość publikowanych wyników to backtesty, nie handel na żywo.
- EN: An environment built from history does not react to the agent's orders, so it ignores price impact. Agents easily overfit one market regime, and results vary between runs. Most published results are backtests, not live trading.

## Key terms

- PL: **MDP**: Opis problemu jako stanów, akcji i nagród w czasie.
- PL: **funkcja nagrody**: Liczba mówiąca agentowi, czy ruch był dobry.
- PL: **poślizg cenowy**: Różnica między ceną oczekiwaną a ceną wykonania.
- EN: **MDP**: Describing a problem as states, actions and rewards over time.
- EN: **reward function**: A number telling the agent whether a move was good.
- EN: **slippage**: Gap between the expected price and the execution price.

## Know first

- [Proces decyzyjny Markowa (MDP) (Markov decision processes (MDP))](https://aiatlasgraph.com/t/mdp.md)
- [Proximal Policy Optimization (PPO) (Proximal policy optimization (PPO))](https://aiatlasgraph.com/t/ppo.md)

## Related topics

Untyped, symmetric "see also" links.

- [Optymalne wykonanie dużych zleceń (Optimal trade execution)](https://aiatlasgraph.com/t/optimalexecution.md)
- [Środowiska i symulatory do RL (RL environments and simulators)](https://aiatlasgraph.com/t/rlenvs.md)

## Sources

- [FinRL: A Deep Reinforcement Learning Library for Automated Stock Trading in Quantitative Finance](<https://arxiv.org/abs/2011.09607>) `finrl-2020` · by Xiao-Yang Liu, Hongyang Yang, Qian Chen, Runjia Zhang, Liuqing Yang, Bowen Xiao, Christina Dan Wang

---

AI Atlas revision 122 (2026-10-30) · HTML: https://aiatlasgraph.com/t/rltrading · index: https://aiatlasgraph.com/llms.txt · everything: https://aiatlasgraph.com/llms-full.txt · updated 2026-10-30
