-
Notifications
You must be signed in to change notification settings - Fork 285
Closed
Description
The CsvProvider intro gif is nice, but the example at the top of the page using the yahoo finance api no longer works because the yahoo api changed. That's not good for a getting started intro.
- It would be possible to update the gif using the new yahoo URL scheme (see the FLIPS example).
- Or, we could replace it with something new like interest rates from the Federal Reserve.
#r "nuget: FSharp.Data"
#r "nuget: Plotly.NET, 2.0.0-beta5"
type Fred = CsvProvider<"https://fred.stlouisfed.org/graph/fredgraph.csv?id=GS10",
Schema="Date,Value">
let fredUrl series = $"https://fred.stlouisfed.org/graph/fredgraph.csv?id={series}"
["GS1", "1-Year"
"GS10", "10-Year"]
|> Seq.map(fun (series, name) ->
Fred.Load(fredUrl series).Rows
|> Seq.map(fun row -> row.DATE, row.Value)
|> Chart.Line
|> Chart.withTraceName name)
|> Chart.Combine
|> Chart.withTitle "Treasury Constant Maturity Rates"
|> Chart.withY_AxisStyle(title = "Interest Rate (%)")
|> Chart.ShowReactions are currently unavailable
