Plot.plot({
tooltip: (d) => (d["Open"] < d["Close"] ? "Green" : "Red"),
nice: true,
width: 1100,
grid: true,
y: {
axis: "right",
label: "Price"
},
marks: [
Plot.ruleX(data_filtered_withIndicators_withFearGreedIndex, {
x: "Date",
y1: "Open",
y2: "Close",
strokeWidth: (d) => 1000 / numberOfDaysInFilteresData,
stroke: (d) => (d["Open"] < d["Close"] ? "Green" : "Red"),
title: (d) => createTooltipContent(d)
}),
Plot.ruleX(data_filtered_withIndicators_withFearGreedIndex, {
x: "Date",
y1: "High",
y2: "Low",
stroke: (d) => (d["Open"] < d["Close"] ? "Green" : "Red")
}),
Plot.lineY(data_filtered_withIndicators_withFearGreedIndex, {
x: "Date",
y: "bollingerAverage",
stroke: "dodgerBlue"
}),
Plot.areaY(data_filtered_withIndicators_withFearGreedIndex, {
x: "Date",
y1: "bollingerUpper",
y2: "bollingerLower",
fill: "dodgerblue",
fillOpacity: 0.1,
stroke: "dodgerblue",
strokeOpacity: 0.5
})
]
})