When active monitors exist, use their deduped symbol+direction slots so roll does not inflate the limit; only hold previous active_count on SSE when incoming drops to zero during sync.
Co-authored-by: Cursor <cursoragent@cursor.com>
Store initial_lots on roll groups, submit market roll as CTP pending legs with cancel closing empty groups, and backfill first-lots for existing active groups.
Co-authored-by: Cursor <cursoragent@cursor.com>
Revive and sync active monitors from live positions before listing roll candidates, show ineligible monitors with reasons, and validate eligibility on preview.
Co-authored-by: Cursor <cursoragent@cursor.com>
Pass trading_session via inline page config, restore roll preview/execute handlers, and validate new stop-loss before preview.
Co-authored-by: Cursor <cursoragent@cursor.com>
Recalculate position quotes from resolved entry instead of stale CTP PositionProfit, and hide the auto-connect disabled banner once CTP is connected.
Co-authored-by: Cursor <cursoragent@cursor.com>
Move business code under modules/, env template to config/, PM2 single qihuo process, and _legacy shims for old imports.
Co-authored-by: Cursor <cursoragent@cursor.com>