title | author | date |
---|---|---|
jhTAlib |
Joost Hoeks |
2020-02-11 |
Technical Analysis Library Time-Series
You can use and import it for your:
-
Technical Analysis Software
-
Charting Software
-
Backtest Software
-
Trading Robot Software
-
Trading Software in general
Work in progress...
From PyPI:
$ [sudo] pip3 install jhtalib
From source - source mirror 1 - source mirror 2:
$ git clone https://github.com/joosthoeks/jhTAlib.git
$ cd jhTAlib
$ [sudo] pip3 install -e .
From PyPI:
$ [sudo] pip3 install --upgrade jhtalib
From source - source mirror 1 - source mirror 2:
$ cd jhTAlib
$ git pull [upstream master]
From PyPI:
!pip install --upgrade jhtalib
import jhtalib as jhta
From source - source mirror 1 - source mirror 2:
!git clone [-b branch-name] https://github.com/joosthoeks/jhTAlib.git
%cd '/content/jhTAlib'
import jhtalib as jhta
%cd '/content'
!rm -rf ./jhTAlib/
$ cd example/
$ python3 example-1-plot.py
or
https://colab.research.google.com/github/joosthoeks/jhTAlib/blob/master/example/example-1-plot.ipynb
$ python3 example-2-plot.py
or
https://colab.research.google.com/github/joosthoeks/jhTAlib/blob/master/example/example-2-plot.ipynb
$ python3 example-3-plot.py
or
https://colab.research.google.com/github/joosthoeks/jhTAlib/blob/master/example/example-3-plot.ipynb
$ python3 example-4-plot-quandl.py
or
$ python3 example-5-plot-quandl.py
or
$ python3 example-6-plot-quandl.py
or
$ python3 example-7-quandl-2-df.py
or
$ python3 example-8-alphavantage-2-df.py
or
$ python3 example-9-cryptocompare-2-df.py
or
DF NumPy Pandas
Basic Usage
$ cd test/
$ python3 test.py
import jhtalib as jhta
dict of lists of floats = jhta.ATH(df, price='High')
dict of lists of floats = jhta.LMC(df, price='Low', price_high='High')
-
dict of lists of floats = jhta.PP(df, high='High', low='Low', close='Close')
-
https://en.wikipedia.org/wiki/Pivot_point_(technical_analysis)
dict of lists of floats = jhta.FIBOPR(df, price='Close')
dict of lists of floats = jhta.GANNPR(df, price='Close')
-
jdn = jhta.JDN(utc_year, utc_month, utc_day)
-
jd = jhta.JD(utc_year, utc_month, utc_day, utc_hour, utc_minute, utc_second)
-
list of floats = jhta.CDLBODYS(df, open='Open', close='Close')
-
https://www.tradeciety.com/understand-candlesticks-patterns/
-
list of floats = jhta.CDLWICKS(df, high='High', low='Low')
-
https://www.tradeciety.com/understand-candlesticks-patterns/
-
list of floats = jhta.CDLUPPSHAS(df, open='Open', high='High', close='Close')
-
https://www.tradeciety.com/understand-candlesticks-patterns/
-
list of floats = jhta.CDLLOWSHAS(df, open='Open', low='Low', close='Close')
-
https://www.tradeciety.com/understand-candlesticks-patterns/
list of floats = jhta.CDLBODYP(df, open='Open', close='Close')
-
list of floats = jhta.CDLBODYM(df, n, open='Open', close='Close')
-
book: Trading Systems and Methods
list of floats = jhta.GAP(df, high='High', low='Low', close='Close')
-
list of floats = jhta.QSTICK(df, n, open='Open', close='Close')
-
dict of lists of floats = jhta.SHADOWT(df, n, open='Open', high='High', low='Low', close='Close')
-
book: The New Technical Trader
-
list of floats = jhta.IMI(df, open='Open', close='Close')
list of booleans = jhta.INSBAR(df, high='High', low='Low')
list of booleans = jhta.OUTSBAR(df, high='High', low='Low')
-
list of floats = jhta.TS(df, n, price='Close')
-
https://www.fmlabs.com/reference/default.htm?url=TrendScore.htm
dict of tuples of floats = jhta.CSV2DF(csv_file_path, datetime='datetime', Open='Open', high='High', low='Low', close='Close', volume='Volume')
dict of tuples of floats = jhta.CSVURL2DF(csv_file_url, datetime='datetime', open='Open', high='High', low='Low', close='Close', volume='Volume')
csv file = jhta.DF2CSV(df, csv_file_path, datetime='datetime', Open='Open', high='High', low='Low', close='Close', volume='Volume')
dict of tuples of floats = jhta.DF2DFREV(df, datetime='datetime', open='Open', high='High', low='Low', close='Close', volume='Volume')
dict of tuples of floats = jhta.DF2DFWIN(df, start=0, end=10, datetime='datetime', open='Open', high='High', low='Low', close='Close', volume='Volume')
dict of tuples of floats = jhta.DF_HEAD(df, n=5, datetime='datetime', open='Open', high='High', low='Low', close='Close', volume='Volume')
dict of tuples of floats = jhta.DF_TAIL(df, n=5, datetime='datetime', open='Open', high='High', low='Low', close='Close', volume='Volume')
dict of tuples of floats = jhta.DF2HEIKIN_ASHI(df, datetime='datetime', open='Open', high='High', low='Low', close='Close', volume='Volume')
-
list of floats = jhta.ASI(df, L, open='Open', high='High', low='Low', close='Close')
-
book: New Concepts in Technical Trading Systems
-
list of floats = jhta.SI(df, L, open='Open', high='High', low='Low', close='Close')
-
book: New Concepts in Technical Trading Systems
list of floats = jhta.SAVGP(df, open='Open', high='High', low='Low', close='Close')
list of floats = jhta.SAVGPS(df, open='Open', high='High', low='Low', close='Close')
list of floats = jhta.SCO(df, open='Open', close='Close')
list of floats = jhta.SCOS(df, open='Open', close='Close')
list of floats = jhta.SMEDP(df, high='High', low='Low')
list of floats = jhta.SMEDPS(df, high='High', low='Low')
list of floats = jhta.SPP(df, price='Close')
list of floats = jhta.SPPS(df, price='Close')
list of floats = jhta.STYPP(df, high='High', low='Low', close='Close')
list of floats = jhta.STYPPS(df, high='High', low='Low', close='Close')
list of floats = jhta.SWCLP(df, high='High', low='Low', close='Close')
list of floats = jhta.SWCLPS(df, high='High', low='Low', close='Close')
-
list of floats = jhta.NORMALIZE(df, price_max='High', price_min='Low', price='Close')
-
https://machinelearningmastery.com/normalize-standardize-time-series-data-python/
-
list of floats = jhta.STANDARDIZE(df, price='Close')
-
https://machinelearningmastery.com/normalize-standardize-time-series-data-python/
float = jhta.REMAP(x, old_min=0, old_max=1000, new_min=0, new_max=100)
list of floats = jhta.REMAPS(df, old_min=0, old_max=1000, new_min=0, new_max=100, price='Close')
-
list of floats = jhta.RATIO(df1, df2, price1='Close', price2='Close')
list of floats = jhta.SPREAD(df1, df2, price1='Close', price2='Close')
-
list of floats = jhta.CP(df1, df2, price1='Close', price2='Close')
-
https://www.fmlabs.com/reference/default.htm?url=CompPerformance.htm
-
list of floats = jhta.CRSI(df1, df2, n, price1='Close', price2='Close')
-
list of floats = jhta.CS(df1, df2, price1='Close', price2='Close')
-
https://www.fmlabs.com/reference/default.htm?url=CompStrength.htm
print = jhta.INFO(df, price='Close')
print = jhta.INFO_TRADES(profit_trades_list, loss_trades_list)
list of floats = jhta.EXP(df, price='Close')
list of floats = jhta.LOG(df, price='Close')
list of floats = jhta.LOG10(df, price='Close')
list of floats = jhta.SQRT(df, price='Close')
list of floats = jhta.ACOS(df, price='Close')
list of floats = jhta.ASIN(df, price='Close')
list of floats = jhta.ATAN(df, price='Close')
list of floats = jhta.COS(df, price='Close')
list of floats = jhta.SIN(df, price='Close')
list of floats = jhta.TAN(df, price='Close')
list of floats = jhta.ACOSH(df, price='Close')
list of floats = jhta.ASINH(df, price='Close')
list of floats = jhta.ATANH(df, price='Close')
list of floats = jhta.COSH(df, price='Close')
list of floats = jhta.SINH(df, price='Close')
list of floats = jhta.TANH(df, price='Close')
float = jhta.PI()
float = jhta.E()
float = jhta.TAU()
float = jhta.PHI()
list of ints = jhta.FIB(n)
list of floats = jhta.CEIL(df, price='Close')
list of floats = jhta.FLOOR(df, price='Close')
list of floats = jhta.DEGREES(df, price='Close')
list of floats = jhta.RADIANS(df, price='Close')
list of floats = jhta.ADD(df, high='High', low='Low')
list of floats = jhta.DIV(df, high='High', low='Low')
list of floats = jhta.MAX(df, n, price='Close')
list of ints = jhta.MAXINDEX(df, n, price='Close')
list of floats = jhta.MIN(df, n, price='Close')
list of ints = jhta.MININDEX(df, n, price='Close')
dict of lists of floats = jhta.MINMAX(df, n, price='Close')
dict of lists of ints = jhta.MINMAXINDEX(df, n, price='Close')
list of floats = jhta.MULT(df, high='High', low='Low')
list of floats = jhta.SUB(df, high='High', low='Low')
list of floats = jhta.SUM(df, n, price='Close')
-
float = jhta.SLOPE(x1, y1, x2, y2)
-
book: An Introduction to Algorithmic Trading
-
list of floats = jhta.SLOPES(df, n, price='Close')
-
book: An Introduction to Algorithmic Trading
-
float = jhta.ED(x1, y1, x2, y2)
-
book: An Introduction to Algorithmic Trading
-
list of floats = jhta.EDS(df, n, price='Close')
-
book: An Introduction to Algorithmic Trading
-
list of floats = jhta.APO(df, n_fast, n_slow, price='Close')
-
https://www.fmlabs.com/reference/default.htm?url=PriceOscillator.htm
-
list of floats = jhta.MFI(df, n, high='High', low='Low', close='Close', volume='Volume')
-
https://www.fmlabs.com/reference/default.htm?url=MoneyFlowIndex.htm
-
list of floats = jhta.MOM(df, n, price='Close')
-
https://www.fmlabs.com/reference/default.htm?url=Momentum.htm
-
list of floats = jhta.RMI(df, n, price='Close')
list of floats = jhta.ROC(df, n, price='Close')
list of floats = jhta.ROCP(df, n, price='Close')
list of floats = jhta.ROCR(df, n, price='Close')
-
list of floats = jhta.ROCR100(df, n, price='Close')
-
https://www.fmlabs.com/reference/default.htm?url=RateOfChange.htm
-
list of floats = jhta.RSI(df, n, price='Close')
-
list of floats = jhta.STOCH(df, n, price='Close')
-
https://www.fmlabs.com/reference/default.htm?url=Stochastic.htm
-
list of floats = jhta.VHF(df, n, price='Close')
-
list of floats = jhta.WILLR(df, n, high='High', low='Low', close='Close')
-
https://www.fmlabs.com/reference/default.htm?url=WilliamsR.htm
-
dict of lists of floats = jhta.BBANDS(df, n, f=2, high='High', low='Low', close='Close')
-
https://www.fmlabs.com/reference/default.htm?url=Bollinger.htm
-
list of floats = jhta.BBANDW(df, n, f=2, high='High', low='Low', close='Close')
-
https://www.fmlabs.com/reference/default.htm?url=BollingerWidth.htm
-
list of floats = jhta.EMA(df, n, price='Close')
-
dict of lists of floats = jhta.ENVP(df, pct=.01, price='Close')
-
https://www.fmlabs.com/reference/default.htm?url=EnvelopePct.htm
-
list of floats = jhta.MIDPOINT(df, n, price='Close')
-
list of floats = jhta.MIDPRICE(df, n, high='High', low='Low')
-
list of floats = jhta.MMR(df, n=200, price='Close')
-
list of floats = jhta.SAR(df, af_step=.02, af_max=.2, high='High', low='Low')
-
book: New Concepts in Technical Trading Systems
-
list of floats = jhta.SMA(df, n, price='Close')
-
https://www.fmlabs.com/reference/default.htm?url=SimpleMA.htm
-
list of floats = jhta.TRIMA(df, n, price='Close')
-
https://www.fmlabs.com/reference/default.htm?url=TriangularMA.htm
-
list of floats = jhta.VAMA(df, n, price='Close', volume='Volume')
-
https://www.fmlabs.com/reference/default.htm?url=VolAdjustedMA.htm
-
list of floats = jhta.WWMA(df, n, price='Close')
-
https://www.fmlabs.com/reference/default.htm?url=WellesMA.htm
-
list of floats = jhta.WWS(df, n, price='Close')
-
https://www.fmlabs.com/reference/default.htm?url=WellesSum.htm
-
list of floats = jhta.AVGPRICE(df, open='Open', high='High', low='Low', close='Close')
-
https://www.fmlabs.com/reference/default.htm?url=AvgPrices.htm
-
list of floats = jhta.MEDPRICE(df, high='High', low='Low')
-
https://www.fmlabs.com/reference/default.htm?url=MedianPrices.htm
-
list of floats = jhta.TYPPRICE(df, high='High', low='Low', close='Close')
-
https://www.fmlabs.com/reference/default.htm?url=TypicalPrices.htm
-
list of floats = jhta.WCLPRICE(df, high='High', low='Low', close='Close')
-
https://www.fmlabs.com/reference/default.htm?url=WeightedCloses.htm
list of floats = jhta.MEAN(df, n, price='Close')
list of floats = jhta.HARMONIC_MEAN(df, n, price='Close')
list of floats = jhta.MEDIAN(df, n, price='Close')
list of floats = jhta.MEDIAN_LOW(df, n, price='Close')
list of floats = jhta.MEDIAN_HIGH(df, n, price='Close')
list of floats = jhta.MEDIAN_GROUPED(df, n, price='Close', interval=1)
list of floats = jhta.MODE(df, n, price='Close')
list of floats = jhta.PSTDEV(df, n, price='Close', mu=None)
list of floats = jhta.PVARIANCE(df, n, price='Close', mu=None)
list of floats = jhta.STDEV(df, n, price='Close', xbar=None)
list of floats = jhta.VARIANCE(df, n, price='Close', xbar=None)
-
float = jhta.COV(x_list, y_list)
-
https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Covariance
-
list of floats = jhta.COVARIANCE(df1, df2, n, price1='Close', price2='Close')
-
https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Covariance
float = jhta.COR(x_list, y_list)
list of floats = jhta.CORRELATION(df1, df2, n, price1='Close', price2='Close')
float = jhta.PCOR(x_list, y_list)
list of floats = jhta.PCORRELATION(df1, df2, n, price1='Close', price2='Close')
-
float = jhta.R2(x_list, y_list)
-
list of floats = jhta.RSQUARED(df1, df2, n, price1='Close', price2='Close')
-
dict of lists of floats = jhta.REGRESSION(x_list, y_list)
-
float = jhta.SSE(x_list, y_list)
-
https://www.wikihow.com/Calculate-the-Standard-Error-of-Estimate
-
float = jhta.SEE(x_list, y_list)
-
https://www.wikihow.com/Calculate-the-Standard-Error-of-Estimate
-
float = jhta.PSEE(x_list, y_list)
-
https://www.wikihow.com/Calculate-the-Standard-Error-of-Estimate
-
list of floats = jhta.LSMA(df, n, price='Close')
-
https://www.fmlabs.com/reference/default.htm?url=LstSqrMA.htm
-
float = jhta.BETA(x_list, y_list)
-
list of floats = jhta.BETAS(df1, df2, n, price1='Close', price2='Close')
-
list of floats = jhta.LSR(df, price='Close', predictions_int=0)
-
https://www.mathsisfun.com/data/least-squares-regression.html
-
list of floats = jhta.SLR(df, price='Close', predictions_int=0)
-
https://machinelearningmastery.com/implement-simple-linear-regression-scratch-python/
-
float = jhta.HR(hit_trades_int, total_trades_int)
-
float = jhta.PLR(mean_trade_profit_float, mean_trade_loss_float)
-
float = jhta.EV(hitrade_float, mean_trade_profit_float, mean_trade_loss_float)
-
int = jhta.POR(hitrade_float, profit_loss_ratio_float)
-
book: Computer Analysis of the Futures Markets
-
float = jhta.BPPS(trade_start_price, trade_end_price, trade_start_timestamp, trade_end_timestamp)
-
book: An Introduction to Algorithmic Trading
-
list of floats = jhta.RET(df, price='Close')
-
book: An Introduction to Algorithmic Trading
-
list of floats = jhta.RETS(df, price='Close')
-
book: An Introduction to Algorithmic Trading
-
list of floats = jhta.PRET(df, price='Close')
-
book: An Introduction to Algorithmic Trading
-
list of floats = jhta.PRETS(df, price='Close')
-
book: An Introduction to Algorithmic Trading
-
list of floats = jhta.AEM(df, high='High', low='Low', volume='Volume')
-
https://www.fmlabs.com/reference/default.htm?url=ArmsEMV.htm
-
list of floats = jhta.ATR(df, n, high='High', low='Low', close='Close')
-
list of floats = jhta.RVI(df, n, high='High', low='Low')
-
list of floats = jhta.RVIOC(df, n, price='Close')
-
https://www.fmlabs.com/reference/default.htm?url=RVIoriginal.htm
-
list of floats = jhta.INERTIA(df, n, price='Close')
-
https://www.fmlabs.com/reference/default.htm?url=Inertia.htm
-
list of floats = jhta.PRANGE(df, n, max_price='High', min_price='Low')
-
book: An Introduction to Algorithmic Trading
-
list of floats = jhta.TRANGE(df, high='High', low='Low', close='Close')
-
list of floats = jhta.DVOLA(df, n=30, price='Close')
-
list of floats = jhta.AVOLA(df, n=30, na=252, price='Close')
-
list of floats = jhta.AD(df, high='High', low='Low', close='Close', volume='Volume')
-
https://www.fmlabs.com/reference/default.htm?url=AccumDist.htm
-
list of floats = jhta.MFAI(df, high='High', low='Low', volume='Volume')
-
list of floats = jhta.NVI(df, price='Close', volume='Volume')
-
list of floats = jhta.OBV(df, close='Close', volume='Volume')
-
list of ints = jhta.PVR(df, price='Close', volume='Volume')
-
list of floats = jhta.PVT(df, price='Close', volume='Volume')
-
list of floats = jhta.PVI(df, price='Close', volume='Volume')
-
list of floats = jhta.VWAP(df, open='Open', high='High', low='Low', close='Close', volume='Volume')
-
book: An Introduction to Algorithmic Trading