algorithmic_trading / config.yaml
Edwin Salguero
Cursor
feat: default ingest to Yahoo and restore a full README
3d257f3
Raw History Blame Contribute Delete
2.48 kB
# Configuration file for the agentic AI trading system
data_source:
type: 'yahoo'
path: 'data/market_data.csv'
trading:
symbol: 'AAPL'
timeframe: '1d'
capital: 100000
risk:
max_position: 100
max_drawdown: 0.05
execution:
broker_api: 'paper' # Options: 'paper', 'alpaca_paper', 'alpaca_live'
order_size: 10
delay_ms: 100
success_rate: 0.95
# Alpaca configuration
alpaca:
api_key: '' # Set via environment variable ALPACA_API_KEY
secret_key: '' # Set via environment variable ALPACA_SECRET_KEY
paper_trading: true # Use paper trading by default
base_url: 'https://paper-api.alpaca.markets' # Paper trading URL
live_url: 'https://api.alpaca.markets' # Live trading URL
data_url: 'https://data.alpaca.markets' # Market data URL
websocket_url: 'wss://stream.data.alpaca.markets/v2/iex' # WebSocket URL
account_type: 'paper' # 'paper' or 'live'
# Yahoo Finance (default ingest). Unofficial API, typically delayed; 1m lookback is ~7 days.
# Unofficial API, typically delayed; 1m lookback is ~7 days.
yahoo:
poll_interval_seconds: 60
# Keep true. With auto_adjust off, Yahoo returns raw Close and every stock
# split reads as a crash (NVDA's June 2024 10:1 becomes a -90% bar).
auto_adjust: true
# Yahoo returns the still-forming period as an ordinary row. Emitting it would
# trade on a close that has not happened yet.
emit_incomplete_bars: false
max_backoff_seconds: 900
start_date: '2024-01-01'
end_date: '2026-12-31'
# Synthetic data generation settings
synthetic_data:
base_price: 150.0
volatility: 0.02
trend: 0.001
noise_level: 0.005
generate_data: true
data_path: 'data/synthetic_market_data.csv'
# Logging configuration
logging:
log_level: 'INFO'
log_dir: 'logs'
enable_console: true
enable_file: true
max_file_size_mb: 10
backup_count: 5
# FinRL configuration
finrl:
algorithm: 'PPO' # PPO, A2C, DDPG, TD3
learning_rate: 0.0003
batch_size: 64
buffer_size: 1000000
learning_starts: 100
gamma: 0.99
tau: 0.005
train_freq: 1
gradient_steps: 1
target_update_interval: 1
exploration_fraction: 0.1
exploration_initial_eps: 1.0
exploration_final_eps: 0.05
max_grad_norm: 10.0
verbose: 1
tensorboard_log: 'logs/finrl_tensorboard'
training:
total_timesteps: 100000
eval_freq: 10000
save_best_model: true
model_save_path: 'models/finrl_best/'
inference:
use_trained_model: false
model_path: 'models/finrl_best/best_model'