Giter Club home page Giter Club logo

talib's Introduction

Technical Analysis for Elixir Build Status

Talib provides easy access to indicators, oscillators and several utility functions.

It's currently a work in progress; updates will be pushed on a regular basis.

Features

  • Utility

    • Change
    • Gain
    • High
    • Loss
    • Low
    • Occur
  • Average

    • Mean
    • Median
    • Midrange
    • Mode
  • Moving Average

    • Cumulative
    • Exponential
    • Simple
    • Smoothed
  • Indicator

    • MACD (Moving Average Convergence Divergence)
    • RSI (Relative Strength Index)

Why?

As I was scanning the supported functions of the widely-used library 'TA-Lib', I was missing some things I wanted to use, such as elasticity for comparison of markets and indicators like the McClellan oscillator. Besides that, the project seems abandoned as there have been no releases since 2007.

The goal of this library is to have most indicators built-in, where missing indicators can be suggested through the issue tracker and pull requests.

If there's enough demand as well as developer time, the functions will be ported to a language that will process them faster than Elixir currently can.

Changelog

This repository uses GitHub releases to manage changes in the codebase.

Contributing

To ensure correct functioning of this library, you could help out in several ways.

  1. Auditing
    Verifying the inputs and outputs of a given function and the corresponding unit tests.

  2. Refactoring
    Updating the functions to a more readable state, or a state with better performance.

  3. Suggesting
    Suggesting missing indicators or functions.
    If you're willing to do this, please send a draft with expected inputs and outputs of the function.

For more information, view CONTRIBUTING.md. Thanks!

Contributors

Role Name Referral
Developer Wouter Klijn GitHub

Your name could be here!

talib's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

talib's Issues

Typespecs

These should be added to the functions, for compatibility with Dialyzer / Dialyxir.

Negative and floating-point periods

Problem:
A BadPeriodError is raised (or the corresponding tuple returned) when the period is 0, but not when the period is negative or even a floating-point number.

When porting to C, this could lead to unwanted behavior when typecasting floats to integers. However, I'm not sure how the GMP library handles this case.

It should be resolved nevertheless; from a user's perspective this is unwanted behavior.

Solution:
Periods should come in the form of a non-zero unsigned integer. Anything else should raise a BadPeriodError, or return {:error, :bad_period}.

Using signalling NaN vs Nil

As I've been working with Nil and propagating these across functions, the question whether or not to use NaN for these signalling purposes arose.

So currently when there's not enough data, Nil is passed as a result, as every input value should have an output value, which is by design.

Considerations:

  • The TA-Lib C library uses NaN as well when missing data.

  • The problem with NaN is that the exact reason why NaN is returned is not clear - did we divide zero by zero? Even more important, it doesn't handle comparisons very well.

  • We only have to pass the information that there's no output data as there's not enough input data. R handles this using NA (Not Available).

  • If necessary, we could use a new atom representing this.

Sources:
https://blog.metawrap.com/2005/09/11/null-undefined-and-nan
https://blogs.janestreet.com/making-something-out-of-nothing-or-why-none-is-better-than-nan-and-null/

Fix SMA formula

When calculating the SMA of index 6 with period 5, it includes index 1, as the sum is inclusive.
However, it should only calculate with indexes 2, 3, 4, 5 and 6.

Solution:
Formula underneath the sum should be k = i - p + 1

Talib.MovingAverage

The module Talib.MovingAverage is references throughout the codebase, but is not implemented anywhere

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.