实盘要跑在 AWS(API key 绑了 IP 白名单),而信号在新加坡那台算。借这次 把生产从研究侧摘出来,四条具体代价里第一条已经咬过: 1. live_state.json 原先落在 research/out/,而那里 shadow_hb 会自动 rename 归档、研究脚本会写、人也手工清过。那文件装的是 MAX_DAY_LOSS 累计与已 处理信号键,被清掉不报错,只是两道闸静默失效。改到 LIVE_HOME。 2. 采集器十币清空 300~560ms 直接叠在信号到达执行器的延迟上。 3. 研究侧探针 OOM 过一次(14.9GB),当时若有仓位在场会连坐执行器。 4. 为读两个常量 import 研究侧 step43,把 numpy/pandas/pyarrow 拖进实盘 进程。抽出 stdlib-only 的 live/exit_params.py,install.sh 加断言挡回归。 新增 live/ship_signals.py:AWS 侧 ssh tail 拉总线,每次重连从文件头重放 + 按幂等键去重,断线期间的信号自愈;旧信号由 staleness 闸挡掉不补做。 带时钟倒流检测——两机时钟不同步会让那道闸静默放宽。 部署件:systemd 两单元(搬运挂了执行器仍管在场仓位的超时平仓)、 install.sh、dryrun.sh(验密钥/白名单/时钟/ssh/取整)、status.sh、README。 验证:live_exec 重构后端到端空跑,SOL 多头与 ADA 空头的止损/两级止盈/ 数量取整逐项核对正确,isolated + post_only + reduceOnly 都在;搬运的去重、 重启不重复追加、脏数据跳过、断线重连重放均已测。 Co-authored-by: Cursor <cursoragent@cursor.com>
60 lines
1.4 KiB
Plaintext
60 lines
1.4 KiB
Plaintext
# MacOS
|
|
.DS_Store
|
|
|
|
# Python
|
|
__pycache__/
|
|
*.py[cod]
|
|
*$py.class
|
|
*.pyc
|
|
*.pyo
|
|
.pytest_cache/
|
|
|
|
# Logs & databases
|
|
*.log
|
|
*.sqlite
|
|
*.sqlite-shm
|
|
*.sqlite-wal
|
|
|
|
# Office documents kept alongside the repo but not part of it.
|
|
# "~$" files are Excel's lock files, recreated every time a workbook is opened.
|
|
*.xlsx
|
|
*.xls
|
|
~$*
|
|
|
|
# Local data
|
|
data/
|
|
|
|
# Exchange history fetched by research/live/*.py. 40MB and re-fetchable from
|
|
# the venue, so it stays local; the small result CSVs it feeds are committed.
|
|
research/live/cache/
|
|
|
|
# Scratch outputs from short shakedown runs, superseded by the real collection.
|
|
research/out/archive/
|
|
|
|
# Per-trade simulation dumps from research/step*.py. 70MB+ and regenerable by
|
|
# rerunning the step; the summaries they feed live in HANDOFF.md.
|
|
research/out/*.feather
|
|
|
|
# Virtualenvs. venv writes its own .gitignore since 3.11, but only for the
|
|
# directory it creates — declare it here so other layouts are covered too.
|
|
.venv/
|
|
venv/
|
|
|
|
# Local tooling
|
|
.gstack/
|
|
research/out/*.jsonl.gz
|
|
research/out/penetration.csv
|
|
research/out/shadow_*.csv
|
|
research/out/run_meta_*.json
|
|
|
|
# Telegram 凭据。**不要提交**
|
|
research/live/deploy/tg.env
|
|
|
|
# 生产状态与信号总线。刻意放在仓库外(LIVE_HOME / BUS_DIR),这几条只防
|
|
# 有人把它们指回仓库里:里面是日亏损累计与已处理信号键,被 git clean
|
|
# 清掉等于两道闸静默失忆
|
|
/live/deploy/live.env
|
|
live_state.json
|
|
live_trades.jsonl
|
|
signals_live.jsonl
|