Coder Social home page Coder Social logo

temporal.jl's Introduction

Build Status Coverage Status codecov.io

Temporal

This package provides a flexible & efficient time series class, TS, for the Julia 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's xts and Python's pandas packages, while retaining the performance one expects from Julia.

See the documentation 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 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 package, which Temporal leverages through RecipesBase.jl.

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)

alt text

temporal.jl's People

Contributors

dysonance avatar femtotrader avatar fredrikekre avatar juliatagbot avatar maccam912 avatar moelf avatar staticfloat avatar zhubonan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.