Switch WPF trade viewer charts to ScottPlot - #2
sanchoflat wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3478fff42b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| activeOrdersById.Remove(target.OrderId); | ||
| } | ||
|
|
||
| activeSlots.Remove((target.Symbol, target.Side)); |
There was a problem hiding this comment.
Avoid removing current slot when closing a stale order
If a new order replaces an old one for the same (symbol, side) slot, a late Filled/Cancelled event for the old order will still be found by orderId, but this unconditional activeSlots.Remove((target.Symbol, target.Side)) will drop the current active order as well. That means the new order disappears from tracking and never gets its end-time/FinalStatus, so it won’t be plotted (or may be prematurely closed). The Python logic only removes the slot if it still points to the same order; this code needs a similar guard to avoid clearing a newer active order.
Useful? React with 👍 / 👎.
Motivation
Description
ScottPlot.WPF.WpfPlotcontrols inTradeViewer/MainWindow.xamland remove SciChart license wiring by simplifyingTradeViewer/App.xaml.cs/App.xaml.TradeViewer/MainWindow.xaml.csusing ScottPlot APIs includingConfigurePlots,ApplyPlotStyle,AddPriceSeries,AddOrderSeries,AddTradeSeries,AddSpreadSeries,AddBorderSeries,SyncXAxisLimits, and helperAddLineSeriesto render lines and scatter series.ScottPlot.WPFinTradeViewer/TradeViewer.csprojand updateREADME.mdto reflect ScottPlot usage and run instructions (dotnet restore/dotnet run).TradeViewer/Parsing/LogParser.csandTradeViewer/Models/ParsedData.cs) and wire them into the ScottPlot-based UI unchanged from their parsing behavior.Testing
Codex Task