How krishna5166/project-2216 works
Project-2216 is a command-line algorithmic trading bot with paper-trading and credential-free simulation modes. The live path streams prices into a bot loop that records ticks, updates risk and decision engines, combines their votes, applies a final risk gate, then opens or closes positions through the selected execution layer. Separate workflows fetch historical prices, replay recorded or CSV prices through the same bot logic, compute performance metrics, and train an optional analytical model. The graph follows documented capabilities; unsampled module internals and unwired external-signal refreshers are not inferred.
Main entry points: bot.py Trading bot · train.py Model training · backtest.py Backtester · recorder.py Tick recorder
Components 25
CLI and configuration
- CLI entry
main.py - Configuration
algotrader/config.py
Live trading loop
- Trading bot
algotrader/bot.py - Tick recorder
algotrader/recorder.py
Decision and risk
- SMA strategy
algotrader/strategy.py - Analytical engine
algotrader/analytics.py - Prediction models
algotrader/models.py - Feature extraction
algotrader/features.py - Vote controller
algotrader/meta_controller.py - Signal cache
algotrader/external_signals.py - Volatility sizing
algotrader/risk.py - Risk gate
algotrader/risk_gate.py
Market and execution I/O
- Live data feed
algotrader/data_feed.py - Live execution
algotrader/execution.py - Simulation layers
algotrader/simulation.py
Replay and model research
- Historical fetcher
algotrader/historical.py - Backtester
algotrader/backtest.py - Performance metrics
algotrader/metrics.py - Model training
algotrader/train.py
Other components
- Operator
- Alpaca market stream
- Alpaca trading API
- Price CSV
- Recorded ticks
- Trained model file
Connections 33
- Operator → CLI entry: runs
- CLI entry → Trading bot: starts
- Trading bot → Configuration: loads settings
- Trading bot → SMA strategy: updates
- Trading bot → Analytical engine: updates
- Trading bot → Signal cache: reads signal
- Trading bot → Vote controller: combines votes
- Trading bot → Volatility sizing: sizes position
- Trading bot → Risk gate: checks order
- Trading bot → Tick recorder: records ticks
- Trading bot → Live data feed: consumes prices
- Live data feed → Alpaca market stream: streams prices
- Trading bot → Live execution: submits orders
- Live execution → Alpaca trading API: calls API
- Trading bot → Simulation layers: selects in dry run
- Simulation layers → Trading bot: provides prices and orders
- Historical fetcher → Alpaca market stream: fetches bars
- Historical fetcher → Price CSV: writes prices
- Backtester → Price CSV: reads prices
- Backtester → Recorded ticks: loads recorded ticks
- Backtester → Tick recorder: loads ticks
- Backtester → Trading bot: replays prices
- Backtester → Performance metrics: computes results
- Tick recorder → Recorded ticks: appends ticks
- Model training → Price CSV: reads prices
- Model training → Recorded ticks: loads recorded ticks
- Model training → Tick recorder: loads ticks
- Model training → Feature extraction: extracts features
- Model training → Prediction models: trains model
- Model training → Trained model file: saves model
- Trading bot → Trained model file: loads configured model
- Model training → Backtester: evaluates holdout
- Signal cache → Operator: awaits future provider