Public
Edited
May 8, 2023
Insert cell
Insert cell
Insert cell
Insert cell
ETH-USD@3.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
// Uncomment to activate

data_forAroundOneYear = aq.from(data_initial)
.filter( aq.escape(d => d["Date"].getFullYear() > 2022 ) )
.objects()
Insert cell
year_slider
Insert cell
// Uncomment to enable
data_filtered = aq.from(data_initial)
.filter(aq.escape((d) => d["Date"].getFullYear() === year_slider))
.objects()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof bollingerSD_slider = Inputs.range([0,5],{
label: "Bollinger Standard Devision",
step: 0.1,
value: 1
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Inputs.table(data_filtered_withIndicators)
Insert cell
// Complete the code

data_fearGreedIndex_raw = d3.json("https://api.alternative.me/fng/?limit=0&format=json")
Insert cell
// Uncomment to activate

data_fearGreedIndex = aq.from(data_fearGreedIndex_raw.data)
.derive({ date: aq.escape(d => new Date(+d["timestamp"] * 1000)) })
.derive({ valueAsNumber: d => +d["value"] })
.select('value_classification','date','valueAsNumber')
.rename({valueAsNumber: "FearGreedValue"})
.rename({value_classification: "FearGreedClass"})
.rename({date: "FearGreedDate"})
.objects()
Insert cell
// Uncomment to activate

data_filtered_withIndicators_withFearGreedIndex = aq.from(data_filtered_withIndicators)
.join(aq.from(data_fearGreedIndex), ["Date", "FearGreedDate"])
.objects()
Insert cell
// Uncomment to activate

Inputs.table(data_filtered_withIndicators_withFearGreedIndex)
Insert cell
Insert cell
Insert cell
Insert cell
current_price = d3.json("https://www.binance.com/api/v3/ticker/price?symbol=ETHUSDT")
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import {toc} from "@nebrius/indented-toc"
Insert cell
import {Wrangler, op} from "@observablehq/data-wrangler"
Insert cell
import {howTo} from "@clokman/howto"
Insert cell
import {imageToDo} from "@clokman/student-blocks"
Insert cell
imageToDo
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