QuantConnect / Lean

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

Returning two candles(one invalid) for same minute in history request #7983

Closed demo055 closed 3 months ago

demo055 commented 4 months ago

for ticker in self.tickers: self.AddEquity(ticker, Resolution.Second)

history = self.History(TradeBar, self.tickers, 448, Resolution.Minute) self.Debug(history)

output of debug: ... 2024-04-30 09:31:00 127.2000 127.3900 127.1900 127.3900 14844.0 2024-04-30 09:31:00 127.9300 127.9400 127.8300 127.8700 0.0 2024-04-30 09:32:00 127.2300 127.3700 127.0600 127.1900 11189.0 2024-04-30 09:32:00 127.9300 127.9400 127.8300 127.8700 0.0 ...

Martin-Molinero commented 4 months ago

Hey @demo055! We can't reproduce the issue with the provided code https://www.quantconnect.com/terminal/processCache?request=embedded_backtest_12c970c6e20c52f4672902b7826ac998.html . Please provider more details on how to reproduce this, sharing a backtest would be appreciated

demo055 commented 4 months ago

Hey @Martin-Molinero! I am using interactive brokers as default enviroment. I would like to have history-provider BrokerageHistoryProvider as default. But from some reason it is using my data folder as source, which is wrong, because i do not have in that directory current day. Maybe because of this, there is that duplicated candle?

"live-interactive": { ... "history-provider": [ "BrokerageHistoryProvider", "SubscriptionDataReaderHistoryProvider" ] },

Could you please help? It was working properly month ago. Thank you very much for your help

Martin-Molinero commented 4 months ago

Hey @demo055! We've released a new lean cli version 1.0.192 with a possible related fix for IB and live trading. Please update to the latest version pip install upgrade lean, and see if it solves your issues. If it doesn't, we would need more details, logs and how to reproduce the issue, adding --verbose and sharing the logs would help us pin it, you can share them with our support team directly support@quantconnect.com

demo055 commented 4 months ago

Hey @Martin-Molinero! upgrading lean and removing docker volumes didn't help. I sent you logs via e-mail

AlexCatarino commented 3 months ago

Hi @demo055, Are you still experiencing this issue? I can't find your email with the logs. Can you send another email to support@quantconnect.com so I know your email address so I can find it?