adjust 1 year return threshold to allow for landing the snap on weekends/holidays

This commit is contained in:
Emil Lerch 2026-03-11 12:00:03 -07:00
parent 2f84bbd3e8
commit b4024ea03d

View file

@ -40,7 +40,7 @@ fn totalReturnFromAdjCloseSnap(candles: []const Candle, from: Date, to: Date, st
return .{
.total_return = total,
.annualized_return = if (years >= 1.0)
.annualized_return = if (years >= 0.95)
std.math.pow(f64, 1.0 + total, 1.0 / years) - 1.0
else
null,
@ -104,7 +104,7 @@ fn totalReturnWithDividendsSnap(
return .{
.total_return = total,
.annualized_return = if (years >= 1.0)
.annualized_return = if (years >= 0.95)
std.math.pow(f64, 1.0 + total, 1.0 / years) - 1.0
else
null,