TA Charting tool
Project description
TA-charts
By: Carter Carlson
This repository provides technical tools to analyze OHLCV data, along with several TA chart functionalities. These functions are optimized for speed and utilize numpy vectorization over built-in pandas methods.
Basic tools (ta.py
):
rolling(src, n=2, fn=None, axis=1)
: rollingsum
,max
,min
, ormean
ofsrc
acrossn
periodssma(src, n=2)
: simple moving average ofsrc
acrossn
periodsema(src, n=2)
: exponential moving average for a list ofsrc
acrossn
periodsatr(high, low, close, n=2)
: average true range from candlestick dataroc(src, n=2)
: rate of change ofsrc
acrossn
periods
Momentum tools (momentum.py
):
macd(src, slow=25, fast=13)
: moving average convergence/divergence ofsrc
rsi(src, n=2)
: relative strength index ofsrc
acrossn
periods- Used to measure the velocity and magnitude of directional price movement
tsi(src, slow=25, fast=13)
: true strength indicator ofsrc
- Used to determine overbought/oversold conditions, and warning of trend weakness through divergence
Technical indicators (indicators.py
):
td_sequential(src, n=2)
: TD sequential ofsrc
acrossn
periodschaikin_money_flow(df, n=2)
: Chaikin Money Flow of an OHLCV datasetmurrey_math_oscillator(src, n=2)
: Murrey Math oscillator ofsrc
Chart indicators:
bollinger.py
: Bollinger Bandsichimoku.py
: Ichimoku Cloudrenko.py
: Renko Chart
Additional tools (located in utils.py
):
group_candles(df, interval)
: combine candles so instead of needing a different dataset for each time interval, you can form time intervals using more precise data.- Example: you have 15-min candlestick data but want to test a strategy based on 1-hour candlestick data (
interval=4
).
- Example: you have 15-min candlestick data but want to test a strategy based on 1-hour candlestick data (
fill_values(averages, interval, target_len)
: Fill missing values with evenly spaced samples.- Example: You're using 15-min candlestick data to find the 1-hour moving average and want a value at every 15-min mark, and not every 1-hour mark.
crossover(x1, x2)
: find all instances of intersections between two linesintersection(a0, a1, b0, b1)
: find the intersection coordinates between vector A and vector Barea_between(line1, line2)
: find the area between line1 and line2
How it works
import pandas as pd
%matplotlib inline
# NOTE: File should contain the columns 'date', 'open', 'high', 'low', and 'close'
df = pd.read_csv('../Daily.csv')
Bollinger Bands
from bollinger import Bollinger
b = Bollinger(df)
b.build(n=20)
b.plot()
Ichimoku
from ichimoku import Ichimoku
i = Ichimoku(df)
i.build(20, 60, 120, 30)
i.plot()
Renko
from renko import Renko
r = Renko(df)
r.set_brick_size(auto=True, atr_period=2)
r.build()
r.plot()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
TAcharts-0.0.2.tar.gz
(11.3 kB
view hashes)