QuantConnect / QuantConnect/Lean
Daily Closing Price & Indicator Descrepancy When Changing Resolution
Open
@Martin-Molinero is already working on this.
Since May 28, 2024.
bug
data-integrity
- Dominant language
- C#
- Stars
- 21.7k
- Forks
- 5.3k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 34
Description
Expected Behavior
- The daily price of a forex symbol should be the same, regardless of the resolution of data we select.
- Indicator values should be the same at the end of each day when we initialize indicators with a daily resolution but change the symbol resolution.
Actual Behavior
- In this backtest, the daily closing price of a forex pair differs when changing the symbol resolution.
- The logs listed below show the following findings of the backtest:
- When selecting equities in the backtest:
- The ATR values are equal during the first 2 days for all the resolutions, but then they start to diverge.
- The EMA values are equal during the first 3 days for all the resolutions, but then the minute resolution's values start to diverge while the hourly and daily resolutions remain equal.
- When selecting forex in the backtest:
- The ATR values are different at each time step across all the resolutions.
- The EMA values for the minute and hour resolutions are equal. Only the first EMA value on daily resolution is equal to the other resolutions.
- When selecting equities in the backtest:
Logs:
fx-daily.txt
fx-hour.txt
fx-minute.txt
equities-daily.txt
equities-minute.txt
equities-hour.txt
Potential Solution
Unknown. The _previousInput property of indicators is private, so I cannot see which values the indicators are being updated with.
Reproducing the Problem
Utilize this backtest.
System Information
Run in the browser in the Algorithm Lab. Windows 10.
Checklist
- I have completely filled out this template
- I have confirmed that this issue exists on the current
masterbranch - I have confirmed that this is not a duplicate issue by searching issues
- I have provided detailed steps to reproduce the issue
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.