QuantConnect / Lean

Lean Algorithmic Trading Engine by QuantConnect (Python, C#)
https://lean.io
Apache License 2.0
8.97k stars 3.14k forks source link

Live realtime prices update after hours even if extended market hours are false #487

Closed jaredbroad closed 7 years ago

jaredbroad commented 7 years ago

In live trading -- the charting/data sampling continues to get updated with updated TotalPortfolioValue values even after the market has closed - indicating the SetRealTimePrice() is being set after market close, and then the result handler is sampling that updated price.

If the subscription sets extended: false we probably shouldn't set the real-time prices after-hours either.

mchandschuh commented 7 years ago

I wonder how IB evaluates portfolio value for margin calculations in these events and whether or not we should follow IB here. On Jul 14, 2016 4:13 PM, "Jared" notifications@github.com wrote:

In live trading -- the charting/data sampling continues to get updated with updated TotalPortfolioValue values even after the market has closed - indicating the SetRealTimePrice() is being set after market close, and then the result handler is sampling that updated price.

If the subscription sets extended: false we probably shouldn't set the real-time prices after-hours either.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/QuantConnect/Lean/issues/487, or mute the thread https://github.com/notifications/unsubscribe/AAgb2GMzgOYpwKIl1NpGd2DU9HIECL2Zks5qVphsgaJpZM4JMziy .

jaredbroad commented 7 years ago

Not sure, but it would seem unethical/impossible to trigger margin calls on pre/post market prices (they can vary wildly with no liquidity). Its probably market hours only?

Its not the data loop getting called, just the charting sampling. 95% of people don't care about pre-post market data so no reason to show it in results and potentially scare people (with large drops in portfolio value because of a single post market trade etc).

mchandschuh commented 7 years ago

Don't disagree with the margin calls. I was thinking about trading multiple markets, say forex and us equities. If the after market price plummets, will it affect how much currency you can trade in forex market. On Jul 14, 2016 4:41 PM, "Jared" notifications@github.com wrote:

Not sure, but it would seem unethical/impossible to trigger margin calls on pre/post market prices (they can vary wildly with no liquidity). Its probably market hours only?

Its not the data loop getting called, just the charting sampling. 95% of people don't care about pre-post market data so no reason to show it in results and potentially scare people (with large drops in portfolio value because of a single post market trade etc).

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/QuantConnect/Lean/issues/487#issuecomment-232785964, or mute the thread https://github.com/notifications/unsubscribe/AAgb2HlyPucVgGT99D4a1_KqCb41jTNgks5qVp8IgaJpZM4JMziy .

jaredbroad commented 7 years ago

Fixed by pr #809