Skip to content

Market Data

using MarketData, DataFrames
using AlgebraOfGraphics, CairoMakie
using Statistics

Close Price¤

plt = data(cl)*mapping(:timestamp, :Close)*visual(Lines)

with_theme(theme_ggplot2(), resolution = (600,400)) do
    plt |> draw
end

Prices¤

labels = [:Open, :High, :Low, :Close]
plt = data(ohlc)
plt *= mapping(:timestamp, labels .=> "value", color =dims(1)=>renamer(labels) => "series ")

with_theme(theme_light(), resolution = (600,400)) do
    plt * visual(Lines) |> draw
end

StockChart¤

df = DataFrame(ohlc)
pltd = data(df[200:280,:])
plt = pltd * mapping(:timestamp, :Open => "StockChart")
plt *= mapping(fillto=:Close, color = (:Open, :Close) => isless => "Open<Close")
plt *= visual(BarPlot)

with_theme(theme_dark(), resolution = (800,500)) do
    draw(plt, palettes =(; color = [:deepskyblue, :firebrick3]))
end

Warning

This example was autogenerated using:

using Pkg
Pkg.status(["CairoMakie", "AlgebraOfGraphics", "MarketData", "DataFrames"])
Status `~/work/BeautifulMakie/BeautifulMakie/docs/Project.toml`
  [cbdf2221] AlgebraOfGraphics v0.6.16
  [13f3f980] CairoMakie v0.10.6
  [a93c6f00] DataFrames v1.5.0
  [945b72a4] MarketData v0.13.12

This page was generated using Literate.jl.