Repository navigation
v1.8.0: Sync from Edge Trader for Schwab - #52
Merged
Merged
Conversation
Edge Trader for Schwab sends Schwab fills, per-trade entries, timed notes, order events and a day note only when the trader clicks Apply on a preview. The dry run runs the whole sync in one transaction and rolls it back, returning a state token; Apply backs the database up, then applies all or nothing, or answers 409 with a fresh preview if the journal changed since. A journal edit wins over Edge Trader. Fills route per instrument or per trade picked in the preview and are deduped against statement imports (a fill the journal split at a reversal counts once). Two option fills of one order in one second become one vertical at the net price. The import and the sync share trade_store.py (one lock, never overwriting a stored trade the batch did not rebuild); sync rows follow a regroup, and deleting or moving a trade or an account releases them. Clearing a day's diary keeps the Edge Trader day note. The chart window uses the real Eastern offset (EST in winter). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Trade Details lists a trade's synced stop, target and note events in US Eastern time. Hovering or focusing an event shows it on the chart (a guide at its bar, a price line for stops and targets on stock charts); a click keeps it there until clicked again. Stock charts draw the stop and target history as stepped lines, with note pins over the bars. The Diary and Day Review show the Edge Trader day note above the uploaded diaries, and clearing a day leaves it. Candles use each day's real Eastern offset, so fills, events and bars line up in winter too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on the trade chart What the sync sends, that it is opt-in and click-only, the preview and Apply, the backup before writing, how to point Edge Trader at the journal's address, and what the optional AI feedback sends to Anthropic. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e access Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
They read, change and rewrite a trade's whole fill list, so they now hold the same lock as the Edge Trader sync and the CSV import: a sync committing in between can no longer be overwritten by a list read before it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oken, no browser calls) - A fill a sync already stored or matched no longer covers a later fill at the same price that day, and a fill covered by a merged statement fill keeps its share across syncs. - A transaction repeated in one request counts once; two different ones under one id are refused. - A vertical whose leg an earlier sync stored on its own stays as single legs. - A covered fill belongs to the account holding the statement fill, not the route. - The state token binds the request, the journal tables the sync reads, and the plan: Apply with a changed note or event, or after any journal change, is refused (409). The preview lists every trade Apply changes, including an open vertical the sync closes in place. - POST /api/sync/edge-trader refuses requests from web pages (Origin or a cross-site Sec-Fetch-Site), 403; Edge Trader posts from its server and sends neither. - NaN and Infinity in transactions, events and annotations are refused (422). - The moved-trade test now syncs, moves the trade in Trade View and syncs again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Upgrading a database: new and stored rows get their qty and lead key back; rows covered by a merged statement fill before this version keep an unknown share, so that day's merged pool never covers a new fill (it is added as new and named in the preview). - Moving a trade moves the sync's record of its fills, so they never act as a merged statement fill in the new account. - A vertical whose contracts the journal holds as open single legs is kept as legs, so a closing vertical closes each leg with its own P&L. - The execution-edit lock tests check the answer and the stored fills for add, update and delete, and a sync committing a close while the edit waits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n a move) - Whether a vertical is kept as single legs is decided in the account the fill goes to (its pick, else the option route); an open vertical there on the same two contracts keeps it a vertical, so a single leg in another account never splits it. - Moving a trade moves the sync record of a reversal fill only with its first half, the half that stands for the whole fill, so moving either side never lets it cover a later fill. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Adds
POST /api/sync/edge-traderso Edge Trader for Schwab v1.5.0 can send its fills, per-trade notes, order timeline and day notes to the journal, only on the user's Sync and Apply.Backend
Frontend
Review
Independent ChatGPT audit, 3 passes (6 + 3 + 2 high, 2 medium, 2 low), each finding reproduced with a failing test before the fix. Backend 453 passed, frontend 106 passed,
CI=true npm run buildclean. End-to-end test with Edge Trader's real client on a throwaway database.Version 1.8.0.
🤖 Generated with Claude Code