How nbucci4325/stockga works
This project combines a broadly trained neural network with a per-stock genetic search: the network estimates forward volatility, a configured mapping turns that estimate into a crossover rate, and the GA evolves and backtests indicator strategies before producing a BUY/SELL/HOLD decision. The training workflow and experiment workflow share data, indicators, and feature engineering. Edges reflect the sampled source and README; GA internals not fully shown in the excerpts are represented only where the README documents them.
Main entry points: ga.py GA Command · run_experiment.py Single-Stock Experiment · fetcher.py Market Data Fetcher · config.py Shared Configuration
Components 17
Market Data & Features
- Market Data Fetcher
data/fetcher.py - Fixed Indicators
features/indicators.py - Feature & Label Builder
features/dataset_builder.py
Volatility Model
- NN Training Workflow
train_nn.py - Model Training & Evaluation
model/train.py - Volatility Model & Artifacts
model/nn_model.py - Single-Stock Experiment
run_experiment.py - Volatility & Rate Mapping
model/predict.py
Strategy Evolution
- GA Command
ga.py - Strategy Evolution
ga.py - Signal Backtest
ga.py - Live Decision
ga.py
Configuration & Results
- Shared Configuration
config.py - Decision Log
decisions.csv - GA Results
results.csv
Other components
- User
- Yahoo Finance
Connections 31
- User → NN Training Workflow: trains model
README.md - User → Single-Stock Experiment: chooses ticker
README.md - User → GA Command: runs GA
README.md - Market Data Fetcher → Yahoo Finance: downloads prices
data/fetcher.py - NN Training Workflow → Market Data Fetcher: gets training dates
train_nn.py - NN Training Workflow → Feature & Label Builder: builds dataset
train_nn.py - Feature & Label Builder → Market Data Fetcher: fetches tickers
features/dataset_builder.py - Feature & Label Builder → Fixed Indicators: adds indicators
features/dataset_builder.py - NN Training Workflow → Model Training & Evaluation: trains and evaluates
train_nn.py - Model Training & Evaluation → Volatility Model & Artifacts: builds model
model/train.py - NN Training Workflow → Volatility Model & Artifacts: saves artifacts
train_nn.py - Single-Stock Experiment → Market Data Fetcher: fetches buffered prices
run_experiment.py - Single-Stock Experiment → Fixed Indicators: computes indicators
run_experiment.py - Single-Stock Experiment → Feature & Label Builder: builds features
run_experiment.py - Single-Stock Experiment → Volatility & Rate Mapping: predicts rate
run_experiment.py - Volatility & Rate Mapping → Volatility Model & Artifacts: loads artifacts
model/predict.py - Single-Stock Experiment → GA Command: hands off data and rate
README.md - GA Command → Single-Stock Experiment: gets experiment inputs
ga.py - GA Command → Strategy Evolution: starts search
README.md - Strategy Evolution → Signal Backtest: scores candidates
README.md - GA Command → Live Decision: produces action
README.md - GA Command → Market Data Fetcher: fetches price history
ga.py - GA Command → Fixed Indicators: computes strategy signals
ga.py - GA Command → Decision Log: appends decision
ga.py - GA Command → GA Results: records fitness
README.md - Market Data Fetcher → Shared Configuration: reads data settings
data/fetcher.py - Fixed Indicators → Shared Configuration: reads indicator settings
features/indicators.py - Feature & Label Builder → Shared Configuration: reads label settings
features/dataset_builder.py - Model Training & Evaluation → Shared Configuration: reads training settings
model/train.py - Volatility & Rate Mapping → Shared Configuration: reads mapping settings
model/predict.py - Strategy Evolution → Shared Configuration: uses gene constraints
ga.py