Skip to content

Indicator Window Inconsistencies #9355

@DerekMelchin

Description

@DerekMelchin

Expected Behavior

When we warm up an indicator and it's window, the window is full and the values in the window are valid.

Actual Behavior

(1) If we warm up an indicator in initialize, the value at window[0] is always 0 when the warm-up period ends. If we warm up the indicator in on_securities_changed instead, the value for window[0] is correct when the warm-up period ends.
https://www.quantconnect.cloud/backtest/638c957f4ccc909034828b4cea841a0b/?theme=darkly

Quit(): self._spy_roc1.window is incorrect. Expected: [0.008, -0.0079, -0.0051, 0.0056, 0.0161]; Actual: [-0.0079, -0.0051, 0.0056, 0.0161, 0.0]

(2) I also tested it with the midprice indicator and the windows aren't the same. There is no 0 value, but the window that I create in initialize has a duplicate value
https://www.quantconnect.cloud/backtest/f521f839765060296928a2b7c97299b1/?theme=darkly

Quit(): self._spy_midprice2.window is incorrect. Expected: [363.6499, 366.1296, 365.2423, 364.3597, 361.6605, 367.3812]; Actual: [366.1296, 365.2423, 364.3597, 361.6605, 367.3812]
Quit(): self._spy_midprice1.window is incorrect. Expected: [363.6499, 366.1296, 365.2423, 364.3597, 361.6605, 367.3812]; Actual: [365.2423, 364.3597, 361.6605, 367.3812, 367.3812]

Potential Solution

N/A

Reproducing the Problem

Run the algorithms above

System Information

QC Cloud

Checklist

  • I have completely filled out this template
  • I have confirmed that this issue exists on the current master branch
  • I have confirmed that this is not a duplicate issue by searching issues
  • I have provided detailed steps to reproduce the issue

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions