I'm having an issue figuring out how to get data from a dataframe in this format:
These are the types that get printed from each column:
DataType[Any, Any, Any, Any, Any]
This is the error i'm getting and already tried converting the types without success:
ERROR: MethodError: no method matching Plots.OHLC(::Vector{Any}, ::Vector{Any}, ::Vector{Any}, ::Vector{Any}, ::Vector{Any})
The code tries to get the data from an excel file and plot it into a candlestick chart:
using Dates
using XLSX
using Plots
using DataFrames
# Load data from Excel file
data = DataFrame(XLSX.readtable("Janeiro2023.xlsx", "Sheet1"))
# Check data types of columns
println(eltype.(eachcol(data)))
# Extract the columns as arrays
datetime_array = data[!, 1]
open_array = data[!, 2]
high_array = data[!, 3]
low_array = data[!, 4]
close_array = data[!, 5]
# Create an OHLC object from the arrays
ohlc = Plots.OHLC(datetime_array, open_array, high_array, low_array, close_array)
# Plot the candlestick chart
plot(ohlc)