feat(autoresearch): live trade bridge + all-symbol research (HCLI port 2/5) - #28
Open
JaeLeex wants to merge 1 commit into
Open
feat(autoresearch): live trade bridge + all-symbol research (HCLI port 2/5)#28JaeLeex wants to merge 1 commit into
JaeLeex wants to merge 1 commit into
Conversation
…t 2/5) `hl strategy load` runs an autoresearch strategy live: AutoBarStrategy bridges the hourly on_bar(bar_data, portfolio)->[Signal] contract to the tick engine (rolling tick→hourly fold, on_bar once/boundary, target held between bars, signed-USD target → delta vs position_notional → IOC order). Faithful port of ACC strategy-deployer.ts. `hl autoresearch run` ports the Karpathy loop (scaffold→baseline→propose→eval→ keep/discard, results.tsv + JSONL) + scaffold template; adds status/results/tail; cli/autotrader_bridge.py results parser. All-symbol research: scaffold prepare.py adds an HIP-3 data adapter for BTCSWP (yex:BTCSWP, testnet) + commodities (xyz:GOLD/SILVER/COPPER/PLATINUM/PALLADIUM/ NATGAS/BRENTOIL/CL, mainnet) — coin names discovered live from the HL info API; crypto stays on CryptoCompare. Real backtests run (GOLD 3923 bars, BTCSWP 2672). Guardrails: live-vs-backtest drift detection, one-shot retrain hook, reduce_only/safe_mode suppression.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 2 of 5 of the HCLI → agent-cli port. Lets a user research → create → trade a strategy entirely from agent-cli, for crypto and BTCSWP + commodities. This is the foundation the House fleet (PR 3/5) builds on.
What's new
hl strategy load <name>— runs an autoresearch strategy LIVE.AutoBarStrategybridges the hourlyon_bar(bar_data, portfolio) -> [Signal]contract to the tick engine: folds 10s ticks into hourly bars, callson_baronce per boundary (wall-clock OR tick-count fallback for replay/mock), holds target between bars, and translates eachSignal.target_position(signed USD) intodelta = target − context.position_notional → |delta|/midIOC order. Faithful port of ACCserver/src/strategy-deployer.ts.hl strategy new|list|show|path|prepare— scaffold lifecycle.hl autoresearch run <name> [--iterations] [--agent demo|llm]— the Karpathy loop (scaffold → baseline → propose → eval → keep/discard,results.tsv+ JSONL event log) +status|results|tail. Ports the nunchi-cli worktree command + scaffold template.cli/autotrader_bridge.py— Python port of ACCautotrader-bridge.tsresults.tsv parser (best score/commit/#experiments).All-symbol support (real coin names, discovered live — no fabrication)
The scaffold
prepare.pygains an HIP-3 data adapter. Coin names were discovered from the live HL info API (perpDexs+meta/candleSnapshot), not guessed:yex:BTCSWP(testnet-only; mainnet returns null — routed to the testnet endpoint).xyzdex, confirmed returning candles):xyz:GOLD,xyz:SILVER,xyz:COPPER,xyz:PLATINUM,xyz:PALLADIUM,xyz:NATGAS,xyz:BRENTOIL,xyz:CL(WTI). Listed-but-no-data yet (WHEAT/CORN/URANIUM/ALUMINIUM) documented as add-once-liquid.Guardrails (the live loop previously lacked these)
retrain_callback; the runner writes aretrain.flagmarker.reduce_only/safe_mode— suppress new/added risk (reducing orders still allowed).Verification (real, measured)
hl strategy+hl autoresearch+ subcommands render.autoresearch run smoke --iterations 1 --agent demoran the full loop and wroteresults.tsv.strategy load smoke --mock --max-ticks 50→ bridge produced 15 orders, first fill = exactly 10% of $100k equity (sizing correct), 0 sent on held ticks.Notes
main. Scaffold default keepsACTIVE_SYMBOLS=[BTC,ETH,SOL]; commodities/BTCSWP are opt-in (data+adapter support all).place_orderpath (same as PR 1/5).