Skip to content

fix(trade-window): drop candles under the tick replay, 65 s margin - #735

Merged
kirillDevPro merged 2 commits into
mainfrom
fix/trade-window-tick-candles
Sep 26, 2026
Merged

kirillDevPro merged 2 commits into
mainfrom
fix/trade-window-tick-candles

Conversation

@kirillDevPro

Copy link
Copy Markdown
Collaborator

What & why

The trade window (double-click a Report row) draws the trade's tick replay over one-minute bar
context. The one-minute candles were also drawn across the stretch the ticks cover, so on a
short trade two big candles sat right on top of the prints.

  • The draw list now keeps only the part of each bar that lies outside tick coverage. A minute
    wholly covered by ticks drops out, a minute outside keeps the series width, and a gap the
    tick walk did not cover keeps its bar, so there is never an empty hole.
  • A partial stub keeps its minute's OHLC and a proportional share of the turnover, and carries
    its own width. The candle shaders (HLSL, Metal, WGSL) now mute only a bar WIDER than the series
    timeframe, so a narrower stub keeps the series colour; the main chart only ever emits wider
    coarse bars, so it is unchanged.
  • The default tick margin around a trade is 65 s (was 30 s), and 65 s is a step in the Storage
    tab. A settings file that already stores a margin keeps it.

How to verify

  • cargo test -p moon-core trade_replay and cargo test -p moon-core storage::tests
  • cargo test -p moon-ui-gpui --bin moonterminal trade_window and --test theme_contract
  • Checked on a debug build: open a short trade and a longer one from the Report; no candle is
    drawn under the ticks, the edges show candles.

A one-minute bar that only partly overlaps the prints stays whole,
so a short trade draws two candles across the ticks. The draw list
now keeps only the uncovered pieces of each bar, and a gap the walk
did not cover still gets its bar. A stub carries its own width, and
a narrower width is no longer muted as a coarse timeframe.
The default was 30 s, and 65 was not a step, so choosing 65 snapped
away. 65 is now the default and a step. 30 stays the floor, so a
file that already stores 30 keeps it and a file with no margin key
takes 65. The stepper labels any step that is not a whole minute
in seconds, which keeps 65 s distinct from 60 s.
@kirillDevPro
kirillDevPro merged commit 13db5a0 into main Sep 26, 2026
8 checks passed
@kirillDevPro
kirillDevPro deleted the fix/trade-window-tick-candles branch September 26, 2026 15:30
guyverino added a commit that referenced this pull request Sep 26, 2026
… search entry and exit fields (#738)

A new Entry/Exit axis on Analytics -> Strategy tuning: every closed trade is
replayed on its recorded tape of prints under the strategy's own entry and
exit rules, and the entry and exit fields are searched on the trades the model
reproduces.

- moon-core db/tuner/ticks: tape-replay model (MoonShot corridor entry,
  MoonHook take, sell line, stops incl. book-watching and trailing, delta
  modifiers, shorts), verdict against the report and the order archive,
  nested entry/exit search, one field descriptor for grid, search and save.
- Tape: background fetch job with lanes and clusters, optional startup
  autoload, the core's ring filed into the tiles, Gate futures walked by
  time and id.
- UI analytics/tuner/ticks: deal table, grid by the Strategies window's
  sections, variants, the selected deal's pane, model accuracy, run estimate;
  a group under the reproduction share warns instead of being locked out.
- Storage tab: tape margin in seconds on a step list (kept with #735's 65 s
  default), long-position threshold, tape cleanup, autoload switch.
- Clippy findings on the added lines cleared; PRODUCT_MAP lists the axis.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant