Skip to content

Implement portfolio order fallbacks#7

Open
lee101 wants to merge 108 commits intomainfrom
codex/handle-trade-refusal-in-portfolio-packing
Open

Implement portfolio order fallbacks#7
lee101 wants to merge 108 commits intomainfrom
codex/handle-trade-refusal-in-portfolio-packing

Conversation

@lee101
Copy link
Owner

@lee101 lee101 commented May 28, 2025

Summary

  • add _parse_available_balance helper
  • adjust order quantity on insufficient funds using new helper
  • test error handling for insufficient funds

Testing

  • pytest tests/test_alpaca_wrapper.py::test_execute_portfolio_orders_handles_errors -q
  • pytest tests/test_alpaca_wrapper.py::test_open_order_at_price_or_all_adjusts_quantity_on_insufficient_funds -q

@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
…tino=7.70), 82 ranked seeds

New top finds:
- s520 (s501-600): +6135%@5bps, Sortino=7.70, WR=70.1% — #7 all-time, 5bps>8bps
- s810 (s801-900): +1681%@5bps, Sortino=4.47 — new s801-900 best
- s196 (s121-200): +1909%@5bps, Sortino=6.41 — 5bps>8bps robust
- s320 (s301-400): +1120%@5bps, Sortino=4.40 — 5bps>>8bps very robust
- s721 (s701-800): +859%@5bps, Sortino=3.56 — 5bps>>8bps robust
- s617, s620, s618 (s601-700): 836%/688%/563%@5bps — all 5bps>8bps
- s328, s323 (s301-400): 823%/811%@5bps — both robust
- s175 (s121-200): +630%@5bps, Sortino=5.76 — exceptional risk-adj
- s189 OVERFITTER: 8bps=+715%→5bps=+20%

Ranges complete/progress:
- s121-200: DONE (79 seeds)
- s901-1000: sweep just started

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
lee101 added a commit that referenced this pull request Mar 25, 2026
… s321(#17,+3072%)

Today's top finds (all 5bps ann):
- s520: +6132% ann, Sortino=7.70 — NEW #7 (nearly ties s19, ultra-robust 5bps>8bps)
- s416: +4099% ann, Sortino=6.19 — NEW #12
- s609: +4450% ann, Sortino=5.04 — NEW #9
- s321: +3072% ann, Sortino=5.07 — NEW #17
- s513: +2529% ann, Sortino=5.50 — new top-25
- s410: +2951% ann, Sortino=5.76 — new top-22

Seed sweep now covers s1-700+ with 7 parallel pools.
Updated top-5: s71(+9381%) > s507(+8273%) > s118(+7426%) > s404(+7319%) > s123(+6837%)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
lee101 added a commit that referenced this pull request Mar 25, 2026
s501-600 now has THREE top-10 seeds: s507(#2), s520(#7), s523(#8)
s523: 5bps=+5928%, 8bps=+4810%, Sortino=7.56, WR=67.4%
5bps>>8bps — extremely robust, stronger at lower slippage

s501-600 is now the hottest range:
- s507: #2 all-time
- s520: #7 all-time, Sortino=7.70
- s523: #8 all-time, Sortino=7.56
- s513: #30 all-time

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
lee101 added a commit that referenced this pull request Mar 25, 2026
Massive session of crypto70 seed sweeping discoveries:
- s240: NEW PRODUCTION CHAMPION — +17,642% ann at 5bps, Sortino=7.00, 100% profitable
  (previously s71 held record at +9,381%)
- s434: NEW #2 — +10,359% ann at 5bps, Sortino=6.99 (s401-500)
- s734: NEW #7 — +7,152% at 5bps, ROBUST, Sortino=6.72 (s701-800)
- s628: NEW #8 — +7,145% at 5bps, ROBUST, Sortino=6.79 (s601-700)
- s249: NEW #10 — +6,285% at 5bps, Sortino=6.34 (found same session as s240)
- s523: NEW #12 — +5,919% at 5bps, ROBUST, Sortino=7.56 (s501-600)
- s827: NEW #14 — +4,820% at 5bps, ROBUST, Sortino=5.87 (s801-900)

Also confirmed: s210(+4461%), s129(+4265%), s208(+2064%), s322(+1418% 5bps>>8bps!)
Overfitters identified: s401(+152%!), s403(+170%), s806(+116%), s189(+20%), s709(+396%)

Active sweeps: s201-300, s301-400, s401-500, s501-600, s601-700, s701-800, s801-900,
s901-1000 (NEW); pool s901-1000 started this session (PID 2378671)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
lee101 added a commit that referenced this pull request Mar 25, 2026
Updated top-10 5bps leaderboard (145 evaluated):
#4 s456: +8,802% (ultra-robust: 5bps > 8bps, Sortino=6.71)
#6 s452: +8,002% (ultra-robust: 5bps > 8bps, Sortino=6.65)
#7 s734: +7,160% (ultra-robust: 5bps > 8bps)
#10 s446: +6,536% (ultra-robust: 5bps > 8bps)
#15 s827: +4,801% (ultra-robust: 5bps > 8bps)

7 sweeps ongoing: s201-900 at 55-62% complete

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
lee101 added a commit that referenced this pull request Mar 25, 2026
Leaderboard updated (169 evaluated at 5bps):
#1 s275: +23,595% (Sortino=9.0, ultra-robust: 5bps > 8bps)
#2 s240: +17,642%
#3 s434: +10,359%
#4 s71:  +9,381%
#5 s456: +8,802% (new)
#6 s507: +8,273%
#7 s452: +8,002% (new)

Top-10 mean: +10,796% ann | 7/10 ultra-robust (5bps >= 8bps)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
lee101 added a commit that referenced this pull request Mar 25, 2026
…(+7647%), s578(+5688%), s1203(+3619%)

Key new finds (all ROBUST):
- s292: +19,815% ann, S=7.99 — new #2 ROBUST champion
- s765: +7,647% ann, S=5.76 — new #7 ROBUST
- s578: +5,688% ann, S=8.14 — new #18 ROBUST (high sortino)
- s1203: +3,619% ann, S=6.43 — new from s1201-1300 range
- s1202: +4,121% ann, S=5.65 — new from s1201-1300 range
- s1206: +1,012% ann ROBUST, s1005: +854% ann ROBUST

New ranges discovered: s1001-1100 (103 seeds), s1101-1200 (6 seeds), s1201-1300 (14 seeds)
5bps auto-monitor updated to cover all ranges up to s1300+

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant