mirror of
https://github.com/wassname/pandas-ta.git
synced 2026-06-27 16:10:07 +08:00
MAINT DOC refactor
This commit is contained in:
@@ -75,14 +75,14 @@ _Pandas Technical Analysis_ (**Pandas TA**) is an easy to use library that lever
|
||||
|
||||
Stable
|
||||
------
|
||||
The ```pip``` version is the last most stable release.
|
||||
The ```pip``` version is the last most stable release. Version: *0.2.23b*
|
||||
```sh
|
||||
$ pip install pandas_ta
|
||||
```
|
||||
|
||||
Latest Version
|
||||
--------------
|
||||
Best choice!
|
||||
Best choice! Version: *0.2.45b*
|
||||
```sh
|
||||
$ pip install -U git+https://github.com/twopirllc/pandas-ta
|
||||
```
|
||||
@@ -656,7 +656,7 @@ Use parameter: cumulative=**True** for cumulative results.
|
||||
|
||||
<br/><br/>
|
||||
|
||||
# **Performance Metrics** (BETA)
|
||||
# **Performance Metrics** _BETA_
|
||||
_Performance Metrics_ are a **new** addition to the package and consequentially are likely unreliable. **Use at your own risk.** These metrics return a _float_ and are _not_ part of the _DataFrame_ Extension. They are called the Standard way. For Example:
|
||||
|
||||
```python
|
||||
@@ -722,8 +722,4 @@ article in the June, 1994 issue of Technical Analysis of Stocks & Commodities Ma
|
||||
<br />
|
||||
|
||||
# **Sources**
|
||||
* [Original TA-LIB](http://ta-lib.org/)
|
||||
* [TradingView](http://www.tradingview.com)
|
||||
* [Sierra Chart](https://search.sierrachart.com/?Query=indicators&submitted=true)
|
||||
* [FM Labs](https://www.fmlabs.com/reference/default.htm)
|
||||
* [User 42](https://user42.tuxfamily.org/chart/manual/index.html)
|
||||
[Original TA-LIB](http://ta-lib.org/) | [TradingView](http://www.tradingview.com) | [Sierra Chart](https://search.sierrachart.com/?Query=indicators&submitted=true) | [MQL5](https://www.mql5.com) | [FM Labs](https://www.fmlabs.com/reference/default.htm) | [Pro Real Code](https://www.prorealcode.com/prorealtime-indicators) | [User 42](https://user42.tuxfamily.org/chart/manual/index.html)
|
||||
@@ -77,7 +77,8 @@ Args:
|
||||
|
||||
Kwargs:
|
||||
naive (bool, optional): If True, prefills potential Doji less than
|
||||
the length if less than a percentage of it's high-low range. Default: False
|
||||
the length if less than a percentage of it's high-low range.
|
||||
Default: False
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
fill_method (value, optional): Type of fill method
|
||||
|
||||
|
||||
@@ -36,8 +36,7 @@ def ebsw(close, length=None, bars=None, offset=None, **kwargs):
|
||||
c3 = -1 * a1 * a1
|
||||
c1 = 1 - c2 - c3
|
||||
Filt = c1 * (HP + lastHP) / 2 + c2 * FilterHist[1] + c3 * FilterHist[0]
|
||||
# Filt = float("{:.8f}".format(float(Filt))) # to fix for small scientific notations, the big ones fail
|
||||
# print('Filt: ', Filt, 'FilterHist (list): ', FilterHist)
|
||||
# Filt = float("{:.8f}".format(float(Filt))) # to fix for small scientific notations, the big ones fail
|
||||
|
||||
# 3 Bar average of Wave amplitude and power
|
||||
Wave = (Filt + FilterHist[1] + FilterHist[0]) / 3
|
||||
|
||||
@@ -57,9 +57,9 @@ Calculation:
|
||||
Args:
|
||||
high (pd.Series): Series of 'high's
|
||||
low (pd.Series): Series of 'low's
|
||||
fast (int): The short period. Default: 5
|
||||
slow (int): The long period. Default: 34
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
fast (int): The short period. Default: 5
|
||||
slow (int): The long period. Default: 34
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -40,7 +40,7 @@ apo.__doc__ = \
|
||||
|
||||
The Absolute Price Oscillator is an indicator used to measure a security's
|
||||
momentum. It is simply the difference of two Exponential Moving Averages
|
||||
(EMA) of two different periods. Note: APO and MACD lines are equivalent.
|
||||
(EMA) of two different periods. Note: APO and MACD lines are equivalent.
|
||||
|
||||
Sources:
|
||||
https://www.tradingtechnologies.com/xtrader-help/x-study/technical-indicator-definitions/absolute-price-oscillator-apo/
|
||||
@@ -53,9 +53,9 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
fast (int): The short period. Default: 12
|
||||
slow (int): The long period. Default: 26
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
fast (int): The short period. Default: 12
|
||||
slow (int): The long period. Default: 26
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -50,10 +50,10 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): The period. Default: 26
|
||||
mamode (str): Options: 'ema', 'hma', 'rma', 'sma', 'wma'. Default: 'sma'
|
||||
drift (int): The short period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): The period. Default: 26
|
||||
mamode (str): Options: 'ema', 'hma', 'rma', 'sma', 'wma'. Default: 'sma'
|
||||
drift (int): The short period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -85,10 +85,10 @@ Args:
|
||||
high (pd.Series): Series of 'high's
|
||||
low (pd.Series): Series of 'low's
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): The period. Default: 26
|
||||
scalar (float): How much to magnify. Default: 100
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): The period. Default: 26
|
||||
scalar (float): How much to magnify. Default: 100
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -62,9 +62,9 @@ Args:
|
||||
high (pd.Series): Series of 'high's
|
||||
low (pd.Series): Series of 'low's
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 14
|
||||
c (float): Scaling Constant. Default: 0.015
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 14
|
||||
c (float): Scaling Constant. Default: 0.015
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -46,8 +46,8 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): The length of the period. Default: 10
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): The length of the period. Default: 10
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -58,10 +58,10 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): WMA period. Default: 10
|
||||
fast (int): Fast ROC period. Default: 11
|
||||
slow (int): Slow ROC period. Default: 14
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): WMA period. Default: 10
|
||||
fast (int): Fast ROC period. Default: 11
|
||||
slow (int): Slow ROC period. Default: 14
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -79,8 +79,8 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -73,8 +73,8 @@ Args:
|
||||
high (pd.Series): Series of 'high's
|
||||
low (pd.Series): Series of 'low's
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 14
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 14
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -102,9 +102,9 @@ Calculation:
|
||||
Args:
|
||||
high (pd.Series): Series of 'high's
|
||||
low (pd.Series): Series of 'low's
|
||||
length (int): Fisher period. Default: 9
|
||||
signal (int): Fisher Signal period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): Fisher period. Default: 9
|
||||
signal (int): Fisher Signal period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -75,10 +75,10 @@ Args:
|
||||
high (pd.Series): Series of 'high's
|
||||
low (pd.Series): Series of 'low's
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 20
|
||||
rvi_length (int): RVI period. Default: 14
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 20
|
||||
rvi_length (int): RVI period. Default: 14
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -86,7 +86,7 @@ Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): Default: 9
|
||||
signal (int): Default: 3
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
+11
-11
@@ -83,17 +83,17 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
roc1 (int): ROC 1 period. Default: 10
|
||||
roc2 (int): ROC 2 period. Default: 15
|
||||
roc3 (int): ROC 3 period. Default: 20
|
||||
roc4 (int): ROC 4 period. Default: 30
|
||||
sma1 (int): SMA 1 period. Default: 10
|
||||
sma2 (int): SMA 2 period. Default: 10
|
||||
sma3 (int): SMA 3 period. Default: 10
|
||||
sma4 (int): SMA 4 period. Default: 15
|
||||
signal (int): It's period. Default: 9
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
roc1 (int): ROC 1 period. Default: 10
|
||||
roc2 (int): ROC 2 period. Default: 15
|
||||
roc3 (int): ROC 3 period. Default: 20
|
||||
roc4 (int): ROC 4 period. Default: 30
|
||||
sma1 (int): SMA 1 period. Default: 10
|
||||
sma2 (int): SMA 2 period. Default: 10
|
||||
sma3 (int): SMA 3 period. Default: 10
|
||||
sma4 (int): SMA 4 period. Default: 15
|
||||
signal (int): It's period. Default: 9
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -93,7 +93,7 @@ macd.__doc__ = \
|
||||
|
||||
The MACD is a popular indicator to that is used to identify a security's trend.
|
||||
While APO and MACD are the same calculation, MACD also returns two more series
|
||||
called Signal and Histogram. The Signal is an EMA of MACD and the Histogram is
|
||||
called Signal and Histogram. The Signal is an EMA of MACD and the Histogram is
|
||||
the difference of MACD and Signal.
|
||||
|
||||
Sources:
|
||||
@@ -109,10 +109,10 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
fast (int): The short period. Default: 12
|
||||
slow (int): The long period. Default: 26
|
||||
signal (int): The signal period. Default: 9
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
fast (int): The short period. Default: 12
|
||||
slow (int): The long period. Default: 26
|
||||
signal (int): The signal period. Default: 9
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -45,8 +45,8 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -57,8 +57,8 @@ Args:
|
||||
high (pd.Series): Series of 'high's
|
||||
low (pd.Series): Series of 'low's
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 14
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 14
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -78,11 +78,11 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close(pandas.Series): Series of 'close's
|
||||
fast(int): The short period. Default: 12
|
||||
slow(int): The long period. Default: 26
|
||||
signal(int): The signal period. Default: 9
|
||||
scalar (float): How much to magnify. Default: 100
|
||||
offset(int): How many periods to offset the result. Default: 0
|
||||
fast(int): The short period. Default: 12
|
||||
slow(int): The long period. Default: 26
|
||||
signal(int): The signal period. Default: 9
|
||||
scalar (float): How much to magnify. Default: 100
|
||||
offset(int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -71,10 +71,10 @@ Calculation:
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
open_ (pd.Series, optional): Series of 'open's
|
||||
length (int): It's period. Default: 12
|
||||
scalar (float): How much to magnify. Default: 100
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 12
|
||||
scalar (float): How much to magnify. Default: 100
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -76,11 +76,11 @@ Calculation:
|
||||
|
||||
Args:
|
||||
volume (pd.Series): Series of 'volume's
|
||||
fast (int): The short period. Default: 12
|
||||
slow (int): The long period. Default: 26
|
||||
signal (int): The signal period. Default: 9
|
||||
scalar (float): How much to magnify. Default: 100
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
fast (int): The short period. Default: 12
|
||||
slow (int): The long period. Default: 26
|
||||
signal (int): The signal period. Default: 9
|
||||
scalar (float): How much to magnify. Default: 100
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -131,7 +131,6 @@ Sources:
|
||||
https://www.tradingview.com/script/IYfA9R2k-QQE-MT4/
|
||||
https://www.tradingpedia.com/forex-trading-indicators/quantitative-qualitative-estimation
|
||||
https://www.prorealcode.com/prorealtime-indicators/qqe-quantitative-qualitative-estimation/
|
||||
|
||||
|
||||
Calculation:
|
||||
Default Inputs:
|
||||
@@ -142,7 +141,8 @@ Args:
|
||||
length (int): RSI period. Default: 14
|
||||
smooth (int): RSI smoothing period. Default: 5
|
||||
factor (float): QQE Factor. Default: 4.236
|
||||
mamode (str): Smoothing MA type: "ema", "hma", "rma", "sma" or "wma". Default: "ema"
|
||||
mamode (str): Smoothing MA type: "ema", "hma", "rma", "sma" or "wma".
|
||||
Default: "ema"
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
|
||||
@@ -48,8 +48,8 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -74,9 +74,9 @@ Args:
|
||||
high (pd.Series): Series of 'high's
|
||||
low (pd.Series): Series of 'low's
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 14
|
||||
swma_length (int): It's period. Default: 4
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 14
|
||||
swma_length (int): It's period. Default: 4
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -39,7 +39,8 @@ def slope( close, length=None, as_angle=None, to_degrees=None, vertical=None, of
|
||||
slope.__doc__ = \
|
||||
"""Slope
|
||||
|
||||
Returns the slope of a series of length n. Can convert the slope to angle. Default: slope.
|
||||
Returns the slope of a series of length n. Can convert the slope to angle.
|
||||
Default: slope.
|
||||
|
||||
Sources: Algebra I
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ Args:
|
||||
mom_length (int): Momentum Period. Default: 12
|
||||
mom_smooth (int): Smoothing Period of Momentum. Default: 6
|
||||
mamode (str): Only "ema" or "sma". Default: "sma"
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
tr (value, optional): Use True Range for Keltner Channels. Default: True
|
||||
|
||||
@@ -88,7 +88,7 @@ Args:
|
||||
k (int): The Fast %K period. Default: 14
|
||||
d (int): The Slow %K period. Default: 3
|
||||
smooth_k (int): The Slow %D period. Default: 3
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -90,7 +90,7 @@ Args:
|
||||
rsi_length (int): RSI period. Default: 14
|
||||
k (int): The Fast %K period. Default: 3
|
||||
d (int): The Slow %K period. Default: 3
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -68,11 +68,11 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 18
|
||||
signal (int): It's period. Default: 9
|
||||
scalar (float): How much to magnify. Default: 100
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 18
|
||||
signal (int): It's period. Default: 9
|
||||
scalar (float): How much to magnify. Default: 100
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -73,7 +73,7 @@ Args:
|
||||
slow (int): The long period. Default: 25
|
||||
scalar (float): How much to magnify. Default: 100
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -90,14 +90,14 @@ Args:
|
||||
high (pd.Series): Series of 'high's
|
||||
low (pd.Series): Series of 'low's
|
||||
close (pd.Series): Series of 'close's
|
||||
fast (int): The Fast %K period. Default: 7
|
||||
medium (int): The Slow %K period. Default: 14
|
||||
slow (int): The Slow %D period. Default: 28
|
||||
fast_w (float): The Fast %K period. Default: 4.0
|
||||
medium_w (float): The Slow %K period. Default: 2.0
|
||||
slow_w (float): The Slow %D period. Default: 1.0
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
fast (int): The Fast %K period. Default: 7
|
||||
medium (int): The Slow %K period. Default: 14
|
||||
slow (int): The Slow %D period. Default: 28
|
||||
fast_w (float): The Fast %K period. Default: 4.0
|
||||
medium_w (float): The Slow %K period. Default: 2.0
|
||||
slow_w (float): The Slow %D period. Default: 1.0
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -56,8 +56,8 @@ Args:
|
||||
high (pd.Series): Series of 'high's
|
||||
low (pd.Series): Series of 'low's
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 14
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 14
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -15,7 +15,7 @@ def alma(close, length=None, sigma=None, distribution_offset=None, offset=None,
|
||||
offset = get_offset(offset)
|
||||
|
||||
# Pre-Calculations
|
||||
m = (distribution_offset * (length - 1))
|
||||
m = distribution_offset * (length - 1)
|
||||
s = length / sigma
|
||||
wtd = list(range(length))
|
||||
for i in range(0, length):
|
||||
@@ -31,6 +31,7 @@ def alma(close, length=None, sigma=None, distribution_offset=None, offset=None,
|
||||
window_sum = window_sum + wtd[j] * close[i - j]
|
||||
cum_sum = cum_sum + wtd[j]
|
||||
almean = window_sum / cum_sum
|
||||
|
||||
if i == length:
|
||||
result.append(npNaN) # additional one bar NaN as pre-roll
|
||||
else:
|
||||
@@ -76,10 +77,9 @@ Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period, window size. Default: 10
|
||||
sigma (float): Smoothing value. Default 6.0
|
||||
distribution_offset (float):
|
||||
Value to offset the distribution min 0 (smoother),
|
||||
max 1 (more responsive). Default 0.85
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
distribution_offset (float): Value to offset the distribution min 0
|
||||
(smoother), max 1 (more responsive). Default 0.85
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -46,8 +46,8 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 10
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 10
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -55,8 +55,8 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 10
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 10
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
adjust (bool, optional): Default: False
|
||||
|
||||
@@ -47,9 +47,9 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 10
|
||||
asc (bool): Recent values weigh more. Default: True
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 10
|
||||
asc (bool): Recent values weigh more. Default: True
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -113,8 +113,8 @@ Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
high_length (int): It's period. Default: 13
|
||||
low_length (int): It's period. Default: 21
|
||||
mamode (str): Options: 'sma' or 'ema'. Default: 'sma'
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
mamode (str): Options: 'sma' or 'ema'. Default: 'sma'
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
adjust (bool): Default: True
|
||||
|
||||
@@ -52,8 +52,8 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 10
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 10
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
+13
-13
@@ -7,19 +7,18 @@ def hwma(close, na=None, nb=None, nc=None, offset=None, **kwargs):
|
||||
"""Indicator: Holt-Winter Moving Average"""
|
||||
# Validate Arguments
|
||||
close = verify_series(close)
|
||||
na = float(na) if na and na > 0 else 0.2
|
||||
nb = float(nb) if nb and nb > 0 else 0.1
|
||||
nc = float(nc) if nc and nc > 0 else 0.1
|
||||
na = float(na) if na and na > 0 and na < 1 else 0.2
|
||||
nb = float(nb) if nb and nb > 0 and nb < 1 else 0.1
|
||||
nc = float(nc) if nc and nc > 0 and nc < 1 else 0.1
|
||||
offset = get_offset(offset)
|
||||
|
||||
# Initialize ..
|
||||
m = close.size
|
||||
last_f = close[0]
|
||||
# last_a, last_v = 0, 0
|
||||
last_a = last_v = 0
|
||||
result = []
|
||||
|
||||
# Calculate ..
|
||||
# Calculate Result
|
||||
last_a = last_v = 0
|
||||
last_f = close[0]
|
||||
|
||||
result = []
|
||||
m = close.size
|
||||
for i in range(m):
|
||||
F = (1.0 - na) * (last_f + last_v + 0.5 * last_a) + na * close[i]
|
||||
V = (1.0 - nb) * (last_v + last_a) + nb * (F - last_f)
|
||||
@@ -70,9 +69,10 @@ Calculation:
|
||||
A[i] = (1-nc) * A[i-1] + nc * (V[i] - V[i-1])
|
||||
|
||||
Args:
|
||||
na - parameter of the equation that describes a smoothed series (from 0 to 1)
|
||||
nb - parameter of the equation to assess the trend (from 0 to 1)
|
||||
nc - parameter of the equation to assess seasonality (from 0 to 1)
|
||||
close (pd.Series): Series of 'close's
|
||||
na (float): Smoothed series parameter (from 0 to 1). Default: 0.2
|
||||
nb (float): Trend parameter (from 0 to 1). Default: 0.1
|
||||
nc (float): Seasonality parameter (from 0 to 1). Default: 0.1
|
||||
close (pd.Series): Series of 'close's
|
||||
|
||||
Kwargs:
|
||||
|
||||
@@ -115,10 +115,10 @@ Args:
|
||||
high (pd.Series): Series of 'high's
|
||||
low (pd.Series): Series of 'low's
|
||||
close (pd.Series): Series of 'close's
|
||||
tenkan (int): Tenkan period. Default: 9
|
||||
kijun (int): Kijun period. Default: 26
|
||||
senkou (int): Senkou period. Default: 52
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
tenkan (int): Tenkan period. Default: 9
|
||||
kijun (int): Kijun period. Default: 26
|
||||
senkou (int): Senkou period. Default: 52
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -66,11 +66,11 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 10
|
||||
fast (int): Fast MA period. Default: 2
|
||||
slow (int): Slow MA period. Default: 30
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 10
|
||||
fast (int): Fast MA period. Default: 2
|
||||
slow (int): Slow MA period. Default: 30
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -105,12 +105,16 @@ Args:
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
angle (bool, optional): If True, returns the angle of the slope in radians. Default: False.
|
||||
degrees (bool, optional): If True, returns the angle of the slope in degrees. Default: False.
|
||||
intercept (bool, optional): If True, returns the angle of the slope in radians. Default: False.
|
||||
r (bool, optional): If True, returns it's correlation 'r'. Default: False.
|
||||
angle (bool, optional): If True, returns the angle of the slope in radians.
|
||||
Default: False.
|
||||
degrees (bool, optional): If True, returns the angle of the slope in
|
||||
degrees. Default: False.
|
||||
intercept (bool, optional): If True, returns the angle of the slope in
|
||||
radians. Default: False.
|
||||
r (bool, optional): If True, returns it's correlation 'r'. Default: False.
|
||||
slope (bool, optional): If True, returns the slope. Default: False.
|
||||
tsf (bool, optional): If True, returns the Time Series Forecast value. Default: False.
|
||||
tsf (bool, optional): If True, returns the Time Series Forecast value.
|
||||
Default: False.
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
fill_method (value, optional): Type of fill method
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@ def pwma(close, length=None, asc=None, offset=None, **kwargs):
|
||||
pwma.__doc__ = \
|
||||
"""Pascal's Weighted Moving Average (PWMA)
|
||||
|
||||
Pascal's Weighted Moving Average is similar to a symmetric triangular
|
||||
window except PWMA's weights are based on Pascal's Triangle.
|
||||
Pascal's Weighted Moving Average is similar to a symmetric triangular window
|
||||
except PWMA's weights are based on Pascal's Triangle.
|
||||
|
||||
Source: Kevin Johnson
|
||||
|
||||
@@ -49,8 +49,8 @@ Calculation:
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 10
|
||||
asc (bool): Recent values weigh more. Default: True
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
asc (bool): Recent values weigh more. Default: True
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -27,7 +27,8 @@ def rma(close, length=None, offset=None, **kwargs):
|
||||
rma.__doc__ = \
|
||||
"""wildeR's Moving Average (RMA)
|
||||
|
||||
The WildeR's Moving Average is simply an Exponential Moving Average (EMA) with a modified alpha = 1 / length.
|
||||
The WildeR's Moving Average is simply an Exponential Moving Average (EMA) with
|
||||
a modified alpha = 1 / length.
|
||||
|
||||
Sources:
|
||||
https://tlc.thinkorswim.com/center/reference/Tech-Indicators/studies-library/V-Z/WildersSmoothing
|
||||
@@ -42,8 +43,8 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 10
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 10
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -32,8 +32,8 @@ def sinwma(close, length=None, offset=None, **kwargs):
|
||||
sinwma.__doc__ = \
|
||||
"""Sine Weighted Moving Average (SWMA)
|
||||
|
||||
A weighted average using sine cycles. The middle term(s) of the average have the highest
|
||||
weight(s).
|
||||
A weighted average using sine cycles. The middle term(s) of the average have the
|
||||
highest weight(s).
|
||||
|
||||
Source:
|
||||
https://www.tradingview.com/script/6MWFvnPO-Sine-Weighted-Moving-Average/
|
||||
@@ -54,8 +54,8 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 10
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 10
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -46,8 +46,8 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 10
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 10
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
adjust (bool): Default: True
|
||||
|
||||
@@ -109,8 +109,9 @@ Args:
|
||||
low (pd.Series): Series of 'low's
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int) : length for ATR calculation. Default: 7
|
||||
multiplier (float): Coefficient for upper and lower band distance to midrange. Default: 3.0
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
multiplier (float): Coefficient for upper and lower band distance to
|
||||
midrange. Default: 3.0
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -31,8 +31,9 @@ swma.__doc__ = \
|
||||
"""Symmetric Weighted Moving Average (SWMA)
|
||||
|
||||
Symmetric Weighted Moving Average where weights are based on a symmetric
|
||||
triangle. For example: n=3 -> [1, 2, 1], n=4 -> [1, 2, 2, 1], etc... This moving
|
||||
average has variable length in contrast to TradingView's fixed length of 4.
|
||||
triangle. For example: n=3 -> [1, 2, 1], n=4 -> [1, 2, 2, 1], etc...
|
||||
This moving average has variable length in contrast to TradingView's fixed
|
||||
length of 4.
|
||||
|
||||
Source:
|
||||
https://www.tradingview.com/study-script-reference/#fun_swma
|
||||
@@ -51,9 +52,9 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 10
|
||||
asc (bool): Recent values weigh more. Default: True
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 10
|
||||
asc (bool): Recent values weigh more. Default: True
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -62,9 +62,9 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 10
|
||||
a (float): 0 < a < 1. Default: 0.7
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 10
|
||||
a (float): 0 < a < 1. Default: 0.7
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
adjust (bool): Default: True
|
||||
|
||||
@@ -46,8 +46,8 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 10
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 10
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
adjust (bool): Default: True
|
||||
|
||||
@@ -47,8 +47,8 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 10
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 10
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
adjust (bool): Default: True
|
||||
|
||||
@@ -44,8 +44,8 @@ Calculation:
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
volume (pd.Series): Series of 'volume's
|
||||
length (int): It's period. Default: 10
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 10
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -40,7 +40,7 @@ Args:
|
||||
high (pd.Series): Series of 'high's
|
||||
low (pd.Series): Series of 'low's
|
||||
close (pd.Series): Series of 'close's
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -62,9 +62,9 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 10
|
||||
asc (bool): Recent values weigh more. Default: True
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 10
|
||||
asc (bool): Recent values weigh more. Default: True
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -60,9 +60,9 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 10
|
||||
mamode (str): Options: 'ema', 'hma', 'sma', 'wma'. Default: 'ema'
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 10
|
||||
mamode (str): Options: 'ema', 'hma', 'sma', 'wma'. Default: 'ema'
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -50,9 +50,9 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 20
|
||||
cumulative (bool): If True, returns the cumulative returns. Default: False
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 20
|
||||
cumulative (bool): If True, returns the cumulative returns. Default: False
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -43,9 +43,9 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 20
|
||||
cumulative (bool): If True, returns the cumulative returns. Default: False
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 20
|
||||
cumulative (bool): If True, returns the cumulative returns. Default: False
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -27,7 +27,7 @@ def median(close, length=None, offset=None, **kwargs):
|
||||
median.__doc__ = \
|
||||
"""Rolling Median
|
||||
|
||||
Rolling Median of over 'n' periods. Sibling of a Simple Moving Average.
|
||||
Rolling Median of over 'n' periods. Sibling of a Simple Moving Average.
|
||||
|
||||
Sources:
|
||||
https://www.incrediblecharts.com/indicators/median_price.php
|
||||
|
||||
@@ -71,11 +71,11 @@ Args:
|
||||
high (pd.Series): Series of 'high's
|
||||
low (pd.Series): Series of 'low's
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 14
|
||||
atr_length (int): Length for ATR. Default: 1
|
||||
scalar (float): How much to magnify. Default: 100
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 14
|
||||
atr_length (int): Length for ATR. Default: 1
|
||||
scalar (float): How much to magnify. Default: 100
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -75,10 +75,10 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
p (int): ATR and first stop period. Default: 10
|
||||
x (float): ATR scalar. Default: 1
|
||||
q (int): Second stop period. Default: 9
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
p (int): ATR and first stop period. Default: 10
|
||||
x (float): ATR scalar. Default: 1
|
||||
q (int): Second stop period. Default: 9
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -46,7 +46,10 @@ def decreasing(close, length=None, strict=None, asint=None, offset=None, **kwarg
|
||||
decreasing.__doc__ = \
|
||||
"""Decreasing
|
||||
|
||||
Returns True if the series is decreasing over a period, False otherwise. If the kwarg 'strict' is True, it returns True if it is continuously decreasing over the period. When using the kwarg 'asint', then it returns 1 for True or 0 for False.
|
||||
Returns True if the series is decreasing over a period, False otherwise.
|
||||
If the kwarg 'strict' is True, it returns True if it is continuously decreasing
|
||||
over the period. When using the kwarg 'asint', then it returns 1 for True
|
||||
or 0 for False.
|
||||
|
||||
Calculation:
|
||||
if strict:
|
||||
|
||||
@@ -58,9 +58,9 @@ Calculation:
|
||||
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 1
|
||||
centered (bool): Shift the dpo back by int(0.5 * length) + 1. Default: True
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 1
|
||||
centered (bool): Shift the dpo back by int(0.5 * length) + 1. Default: True
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -46,7 +46,10 @@ def increasing(close, length=None, strict=None, asint=None, offset=None, **kwarg
|
||||
increasing.__doc__ = \
|
||||
"""Increasing
|
||||
|
||||
Returns True if the series is increasing over a period, False otherwise. If the kwarg 'strict' is True, it returns True if it is continuously increasing over the period. When using the kwarg 'asint', then it returns 1 for True or 0 for False.
|
||||
Returns True if the series is increasing over a period, False otherwise.
|
||||
If the kwarg 'strict' is True, it returns True if it is continuously increasing
|
||||
over the period. When using the kwarg 'asint', then it returns 1 for True
|
||||
or 0 for False.
|
||||
|
||||
Calculation:
|
||||
if strict:
|
||||
|
||||
@@ -128,9 +128,9 @@ Args:
|
||||
high (pd.Series): Series of 'high's
|
||||
low (pd.Series): Series of 'low's
|
||||
close (pd.Series, optional): Series of 'close's. Optional
|
||||
af (float): Acceleration Factor. Default: 0.02
|
||||
max_af (float): Maximum Acceleration Factor. Default: 0.2
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
af (float): Acceleration Factor. Default: 0.02
|
||||
max_af (float): Maximum Acceleration Factor. Default: 0.2
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -46,8 +46,8 @@ def qstick(open_, close, length=None, offset=None, **kwargs):
|
||||
qstick.__doc__ = \
|
||||
"""Q Stick
|
||||
|
||||
The Q Stick indicator, developed by Tushar Chande, attempts to quantify and identify
|
||||
trends in candlestick charts.
|
||||
The Q Stick indicator, developed by Tushar Chande, attempts to quantify and
|
||||
identify trends in candlestick charts.
|
||||
|
||||
Sources:
|
||||
https://library.tradingtechnologies.com/trade/chrt-ti-qstick.html
|
||||
@@ -61,9 +61,9 @@ Calculation:
|
||||
Args:
|
||||
open (pd.Series): Series of 'open's
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 1
|
||||
ma (str): The type of moving average to use. Default: None, which is 'sma'
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 1
|
||||
ma (str): The type of moving average to use. Default: None, which is 'sma'
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -72,8 +72,8 @@ Args:
|
||||
high (pd.Series): Series of 'high's
|
||||
low (pd.Series): Series of 'low's
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 6
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 6
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
fill_method (value, optional): Type of fill method
|
||||
|
||||
@@ -78,9 +78,9 @@ Args:
|
||||
high (pd.Series): Series of 'high's
|
||||
low (pd.Series): Series of 'low's
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): ROC 1 period. Default: 14
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): ROC 1 period. Default: 14
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -86,9 +86,9 @@ Args:
|
||||
high (pd.Series): Series of 'high's
|
||||
low (pd.Series): Series of 'low's
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): The short period. Default: 5
|
||||
atr_length (int): The short period. Default: 15
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): The short period. Default: 5
|
||||
atr_length (int): The short period. Default: 15
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -89,11 +89,11 @@ Args:
|
||||
high (pd.Series): Series of 'high's
|
||||
low (pd.Series): Series of 'low's
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 10
|
||||
c (int): Multiplier. Default: 4
|
||||
mamode (str): Two options: None or 'ema'. Default: 'ema'
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): It's period. Default: 10
|
||||
c (int): Multiplier. Default: 4
|
||||
mamode (str): Two options: None or 'ema'. Default: 'ema'
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -43,8 +43,8 @@ def atr(high, low, close, length=None, mamode=None, drift=None, offset=None, **k
|
||||
atr.__doc__ = \
|
||||
"""Average True Range (ATR)
|
||||
|
||||
Averge True Range is used to measure volatility, especially
|
||||
volatility caused by gaps or limit moves.
|
||||
Averge True Range is used to measure volatility, especially volatility caused by
|
||||
gaps or limit moves.
|
||||
|
||||
Sources:
|
||||
https://www.tradingview.com/wiki/Average_True_Range_(ATR)
|
||||
|
||||
@@ -31,7 +31,6 @@ def hwc(close, na=None, nb=None, nc=None, nd=None, scalar=None, channel_eval=Non
|
||||
chan_width = []
|
||||
chan_pct_width = []
|
||||
|
||||
print(channel_eval)
|
||||
# Calculate ..
|
||||
for i in range(m):
|
||||
F = (1.0 - na) * (last_f + last_v + 0.5 * last_a) + na * close[i]
|
||||
@@ -125,10 +124,12 @@ def hwc(close, na=None, nb=None, nc=None, nd=None, scalar=None, channel_eval=Non
|
||||
hwc.__doc__ = \
|
||||
"""HWC (Holt-Winter Channel)
|
||||
|
||||
Channel indicator HWC (Holt-Winters Channel) based on HWMA - a three-parameter moving average
|
||||
calculated by the method of Holt-Winters.
|
||||
This version has been implemented for Pandas TA by rengel8 based on a publication for MetaTrader 5
|
||||
extended by width and percentage price position against width of channel.
|
||||
Channel indicator HWC (Holt-Winters Channel) based on HWMA - a three-parameter
|
||||
moving average calculated by the method of Holt-Winters.
|
||||
|
||||
This version has been implemented for Pandas TA by rengel8 based on a
|
||||
publication for MetaTrader 5 extended by width and percentage price position
|
||||
against width of channel.
|
||||
|
||||
Sources:
|
||||
https://www.mql5.com/en/code/20857
|
||||
@@ -139,7 +140,7 @@ Calculation:
|
||||
F[i] = (1-na) * (F[i-1] + V[i-1] + 0.5 * A[i-1]) + na * Price[i]
|
||||
V[i] = (1-nb) * (V[i-1] + A[i-1]) + nb * (F[i] - F[i-1])
|
||||
A[i] = (1-nc) * A[i-1] + nc * (V[i] - V[i-1])
|
||||
|
||||
|
||||
Top = HWMA + Multiplier * StDt
|
||||
Bottom = HWMA - Multiplier * StDt
|
||||
where..
|
||||
@@ -152,7 +153,7 @@ Args:
|
||||
nc - parameter of the equation to assess seasonality (from 0 to 1)
|
||||
nd - parameter of the channel equation (from 0 to 1)
|
||||
scaler - multiplier for the width of the channel calculated
|
||||
channel_eval - boolean to return width and percentage price position against price
|
||||
channel_eval - boolean to return width and percentage price position against price
|
||||
close (pd.Series): Series of 'close's
|
||||
|
||||
Kwargs:
|
||||
|
||||
@@ -63,9 +63,9 @@ Calculation:
|
||||
Args:
|
||||
high (pd.Series): Series of 'high's
|
||||
low (pd.Series): Series of 'low's
|
||||
fast (int): The short period. Default: 9
|
||||
slow (int): The long period. Default: 25
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
fast (int): The short period. Default: 9
|
||||
slow (int): The long period. Default: 25
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -39,8 +39,7 @@ def natr(high, low, close, length=None, mamode=None, scalar=None, drift=None, of
|
||||
natr.__doc__ = \
|
||||
"""Normalized Average True Range (NATR)
|
||||
|
||||
Normalized Average True Range attempt to normalize the average
|
||||
true range.
|
||||
Normalized Average True Range attempt to normalize the average true range.
|
||||
|
||||
Sources:
|
||||
https://www.tradingtechnologies.com/help/x-study/technical-indicator-definitions/normalized-average-true-range-natr/
|
||||
@@ -55,9 +54,9 @@ Args:
|
||||
high (pd.Series): Series of 'high's
|
||||
low (pd.Series): Series of 'low's
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): The short period. Default: 20
|
||||
scalar (float): How much to magnify. Default: 100
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): The short period. Default: 20
|
||||
scalar (float): How much to magnify. Default: 100
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -47,8 +47,8 @@ Args:
|
||||
high (pd.Series): Series of 'high's
|
||||
low (pd.Series): Series of 'low's
|
||||
close (pd.Series): Series of 'close's
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -72,10 +72,9 @@ def rvi(close, high=None, low=None, length=None, scalar=None, refined=None, thir
|
||||
rvi.__doc__ = \
|
||||
"""Relative Volatility Index (RVI)
|
||||
|
||||
The Relative Volatility Index (RVI) was created in 1993 and
|
||||
revised in 1995. Instead of adding up price changes like RSI
|
||||
based on price direction, the RVI adds up standard deviations
|
||||
based on price direction.
|
||||
The Relative Volatility Index (RVI) was created in 1993 and revised in 1995.
|
||||
Instead of adding up price changes like RSI based on price direction, the RVI
|
||||
adds up standard deviations based on price direction.
|
||||
|
||||
Sources:
|
||||
https://www.tradingview.com/wiki/Keltner_Channels_(KC)
|
||||
@@ -99,12 +98,12 @@ Args:
|
||||
low (pd.Series): Series of 'low's
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): The short period. Default: 14
|
||||
scalar (float): A positive float to scale the bands. Default: 100
|
||||
scalar (float): A positive float to scale the bands. Default: 100
|
||||
mamode (str): Options: 'sma' or 'ema'. Default: 'sma'
|
||||
refined (bool): Use 'refined' calculation which is the average of
|
||||
RVI(high) and RVI(low) instead of RVI(close). Default: False
|
||||
thirds (bool): Average of high, low and close. Default: False
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -34,7 +34,7 @@ def thermo(high, low, length=None, long=None, short=None, mamode=None, drift=Non
|
||||
|
||||
# Binary output, useful for signals
|
||||
if asint:
|
||||
thermo_long = thermo_long.astype(int)
|
||||
thermo_long = thermo_long.astype(int)
|
||||
thermo_short = thermo_short.astype(int)
|
||||
|
||||
# Offset
|
||||
@@ -66,7 +66,12 @@ def thermo(high, low, length=None, long=None, short=None, mamode=None, drift=Non
|
||||
thermo.category = thermo_ma.category = thermo_long.category = thermo_short.category = "volatility"
|
||||
|
||||
# Prepare Dataframe to return
|
||||
data = {thermo.name: thermo, thermo_ma.name: thermo_ma, thermo_long.name: thermo_long, thermo_short.name: thermo_short}
|
||||
data = {
|
||||
thermo.name: thermo,
|
||||
thermo_ma.name: thermo_ma,
|
||||
thermo_long.name: thermo_long,
|
||||
thermo_short.name: thermo_short
|
||||
}
|
||||
df = DataFrame(data)
|
||||
df.name = f"THERMO{_props}"
|
||||
df.category = thermo.category
|
||||
|
||||
@@ -56,8 +56,8 @@ Args:
|
||||
high (pd.Series): Series of 'high's
|
||||
low (pd.Series): Series of 'low's
|
||||
close (pd.Series): Series of 'close's
|
||||
drift (int): The shift period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
drift (int): The shift period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -65,7 +65,7 @@ Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
volume (pd.Series): Series of 'volume's
|
||||
open (pd.Series): Series of 'open's
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -63,9 +63,9 @@ Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
open (pd.Series): Series of 'open's
|
||||
volume (pd.Series): Series of 'volume's
|
||||
fast (int): The short period. Default: 12
|
||||
slow (int): The long period. Default: 26
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
fast (int): The short period. Default: 12
|
||||
slow (int): The long period. Default: 26
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -70,8 +70,8 @@ Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
volume (pd.Series): Series of 'volume's
|
||||
open_ (pd.Series): Series of 'open's. Default: None
|
||||
length (int): The short period. Default: 20
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): The short period. Default: 20
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -59,10 +59,10 @@ Calculation:
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
volume (pd.Series): Series of 'volume's
|
||||
length (int): The short period. Default: 13
|
||||
drift (int): The diff period. Default: 1
|
||||
mamode (str): Two options: None or "sma". Default: None
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): The short period. Default: 13
|
||||
drift (int): The diff period. Default: 1
|
||||
mamode (str): Two options: None or "sma". Default: None
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -67,9 +67,9 @@ Args:
|
||||
low (pd.Series): Series of 'low's
|
||||
close (pd.Series): Series of 'close's
|
||||
volume (pd.Series): Series of 'volume's
|
||||
length (int): The short period. Default: 14
|
||||
drift (int): The diff period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): The short period. Default: 14
|
||||
drift (int): The diff period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -76,9 +76,9 @@ Args:
|
||||
low (pd.Series): Series of 'low's
|
||||
close (pd.Series): Series of 'close's
|
||||
volume (pd.Series): Series of 'volume's
|
||||
length (int): The sum period. Default: 14
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): The sum period. Default: 14
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -63,9 +63,9 @@ Calculation:
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
volume (pd.Series): Series of 'volume's
|
||||
length (int): The short period. Default: 13
|
||||
initial (int): The short period. Default: 1000
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): The short period. Default: 13
|
||||
initial (int): The short period. Default: 1000
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -48,7 +48,7 @@ Calculation:
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
volume (pd.Series): Series of 'volume's
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -42,7 +42,8 @@ pvi.__doc__ = \
|
||||
"""Positive Volume Index (PVI)
|
||||
|
||||
The Positive Volume Index is a cumulative indicator that uses volume change in
|
||||
an attempt to identify where smart money is active. Used in conjunction with NVI.
|
||||
an attempt to identify where smart money is active.
|
||||
Used in conjunction with NVI.
|
||||
|
||||
Sources:
|
||||
https://www.investopedia.com/terms/p/pvi.asp
|
||||
@@ -62,9 +63,9 @@ Calculation:
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
volume (pd.Series): Series of 'volume's
|
||||
length (int): The short period. Default: 13
|
||||
initial (int): The short period. Default: 1000
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
length (int): The short period. Default: 13
|
||||
initial (int): The short period. Default: 1000
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -47,8 +47,8 @@ Calculation:
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
volume (pd.Series): Series of 'volume's
|
||||
signed (bool): Keeps the sign of the difference in 'close's. Default: True
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
signed (bool): Keeps the sign of the difference in 'close's. Default: True
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -51,8 +51,8 @@ Calculation:
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
volume (pd.Series): Series of 'volume's
|
||||
drift (int): The diff period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
drift (int): The diff period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
|
||||
@@ -63,7 +63,8 @@ def vp(close, volume, width=None, **kwargs):
|
||||
vp.__doc__ = \
|
||||
"""Volume Profile (VP)
|
||||
|
||||
Calculates the Volume Profile by slicing price into ranges. Note: Value Area is not calculated.
|
||||
Calculates the Volume Profile by slicing price into ranges.
|
||||
Note: Value Area is not calculated.
|
||||
|
||||
Sources:
|
||||
https://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:volume_by_price
|
||||
@@ -89,7 +90,8 @@ Args:
|
||||
Kwargs:
|
||||
fillna (value, optional): pd.DataFrame.fillna(value)
|
||||
fill_method (value, optional): Type of fill method
|
||||
sort_close (value, optional): Whether to sort by close before splitting into ranges. Default: False
|
||||
sort_close (value, optional): Whether to sort by close before splitting
|
||||
into ranges. Default: False
|
||||
|
||||
Returns:
|
||||
pd.DataFrame: New feature generated.
|
||||
|
||||
@@ -18,7 +18,7 @@ setup(
|
||||
"pandas_ta.volatility",
|
||||
"pandas_ta.volume"
|
||||
],
|
||||
version=".".join(("0", "2", "44b")),
|
||||
version=".".join(("0", "2", "45b")),
|
||||
description=long_description,
|
||||
long_description=long_description,
|
||||
author="Kevin Johnson",
|
||||
|
||||
@@ -89,7 +89,6 @@ class TestStrategyMethods(TestCase):
|
||||
def test_cycles_category(self):
|
||||
self.category = "Cycles"
|
||||
self.data.ta.strategy(self.category, verbose=verbose, timed=strategy_timed)
|
||||
print(f"\n{self.data}")
|
||||
|
||||
# @skip
|
||||
def test_custom_a(self):
|
||||
|
||||
Reference in New Issue
Block a user