Skip to main content

Observation Space

In short

All market data the RL agent can 'see' when making decisions

The 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).

The observation space defines the input to the RL agent at each time step. For our trading agent, it includes normalized price features, technical indicators (RSI, MACD, BB), sentiment scores, portfolio holdings, and cash position. Feature engineering critically impacts agent performance.

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.
  • Action SpaceThe action space defines what choices the AI can make. A simple agent has 3 actions: buy, sell, hold. A more sophisticated one can trade any fraction of its portfolio. More actions = more flexibility but harder to train.
  • PPO AlgorithmPPO 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.
  • RL Model TrainingTraining the RL model means running the AI through years of historical market data thousands of times, letting it learn from its mistakes. Like a chess AI playing millions of games — it gradually figures out what works.