Git Product home page Git Product logo

trendy's Introduction

trendy

Numerical trendline Python algorithms for technical analysis of financial securities.

Installation

  1. Clone or download the ZIP file and unpack.
  2. Go to the unpacked directory and copy to your Python path. Alternatively, you can place the trendy.py file in an easily reachable directory and import into your current working Python environment with
execfile('/path/to/trendy.py')

or

import trendy

I am still working on getting this project hosted on the Python Package Index, but for now this at least enables you to start using and gaining familiarity with the algorithms.

Examples

Once the files have been imported, you can implement them with simple function calls. Here are some examples.

# Download Apple price history and save adjusted close prices to numpy array
import pandas.io.data as pd
x = pd.DataReader("AAPL", "yahoo")['Adj Close']

# Make some trendlines
import trendy

# Generate general support/resistance trendlines and show the chart
# winow < 1 is considered a fraction of the length of the data set
trendy.gentrends(x, window = 1.0/3, charts = True)

# Generate a series of support/resistance lines by segmenting the price history
trendy.segtrends(x, segments = 2, charts = True)  # equivalent to gentrends with window of 1/2
trendy.segtrends(x, segments = 5, charts = True)  # plots several S/R lines

# Generate smaller support/resistance trendlines to frame price over smaller periods
trendy.minitrends(x, window = 30, charts = True)

# Iteratively generate trading signals based on maxima/minima in given window
trendy.iterlines(x, window = 30, charts = True)  # buy at green dots, sell at red dots

trendy's People

Contributors

dysonance avatar

Watchers

James Cloos 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.