Lean icon indicating copy to clipboard operation
Lean copied to clipboard

Review Rolling Window Statistics

Open AlexCatarino opened this issue 1 year ago • 1 comments
trafficstars

Expected Behavior

The start of a period matches the end of the previous period.

Actual Behavior

LEAN uses one data point after the end of the previous period.

M1_20240131
                "startEquity": "100000",
                "endEquity": "102316.2412",
...
M1_20240229
                "startEquity": "102179.3097",   // <--- it should be 102316.2412 ?
                "endEquity": "107670.2602",

Adaptable Black Camel.json

Potential Solution

N/A

Reproducing the Problem

Run basic template algorithm from 20240101 to date.

Checklist

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

AlexCatarino avatar Jul 29 '24 20:07 AlexCatarino

  • May 31st close prices are not equal to June 1st close prices so we don't expect month open to equal month close.
  • For perfection we should ensure we're sampling daily prices at market open and not end of day June 1st (June 2nd) which would be lagged 1 day.

jaredbroad avatar Aug 05 '24 18:08 jaredbroad