Skip to content
项目

关于

用于金融证券技术分析的数值趋势线算法。

商业与金融

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
-1
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

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

探索相关项目

加载中…