https://github.com/jtamos/temporal.jl
Time series implementation for the Julia language focused on efficiency and flexibility
https://github.com/jtamos/temporal.jl
data-analysis data-structures data-visualization econometrics economics finance io julia julia-language quantitative-finance quantitative-trading scientific-computing time-series time-series-analysis timeseries
Last synced: about 15 hours ago
JSON representation
Time series implementation for the Julia language focused on efficiency and flexibility
- Host: GitHub
- URL: https://github.com/jtamos/temporal.jl
- Owner: JTAmos
- License: other
- Created: 2016-02-25T06:48:49.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-03-03T01:11:31.000Z (over 3 years ago)
- Last Synced: 2026-03-31T17:10:39.619Z (4 months ago)
- Topics: data-analysis, data-structures, data-visualization, econometrics, economics, finance, io, julia, julia-language, quantitative-finance, quantitative-trading, scientific-computing, time-series, time-series-analysis, timeseries
- Language: Julia
- Homepage:
- Size: 3.08 MB
- Stars: 101
- Watchers: 9
- Forks: 31
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[](https://travis-ci.org/dysonance/Temporal.jl)
[](https://coveralls.io/github/dysonance/Temporal.jl?branch=master)
[](http://codecov.io/github/dysonance/Temporal.jl?branch=master)
[](https://dysonance.github.io/Temporal.jl/latest)
# Temporal
This package provides a flexible & efficient time series class, `TS`, for the [Julia](http://julialang.org/) programming language. While still early in development, the overarching goal is for the class to be able to slice & dice data with the rapid prototyping speed of [R](https://www.r-project.org/)'s [`xts`](https://github.com/joshuaulrich/xts) and [Python](https://www.python.org/)'s [`pandas`](http://pandas.pydata.org/) packages, while retaining the performance one expects from Julia.
[See the documentation](http://dysonance.github.io/Temporal.jl/latest/) for a more in-depth look at the package and some of the pain points it may solve when doing technical research with time series data.
Below is a brief teaser with a minimal use case illustrating a small subset of features. This example also makes use of the [Indicators.jl](https://github.com/dysonance/Indicators.jl) package, which provides a series of financial market technical analysis indicators with wrappers for the `Temporal.TS` type. Visualization is offered through the [Plots.jl](http://docs.juliaplots.org/latest/) package, which Temporal leverages through [RecipesBase.jl](https://github.com/JuliaPlots/RecipesBase.jl).
```julia
using Temporal, Plots, Indicators
crude = quandl("CHRIS/CME_CL1")
gasoline = quandl("CHRIS/CME_RB1")
prices = [crude["2012/2019", :Settle] gasoline["2012/2019", :Settle]]
prices.fields = [:Crude, :Gasoline]
prices = dropnan(prices)
daily_returns = diff(log(prices))
cumulative_returns = cumprod(1 + daily_returns)
spread = cumulative_returns[:,1] - cumulative_returns[:,2]
spread = [spread sma(spread, n=200)]
spread.fields = Symbol.(["Spread", "SMA (200)"])
gr()
ℓ = @layout[ a{0.7h}; b{0.3h} ]
plot(cumulative_returns, c=[:black :purple], layout=ℓ, subplot=1)
plot!(spread, c=[:blue :orange], layout=ℓ, subplot=2)
```
