Hey everyone!

I wanted to make an announcement that we have officially merged an update to Leans sampling and statistics implementation. This PR brings improvements to our sampling and statistics building in Lean to more accurately reflect the daily performance values for algorithms of all resolutions.

Specifically we now sample as a scheduled event attached to the algorithm at 12AM each day only storing one value a day for performance and benchmark values. Then later in the statistics builder we take the benchmark values and generate a percentage difference between each day. Then when generating our statistics that take daily portfolio performance and benchmark performance into account we have a perfectly aligned set of samples to compare. 

This brings a significant change to our regressions algorithms, which you can see in the PR details (165 files changed total) but this is expected. A great highlight of this improvement would be to look at a basic buy and hold algorithm of a security with the same security as the benchmark. What we would expect is the benchmark performance and daily performance to line up almost perfectly, this would result in a Beta value of ~1.

Below I will post a set of Backtests using different resolutions of this exact scenario using SPY.