Published
Edited
Jul 20, 2021
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
html `<br>`
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
md `## Global Configuration `
Insert cell
debug = true
Insert cell
W0 = 1200
Insert cell
w = width >= W0 ? Math.floor(width * 0.4) : width * 0.75 // for fullscreen
Insert cell
height_sankey = 800 * 0.6
Insert cell
colorVega = "#4C78A8"
Insert cell
// candle chart interval
interval = '1d'
Insert cell
md `## Internal Functions`
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
md `## Data`
Insert cell
filtered_data = temp_filter.filter(d => d.Date >= d1 && d.Date <= d2)
Insert cell
tickers2 = new Set(local_ticker_check)
Insert cell
temp_filter = local_data.filter(d => tickers2.has(d.Symbol))
Insert cell
local_data = FileAttachment("tickers_full.csv").csv()
Insert cell
filtered_event_data = local_event_data.filter(d => d.Date >= d1 && d.Date <= d2)
Insert cell
local_event_data = FileAttachment("events@2.csv").csv()
Insert cell
symbol = 'BTCUSD_PERP'
Insert cell
candle_data = candles(symbol, interval)
Insert cell
Insert cell
factsExample = crossfilter(local_data)
Insert cell
sportDim = factsExample.dimension(d => d.Close)
Insert cell
function sampleArray(a, n, random) {
return a.slice(0, n);
}
Insert cell
tickers = ['BTC-USD','ETH-USD', 'AAPL', 'TSLA', 'MSFT', 'NVDA', 'SQ', 'PYPL', 'MSTR', 'JPM', '^IXIC', '^DJI', '^GSPC', 'GC=F', "CL=F"]
Insert cell
type = ['BTC History', 'Global', 'Elon', 'Financial']
Insert cell
md `## Import Libraries `
Insert cell
vegalite = require("@observablehq/vega-lite@0.3")
Insert cell

import {vegaSync} from "@pierreleripoll/vegasync"

Insert cell
import {createFacts} from "@pierreleripoll/vegasync"
Insert cell
//crossfilter = require("crossfilter2")
Insert cell
crossfilter = require("crossfilter2@1.5.4")
Insert cell
import {fullscreen} from "@pierreleripoll/vegasync"

Insert cell
import {slider,button,select,text,radio,checkbox,number,date} from "@jashkenas/inputs"
Insert cell
import {candles, forwardRate} from "@pandawhisperer/binance-futures-with-forward-rate"
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