Coder Social home page Coder Social logo

joelowj / ttrpy Goto Github PK

View Code? Open in Web Editor NEW
21.0 2.0 11.0 545 KB

Technical analysis and other functions to construct technical trading rules with Python

Home Page: https://joelowj.github.io/ttrpy/

License: Apache License 2.0

Python 99.78% Makefile 0.22%
finance technical-analysis investment python3 research quantitative-trading systematic-trading-strategies indicators

ttrpy's Introduction

ttrpy

Build Status codecov PRs Welcome

Technical Trading Rule Python is an open source library for popular technical analysis function for financial time series data.

Installation

To install the current release:

$ pip install ttrpy

Usage Overview

Load historical stock data into Pandas from existing csv file or directly from the web.

>>> import pandas as pd
>>> df = pd.read_csv("weekly_MSFT.csv").sort_values(by="timestamp").reset_index(drop=True)
>>> df.tail(3)
      timestamp    open    high     low   close   volume
1098 2019-01-25  106.75   107.88    ...    ...     ...
1099 2019-02-01  106.26   106.48    ...    ...     ...
1100 2019-02-07  102.87   107.27    ...    ...     ...

Let's say we are interested in the overall long-term trend for MSFT, we can use the simple moving average function from the trend package.

>>> from ttrpy.trend.sma import sma
>>> df = sma(df, "close", "sma", 200)
>>> df.tail(3)
      timestamp    open    high     low   close   volume    sma
1098 2019-01-25  106.75   107.88    ...    ...     ...    71.080175
1099 2019-02-01  106.26   106.48    ...    ...     ...    71.392625
1100 2019-02-07  102.87   107.27    ...    ...     ...    71.707025

As easy as that!

Contribution Guidelines

If you want to contribute to ttrpy, be sure to review the contribution guidelines. This project adheres to ttrpy's code of conduct. By participating, you are expected to uphold this code.

To get the local repository set up for development,

$ pip install pipenv
$ pip install --dev

If you find a bug, kindly open an issue here.

If you would like to request a new feature, feel free to do so by opening an issue here.

To fix a bug or enhance an existing module, follow these steps:

  • Fork the repository
  • Create a new branch (git checkout - b branch-name)
  • Make the appropriate changes in the files
  • Add changes to reflect the changes made
  • Commit your changes (git commit -m 'commit message')
  • Push to the branch (git push origin branch-name)
  • Create a Pull Request

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository

License

This project is licensed under Apache License 2.0 - see the LICENSE file for details.

ttrpy's People

Contributors

joelowj avatar

Stargazers

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

Watchers

 avatar  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.