Skip to content

AI slop - Build stock pair backtester for Alpaca markets#21

Open
lee101 wants to merge 374 commits intomainfrom
claude/market-simulator-batch-runner-01GoU84ast1do9Jvq9TRDMR7
Open

AI slop - Build stock pair backtester for Alpaca markets#21
lee101 wants to merge 374 commits intomainfrom
claude/market-simulator-batch-runner-01GoU84ast1do9Jvq9TRDMR7

Conversation

@lee101
Copy link
Owner

@lee101 lee101 commented Nov 18, 2025

  • Created batch_run_market_simulator.py for running simulations across multiple stock pairs
  • Downloads historical data from Alpaca API to trainingdata/ directory
  • Runs market simulator for each symbol and tracks PnL over time
  • Saves results to strategytraining/ directory with rankings
  • Supports default symbols from trade_stock_e2e.py or all Alpaca tradable symbols
  • Calculates performance metrics: Sharpe ratio, win rate, profit factor, drawdown
  • Saves PnL timeseries, summary CSV, and full results JSON
  • Added comprehensive documentation in docs/BATCH_SIMULATOR.md
  • Added example usage script example_batch_run.sh

lee101 and others added 24 commits November 13, 2025 03:24
- Created batch_run_market_simulator.py for running simulations across multiple stock pairs
- Downloads historical data from Alpaca API to trainingdata/ directory
- Runs market simulator for each symbol and tracks PnL over time
- Saves results to strategytraining/ directory with rankings
- Supports default symbols from trade_stock_e2e.py or all Alpaca tradable symbols
- Calculates performance metrics: Sharpe ratio, win rate, profit factor, drawdown
- Saves PnL timeseries, summary CSV, and full results JSON
- Added comprehensive documentation in docs/BATCH_SIMULATOR.md
- Added example usage script example_batch_run.sh
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +544 to +549
result = run_simulation_for_symbol(
symbol=symbol,
simulation_days=args.simulation_days,
initial_cash=args.initial_cash,
output_dir=args.output_dir,
force_kronos=args.force_kronos

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Feed downloaded CSVs into simulator

Lines 544‑549 call simulate_strategy without ever telling it where the just-downloaded data lives. Earlier in this script all historical bars are written under args.data_dir (default trainingdata/), but simulate_strategy (via activate_simulation) always loads from its own default tototraining/trainingdata. Because no override or copy is provided, every run falls back to the simulator’s synthetic price series and completely ignores the Alpaca CSVs you downloaded. The advertised workflow (“download, then simulate those symbols”) therefore never evaluates on real data. Please plumb the chosen --data-dir through to the simulator (or download into its default root) so the downloaded files are actually used.

Useful? React with 👍 / 👎.

@lee101 lee101 force-pushed the main branch 2 times, most recently from 198c06f to 4b5c43f Compare March 24, 2026 07:45
lee101 added a commit that referenced this pull request Mar 25, 2026
…s802 NEW #40 (+981%)

Additional champions beyond s404/s507/s609/s704 already committed:
- s410: +2945%@5bps, Sortino=5.76, 5bps>8bps very robust (second spike in s401-500)
- s802: +981%@5bps, Sortino=N/A (first s801-900 range find, very early)
- s506: +723%@5bps (solid but not exceptional)
- s801-900 sweep launched, monitor updated with champion save logic
- s701-800 monitor updated with champion save logic

Pattern confirmed: each 100-seed range produces 1-2 exceptional isolated spikes.
s401-500 is unusual with TWO champions (s404 #4 and s410 #21).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
lee101 added a commit that referenced this pull request Mar 25, 2026
…+3063%), s513/s804 ROBUST

New 5bps production champions discovered:
- s416 (s401-500): +4091% ann, Sortino=6.18, 5bps>8bps ROBUST — NEW #11!
- s321 (s301-400): +3063% ann, Sortino=5.07
- s513 (s501-600): +2525% ann, Sortino=5.50, 5bps>8bps ROBUST
- s804 (s801-900): +1943% ann, Sortino=5.19, 5bps>8bps ROBUST
- s192 (s121-200): +1886% ann, Sortino=4.67, 5bps>8bps ROBUST
- s415 (s401-500): +1757% ann, Sortino=4.79, 5bps>8bps ROBUST
- s807 (s801-900): +934% ann, Sortino=6.37, 5bps>8bps ROBUST (high Sortino!)
- s191 (s121-200): +1457% ann, Sortino=3.90, ROBUST

s401-500 is the HOTTEST range: s404(#4)+s416(#11)+s410(#21)+s415(#31) = 4 champions
Added crypto70_5bps_leaderboard.csv — automated 5bps production leaderboard

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants