Production-ready Python framework for autonomous trading agents implementing theory → backtest → paper test → live trading pipeline with continuous learning.
- Event-driven backtester — Realistic OHLCV simulation with slippage, commissions
- Rule engine — Deterministic SMA-based entry/exit logic
- ML scoring model — Logistic regression probability scoring
- Paper broker — Order simulation and position tracking
- PostgreSQL journal — Complete event logging for analysis
- Analytics dashboard — Sharpe ratio, drawdown, win rate, calibration metrics
git clone https://github.com/AE707/trading-agent.git
cd trading-agent
pip install -r requirements.txt
# Run backtest
python src/backtester.py
# Run agent
python src/agent.py
# View analytics
python src/reporting.pyEdit config/config.yaml:
trading:
symbol: BTCUSDT
risk_per_trade: 0.01
max_drawdown: 0.15
db:
uri: postgresql+psycopg2://postgres:postgres@localhost:5432/tradingData → Rules → Scoring Model → Broker → Journal → Analytics
rules.py— Entry/exit logicmodels.py— ML probability scoringbroker.py— Order simulationjournal.py— Event loggingbacktester.py— Historical simulationagent.py— Main orchestrationreporting.py— Metrics & analysis
MIT