Created
May 6, 2025 18:26
-
-
Save mborsare/6ec7a6b657d28ec58f100777e22e671c to your computer and use it in GitHub Desktop.
Fetch 10yr t note metadata
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -s -A "Mozilla/5.0" "https://query1.finance.yahoo.com/v8/finance/chart/ZN=F?interval=1d&range=3mo" | jq ' | |
| .chart.result[0].indicators.quote[0].close as $c | |
| | ($c[-1]) as $now | |
| | ($c[-2]) as $yesterday | |
| | ($c | reverse | .[0:3] | add / length) as $avg3 | |
| | ($c | reverse | .[0:5] | add / length) as $avg1w | |
| | ($c | add / length) as $avg3mo | |
| | ([range(1; $c | length) | ($c[.] - $c[.-1])] | add / length) as $delta | |
| | (if $now > $avg3mo then "up" elif $now < $avg3mo then "down" else "flat" end) as $trend | |
| | { | |
| now: $now, | |
| yesterday: $yesterday, | |
| avg_3d: $avg3, | |
| avg_1w: $avg1w, | |
| avg_3mo: $avg3mo, | |
| avg_daily_delta: $delta, | |
| trend: $trend, | |
| mes_bias: ( | |
| if $trend == "up" then "Bearish" | |
| elif $trend == "down" then "Bullish" | |
| else "Neutral" | |
| end | |
| ) | |
| } | |
| ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment