Lean
Lean copied to clipboard
Improve SecurityHolding.TotalCloseProfit for Outside Market Hours
Expected Behavior
TotalCloseProfit takes into account market hours. For example, if the market is closed for Equity and Options, it cannot use the bid/ask to calculate the holdings value.
Actual Behavior
Outside market hours, the portfolio value can be all over the place. Realistically, these positions couldn't be closed:
Potential Solution
TotalCloseProfit uses the Price instead of AskPrice and BidPrice outside regular hours, except for Futures when market hours can be filled.
Checklist
- [x] I have completely filled out this template
- [x] I have confirmed that this issue exists on the current
masterbranch - [x] I have confirmed that this is not a duplicate issue by searching issues