update zfin (pick up tiingo primary)
All checks were successful
Generic zig build / build (push) Successful in 1m10s
Generic zig build / deploy (push) Successful in 21s

This commit is contained in:
Emil Lerch 2026-03-17 09:52:22 -07:00
parent 667fccb537
commit 075f16ac52
Signed by: lobo
GPG key ID: A7B62D657EF764F8
2 changed files with 4 additions and 4 deletions

View file

@ -14,8 +14,8 @@
.hash = "httpz-0.0.0-PNVzrBtMBwAPcQx3mNEgat3Xbsynw-eIC9SmOX5M9XtP",
},
.zfin = .{
.url = "git+https://git.lerch.org/lobo/zfin#3e13faa66f8e40158a91a78e0e2bce75a364a36e",
.hash = "zfin-0.0.0-J-B21oJlCwDEq1uvlG93ms5dv5aDmQT0wh7kWgLmzSea",
.url = "git+https://git.lerch.org/lobo/zfin#1cd775c27e80371a53aae2a58bb1c8156256abe7",
.hash = "zfin-0.0.0-J-B21o_VCwC6uOv6mCU4T_qCGEjz26zfY5u6kQ5XQuaj",
},
},
}

View file

@ -146,13 +146,13 @@ fn handleReturns(app: *App, req: *httpz.Request, res: *httpz.Response) !void {
const ret = zfin.performance.trailingReturns(candles);
var date_buf: [10]u8 = undefined;
const date_str = candles[candles.len - 1].date.format(&date_buf);
const risk = zfin.risk.computeRisk(candles, zfin.risk.default_risk_free_rate);
const risk = zfin.risk.trailingRisk(candles);
const r1y = if (ret.one_year) |r| r.annualized_return else null;
const r3y = if (ret.three_year) |r| r.annualized_return else null;
const r5y = if (ret.five_year) |r| r.annualized_return else null;
const r10y = if (ret.ten_year) |r| r.annualized_return else null;
const vol = if (risk) |r| r.volatility else null;
const vol = if (risk.three_year) |r| r.volatility else null;
// Check if XML requested
if (q.get("fmt")) |fmt| {