How It Works
CIPHER runs the same four-step loop for each trading pair on every hourly candle close. Here's exactly what happens.
Market Data Ingestion
Every hour, CIPHER pulls 5,000 candles for each of the four pairs directly from Binance in batches of 1,000. That gives it a rolling 208-day (7-month) view of price, volume, and market structure to work from. Data is split chronologically: 70% for training, 15% for validation, and 15% for testing — the model never sees the validation or test data during training.
Technical Analysis
CIPHER computes 18 technical features per candle — RSI, MACD (line, signal, histogram), Bollinger Bands (upper, middle, lower), three EMAs (9/21/50), multi-horizon returns (1h/4h/12h/24h), volume ratio, normalized ATR, and candle body patterns. Features are normalised using a MinMaxScaler fitted only on the training split to prevent data leakage. These raw features are fed directly into the PPO agent — no LSTM bottleneck in the decision path.
Knowledge Retrieval
Before every decision, CIPHER searches its 3,072-insight knowledge base — sourced from institutional trading books and research — for passages that match current conditions. Relevant matches raise signal confidence. This is what separates CIPHER from a plain indicator bot.
AI Decision
The PPO agent — trained across 90,000+ simulated trading episodes — takes the 18 raw features, recent action history, current position state, unrealised P&L, knowledge score, and a symbol one-hot vector, then outputs one of four actions: Buy, Hold, Close, or Short. The decision executes immediately. The agent rotates across all four pairs during training, learning symbol-specific patterns via the one-hot encoding.
Signal Confidence
Not every signal is equal. CIPHER scores each decision based on how strongly the knowledge base backs current market conditions. High-confidence signals get larger position sizes. Low-confidence signals default to Hold — CIPHER won't force a trade just to be active.
Risk Controls
Five safeguards fire automatically on every trade:
- Take profit (+5%) — automatically closes a position when unrealised profit hits 5%, capturing the actual price move.
- Stop loss (-3%) — automatically closes when unrealised loss hits 3%, clamped to prevent slippage beyond the stop.
- Max hold (100 candles) — force-closes any position held longer than 100 hours to prevent indefinite holds.
- Overtrading prevention — 5-candle cooldown between trades and a hard cap of 8 trades per episode. Fewer trades means higher quality entries and less fee drag.
- Fee awareness — every decision accounts for the 0.1% entry and exit fee. Fees are deducted on 95% position size, not total balance.