Skip to main content

PPO Algorithm

In short

Proximal Policy Optimization — the RL algorithm powering our trading agent

PPO is one of the best algorithms for training AI agents. It learns slowly and steadily instead of making wild policy changes that could destabilize training. Think of it as a careful student who improves step by step.

Proximal Policy Optimization (PPO) is an actor-critic RL algorithm that constrains policy updates to prevent destabilizing large changes. It uses a clipped surrogate objective to maintain trust regions. PPO is stable, sample-efficient, and widely used for financial trading agents.

Formula

L_CLIP = E[min(r_t × A_t, clip(r_t, 1-ε, 1+ε) × A_t)]

Related concepts

  • Reinforcement LearningRL is how an AI learns to make decisions by trying things and getting rewards or penalties. Think of training a dog — good moves get treats, bad moves get nothing. The AI keeps adjusting until it finds the best strategy.
  • Reward FunctionThe reward function is the AI's score card. If we reward just raw returns, the agent might take huge risks. Our agent is rewarded for Sharpe ratio — returns relative to risk — which incentivizes consistent, risk-adjusted gains.
  • Observation SpaceThe observation space is everything the AI trading agent can see before making a decision. It might include price data, technical indicators, sentiment scores, and portfolio state. More useful data = better decisions (up to a point).
  • Walk-Forward ValidationWalk-forward validation trains the AI on old data, then tests it on the next period — then repeats. This mimics real-world conditions and prevents the AI from 'memorizing' the training data instead of learning real patterns.