Public
Edited
Nov 11, 2023
Insert cell
Insert cell
allStocks = FileAttachment("all_stocks.csv").csv({typed: true})
Insert cell
stockNames = {
let names = [];
allStocks.forEach(function(d) {
if (!names.includes(d.name)) {
names.push(d.name)
}
});
return names;
}
Insert cell
viewof stockName = Inputs.select(stockNames, {label: "Select a stock: "})
Insert cell
viewof n = Inputs.range([0, 30], {label:"Window size: ", step: 1})
Insert cell
viewof r = Inputs.range([1, 5], {label: "Radius: ", step: 0.1})
Insert cell
myPlot = Plot.bollingerY(allStocks.filter(d => d.name == stockName), {x: "Index", y: "price", n: n, k: r}).plot()
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more