Skip to content

Conversation

@qqrm
Copy link
Owner

@qqrm qqrm commented Sep 18, 2025

Summary

  • Added SMA/EMA replacement helpers so MovingAverageEngine can adjust window sums and last EMA when the latest close is revised in place.【F:src/domain/market_data/indicator_engine.rs#L83-L201】
  • Taught Chart::add_realtime_candle and aggregate updates to detect timestamp-equal candles and invoke the replacement path, keeping indicators in sync during partial updates.【F:src/domain/chart/entities.rs#L100-L225】
  • Added a wasm-bindgen integration test that feeds repeated real-time closes and checks that SMA/EMA settle on the final value for base and aggregated intervals.【F:tests/moving_average_updates.rs#L1-L50】

Testing

  • cargo fmt --all
  • cargo check --tests --benches
  • cargo clippy --tests --benches --fix --allow-dirty -- -D warnings
  • cargo test (fails: wasm-bindgen UI tests panic at src/app.rs:1421 because DOM-dependent setup is unavailable in the harness)
  • CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER=wasm-bindgen-test-runner cargo test (fails with the same DOM-dependent wasm tests)

https://chatgpt.com/codex/tasks/task_e_68cb93d1c11c833291d91f13e9989453

@qqrm qqrm merged commit c6eb4c2 into main Sep 18, 2025
2 of 4 checks passed
@qqrm qqrm deleted the codex/add-public-methods-to-movingaverageengine branch September 18, 2025 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants