Hi, I am trying to load some OHLC data into TimeArray (from TimeSeries.jl).
The documentation (Tables.jl Interface Integration · TimeSeries.jl) says I can load it directly as
using CSV
TimeArray(CSV.File(filename), timestamp = :timestamp)
But when I try the following code, I get error.
using TimeSeries
using CSV
filename = "./ohlc-data.csv"
data = TimeArray(CSV.File(filename), timestamp = :time)
ERROR:
MethodError: no method matching TimeArray(::Vector{Int64}, ::Matrix{Float64}, ::Vector{Symbol}, ::CSV.File; unchecked=false)
Closest candidates are:
TimeArray(::AbstractVector{D}, ::AbstractArray{T, N}, ::Vector{Symbol}, ::Any; args...) where {T, N, D<:TimeType} at ~/.julia/packages/TimeSeries/e3V5T/src/timearray.jl:91
TimeArray(::D, ::AbstractArray{T, N}, ::Vector{Symbol}, ::Any; args...) where {T, N, D<:TimeType} at ~/.julia/packages/TimeSeries/e3V5T/src/timearray.jl:96
TimeArray(::AbstractVector{D}, ::AbstractArray{T, N}, ::Vector{S}, ::Any; args...) where {T, N, D<:TimeType, S<:AbstractString} at deprecated.jl:70
...
Stacktrace:
[1] TimeArray(x::CSV.File; timestamp::Symbol, timeparser::Function, unchecked::Bool)
@ TimeSeries.TablesIntegration ~/.julia/packages/TimeSeries/e3V5T/src/tables.jl:82
[2] top-level scope
@ In[6]:4
[3] eval
@ ./boot.jl:360 [inlined]
[4] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
@ Base ./loading.jl:1116
My ohlc data file is of format
time,low,high,open,close,volume
<unixtimestamp>,<float>,<float>,<float>,<float>,<float>
...
How can I fix this error?