Open/High/Low/Close

Source code Author Update time

using Plots
gaston()

Create an OHLC chart. Pass in a list of (open,high,low,close) tuples as your y argument. This uses recipes to first convert the tuples to OHLC objects, and subsequently create a :path series with the appropriate line segments.

n = 20
hgt = rand(n) .+ 1
bot = randn(n)
openpct = rand(n)
closepct = rand(n)
y = OHLC[(openpct[i] * hgt[i] + bot[i], bot[i] + hgt[i], bot[i], closepct[i] * hgt[i] + bot[i]) for i = 1:n]
ohlc(y)
Gnuplot Produced by GNUPLOT 5.2 patchlevel 8 -1 0 1 2 3 4 5 10 15 20 y1 gnuplot_plot_2a gnuplot_plot_3a gnuplot_plot_4a gnuplot_plot_5a gnuplot_plot_6a gnuplot_plot_7a gnuplot_plot_8a gnuplot_plot_9a gnuplot_plot_10a gnuplot_plot_11a gnuplot_plot_12a gnuplot_plot_13a gnuplot_plot_14a gnuplot_plot_15a gnuplot_plot_16a gnuplot_plot_17a gnuplot_plot_18a gnuplot_plot_19a gnuplot_plot_20a gnuplot_plot_21a gnuplot_plot_22a gnuplot_plot_23a gnuplot_plot_24a gnuplot_plot_25a gnuplot_plot_26a gnuplot_plot_27a gnuplot_plot_28a gnuplot_plot_29a gnuplot_plot_30a gnuplot_plot_31a gnuplot_plot_32a gnuplot_plot_33a gnuplot_plot_34a gnuplot_plot_35a gnuplot_plot_36a gnuplot_plot_37a gnuplot_plot_38a gnuplot_plot_39a gnuplot_plot_40a gnuplot_plot_41a gnuplot_plot_42a gnuplot_plot_43a gnuplot_plot_44a gnuplot_plot_45a gnuplot_plot_46a gnuplot_plot_47a gnuplot_plot_48a gnuplot_plot_49a gnuplot_plot_50a gnuplot_plot_51a gnuplot_plot_52a gnuplot_plot_53a gnuplot_plot_54a gnuplot_plot_55a gnuplot_plot_56a gnuplot_plot_57a gnuplot_plot_58a gnuplot_plot_59a gnuplot_plot_60a y1 y1 gnuplot_plot_2a gnuplot_plot_3a gnuplot_plot_4a gnuplot_plot_5a gnuplot_plot_6a gnuplot_plot_7a gnuplot_plot_8a gnuplot_plot_9a gnuplot_plot_10a gnuplot_plot_11a gnuplot_plot_12a gnuplot_plot_13a gnuplot_plot_14a gnuplot_plot_15a gnuplot_plot_16a gnuplot_plot_17a gnuplot_plot_18a gnuplot_plot_19a gnuplot_plot_20a gnuplot_plot_21a gnuplot_plot_22a gnuplot_plot_23a gnuplot_plot_24a gnuplot_plot_25a gnuplot_plot_26a gnuplot_plot_27a gnuplot_plot_28a gnuplot_plot_29a gnuplot_plot_30a gnuplot_plot_31a gnuplot_plot_32a gnuplot_plot_33a gnuplot_plot_34a gnuplot_plot_35a gnuplot_plot_36a gnuplot_plot_37a gnuplot_plot_38a gnuplot_plot_39a gnuplot_plot_40a gnuplot_plot_41a gnuplot_plot_42a gnuplot_plot_43a gnuplot_plot_44a gnuplot_plot_45a gnuplot_plot_46a gnuplot_plot_47a gnuplot_plot_48a gnuplot_plot_49a gnuplot_plot_50a gnuplot_plot_51a gnuplot_plot_52a gnuplot_plot_53a gnuplot_plot_54a gnuplot_plot_55a gnuplot_plot_56a gnuplot_plot_57a gnuplot_plot_58a gnuplot_plot_59a gnuplot_plot_60a

This page was generated using DemoCards.jl and Literate.jl.