femtotrader / TALib.jl

A Julia wrapper for TA-Lib
Other
50 stars 11 forks source link

TALib.jl should support JuliaTS #6

Open femtotrader opened 8 years ago

femtotrader commented 8 years ago

JuliaTS (time series and relational algebra operations over NDSparseData) support may also be considered for level 2 API for this Julia TA-Lib wrapper.

see https://github.com/tanmaykm/JuliaTS.jl/issues/4

femtotrader commented 8 years ago
using DataFrames
using JuliaTS
using TimeSeries

# read as DataFrame from DataFrames.jl https://github.com/JuliaStats/DataFrames.jl
dfOHLCV = readtable("ford_2012.csv");
dfOHLCV[:Date] = Date(dfOHLCV[:Date]);

# read as timeseries
tsOHLCV = readtimearray("ford_2012.csv");

# dataframe to TArray
ta = TArray((:Date,), [n=>dfOHLCV[n] for n in names(dfOHLCV)]...)

# timeseries to TArray
ta = TArray((:Date,), :Date=>tsOHLCV.timestamp, [symbol(n)=>tsOHLCV[n].values for n in colnames(tsOHLCV)]...)
femtotrader commented 7 years ago

see also https://github.com/femtotrader/DataReaders.jl/issues/11