Skip to content

[codex] Use close price outside market hours#9441

Draft
aiSynergy37 wants to merge 1 commit intoQuantConnect:masterfrom
aiSynergy37:codex/fix-close-profit-market-hours
Draft

[codex] Use close price outside market hours#9441
aiSynergy37 wants to merge 1 commit intoQuantConnect:masterfrom
aiSynergy37:codex/fix-close-profit-market-hours

Conversation

@aiSynergy37
Copy link
Copy Markdown
Contributor

Summary

  • Make SecurityHolding.TotalCloseProfit() use bid/ask only while regular market hours are open
  • Use the security last price outside regular market hours so stale bid/ask quotes do not distort close profit
  • Add long and short regression coverage for open vs closed regular market hours

Issue

Fixes #8878

Testing

  • dotnet build Tests/QuantConnect.Tests.csproj --no-restore --nologo -v:q -clp:ErrorsOnly -p:RunAnalyzers=false -m:1 -p:UseSharedCompilation=false
  • Attempted focused test with Debug project output, but local NUnit discovery returned no matching tests for the new methods in this environment.
  • Attempted Release test project build; local build timed out before completion.

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.

Improve SecurityHolding.TotalCloseProfit for Outside Market Hours

2 participants