mirror of
https://github.com/wassname/pandas-ta.git
synced 2026-08-13 12:30:58 +08:00
docstring google format compliance
This commit is contained in:
@@ -33,14 +33,17 @@ def cdl_pattern(
|
||||
|
||||
Examples:
|
||||
|
||||
Get all candle patterns (This is the default behaviour)
|
||||
>>> df = df.ta.cdl_pattern(name="all")
|
||||
Get all candle patterns (This is the default behaviour)::
|
||||
|
||||
Get only one pattern
|
||||
>>> df = df.ta.cdl_pattern(name="doji")
|
||||
df = df.ta.cdl_pattern(name="all")
|
||||
|
||||
Get some patterns
|
||||
>>> df = df.ta.cdl_pattern(name=["doji", "inside"])
|
||||
Get only one pattern::
|
||||
|
||||
df = df.ta.cdl_pattern(name="doji")
|
||||
|
||||
Get some patterns::
|
||||
|
||||
df = df.ta.cdl_pattern(name=["doji", "inside"])
|
||||
|
||||
Args:
|
||||
open_ (pd.Series): Series of 'open's
|
||||
|
||||
@@ -23,7 +23,7 @@ def apo(
|
||||
close (pd.Series): Series of 'close's
|
||||
fast (int): The short period. Default: 12
|
||||
slow (int): The long period. Default: 26
|
||||
mamode (str): See ```help(ta.ma)```. Default: 'sma'
|
||||
mamode (str): See ``help(ta.ma)``. Default: 'sma'
|
||||
talib (bool): If TA Lib is installed and talib is True, Returns the TA Lib
|
||||
version. Default: True
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
@@ -19,7 +19,7 @@ def bias(
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): The period. Default: 26
|
||||
mamode (str): See ```help(ta.ma)```. Default: 'sma'
|
||||
mamode (str): See ``help(ta.ma)``. Default: 'sma'
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
|
||||
@@ -23,7 +23,7 @@ def dm(
|
||||
Args:
|
||||
high (pd.Series): Series of 'high's
|
||||
low (pd.Series): Series of 'low's
|
||||
mamode (str): See ```help(ta.ma)```. Default: 'rma'
|
||||
mamode (str): See ``help(ta.ma)``. Default: 'rma'
|
||||
talib (bool): If TA Lib is installed and talib is True, Returns the TA Lib
|
||||
version. Default: True
|
||||
drift (int): The difference period. Default: 1
|
||||
|
||||
@@ -31,7 +31,7 @@ def inertia(
|
||||
rvi_length (int): RVI period. Default: 14
|
||||
refined (bool): Use 'refined' calculation. Default: False
|
||||
thirds (bool): Use 'thirds' calculation. Default: False
|
||||
mamode (str): See ```help(ta.ma)```. Default: 'ema'
|
||||
mamode (str): See ``help(ta.ma)``. Default: 'ema'
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ def ppo(
|
||||
slow(int): The long period. Default: 26
|
||||
signal(int): The signal period. Default: 9
|
||||
scalar (float): How much to magnify. Default: 100
|
||||
mamode (str): See ```help(ta.ma)```. Default: 'sma'
|
||||
mamode (str): See ``help(ta.ma)``. Default: 'sma'
|
||||
talib (bool): If TA Lib is installed and talib is True, Returns the TA Lib
|
||||
version. Default: True
|
||||
offset(int): How many periods to offset the result. Default: 0
|
||||
|
||||
@@ -28,7 +28,7 @@ def qqe(
|
||||
length (int): RSI period. Default: 14
|
||||
smooth (int): RSI smoothing period. Default: 5
|
||||
factor (float): QQE Factor. Default: 4.236
|
||||
mamode (str): See ```help(ta.ma)```. Default: 'sma'
|
||||
mamode (str): See ``help(ta.ma)``. Default: 'sma'
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ def stoch(
|
||||
k (int): The Fast %K period. Default: 14
|
||||
d (int): The Slow %D period. Default: 3
|
||||
smooth_k (int): The Slow %K period. Default: 3
|
||||
mamode (str): See ```help(ta.ma)```. Default: 'sma'
|
||||
mamode (str): See ``help(ta.ma)``. Default: 'sma'
|
||||
talib (bool): If TA Lib is installed and talib is True, Returns the TA Lib
|
||||
version. Default: True
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
@@ -26,7 +26,7 @@ def stochf(
|
||||
close (pd.Series): Series of 'close's
|
||||
k (int): The Fast %K period. Default: 14
|
||||
d (int): The Slow %D period. Default: 3
|
||||
mamode (str): See ```help(ta.ma)```. Default: 'sma'
|
||||
mamode (str): See ``help(ta.ma)``. Default: 'sma'
|
||||
talib (bool): If TA Lib is installed and talib is True, Returns the TA Lib
|
||||
version. Default: True
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
@@ -30,7 +30,7 @@ def stochrsi(
|
||||
rsi_length (int): RSI period. Default: 14
|
||||
k (int): The Fast %K period. Default: 3
|
||||
d (int): The Slow %K period. Default: 3
|
||||
mamode (str): See ```help(ta.ma)```. Default: 'sma'
|
||||
mamode (str): See ``help(ta.ma)``. Default: 'sma'
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
|
||||
@@ -26,7 +26,7 @@ def tsi(
|
||||
signal (int): The signal period. Default: 13
|
||||
scalar (float): How much to magnify. Default: 100
|
||||
mamode (str): Moving Average of TSI Signal Line.
|
||||
See ```help(ta.ma)```. Default: 'ema'
|
||||
See ``help(ta.ma)``. Default: 'ema'
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ def hilo(
|
||||
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): See ```help(ta.ma)```. Default: 'sma'
|
||||
mamode (str): See ``help(ta.ma)``. Default: 'sma'
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
|
||||
@@ -27,7 +27,7 @@ def kama(
|
||||
length (int): It's period. Default: 10
|
||||
fast (int): Fast MA period. Default: 2
|
||||
slow (int): Slow MA period. Default: 30
|
||||
mamode (str): See ```help(ta.ma)```. Valid MAs that support initialize
|
||||
mamode (str): See ``help(ta.ma)``. Valid MAs that support initialize
|
||||
the first value: 'ema', 'fwma', 'linreg', 'midpoint', 'pwma', 'rma',
|
||||
'sinwma', 'sma', 'swma', 'trima', 'wma'. Default: 'sma'
|
||||
drift (int): The difference period. Default: 1
|
||||
|
||||
@@ -28,7 +28,7 @@ def smma(
|
||||
Args:
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 10
|
||||
mamode (str): See ```help(ta.ma)```. Default: 'sma'
|
||||
mamode (str): See ``help(ta.ma)``. Default: 'sma'
|
||||
talib (bool): If TA Lib is installed and talib is True, Returns the TA Lib
|
||||
version. Default: True
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
@@ -27,7 +27,7 @@ def adx(
|
||||
length (int): It's period. Default: 14
|
||||
lensig (int): Signal Length. Like TradingView's default ADX. Default: length
|
||||
scalar (float): How much to magnify. Default: 100
|
||||
mamode (str): See ```help(ta.ma)```. Default: 'rma'
|
||||
mamode (str): See ``help(ta.ma)``. Default: 'rma'
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ def amat(
|
||||
"""Archer Moving Averages Trends (AMAT)
|
||||
|
||||
Archer Moving Averages Trends (AMAT) developed by Kevin Johnson provides
|
||||
creates both long run ```help(ta.long_run)``` and short run
|
||||
```help(ta.short_run)``` trend signals given two moving average speeds,
|
||||
creates both long run ``help(ta.long_run)`` and short run
|
||||
``help(ta.short_run)`` trend signals given two moving average speeds,
|
||||
fast and slow. The long runs and short runs are binary Series where '1' is
|
||||
a trend and '0' is not a trend.
|
||||
|
||||
@@ -27,7 +27,7 @@ def amat(
|
||||
fast (int): The period of the fast moving average. Default: 8
|
||||
slow (int): The period of the slow moving average. Default: 21
|
||||
lookback (int): Lookback period for long_run and short_run. Default: 2
|
||||
mamode (str): See ```help(ta.ma)```. Default: 'ema'
|
||||
mamode (str): See ``help(ta.ma)``. Default: 'ema'
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
|
||||
@@ -22,7 +22,7 @@ def long_run(
|
||||
signals.
|
||||
|
||||
Sources:
|
||||
It is part of the Converging and Diverging Conditional logic in:
|
||||
It is part of the Converging and Diverging Conditional logic in:
|
||||
https://www.tradingview.com/script/Z2mq63fE-Trade-Archer-Moving-Averages-v1-4F/
|
||||
|
||||
Args:
|
||||
|
||||
@@ -17,12 +17,12 @@ def short_run(
|
||||
|
||||
It is recommended to use 'smooth' signals for 'fast' and 'slow' for the
|
||||
comparison to reduce unnecessary noise. For indicators using long_run, see
|
||||
Archer Moving Average Trend (```help(ta.amat)```) and Archer On Balance
|
||||
Volume (```help(ta.aobv)```). Both use Moving Averages for 'fast' and 'slow'
|
||||
Archer Moving Average Trend (``help(ta.amat)``) and Archer On Balance
|
||||
Volume (``help(ta.aobv)``). Both use Moving Averages for 'fast' and 'slow'
|
||||
signals.
|
||||
|
||||
Sources:
|
||||
It is part of the Converging and Diverging Conditional logic in:
|
||||
It is part of the Converging and Diverging Conditional logic in:
|
||||
https://www.tradingview.com/script/Z2mq63fE-Trade-Archer-Moving-Averages-v1-4F/
|
||||
|
||||
Args:
|
||||
|
||||
@@ -19,10 +19,12 @@ def tsignals(
|
||||
whose values are boolean or integers (0 or 1).
|
||||
|
||||
Examples:
|
||||
ta.tsignals(close > ta.sma(close, 50), asbool=False)
|
||||
ta.tsignals(ta.ema(close, 8) > ta.ema(close, 21), asbool=True)
|
||||
ta.tsignals(close > ta.sma(close, 50), asbool=False)
|
||||
|
||||
Source: Kevin Johnson
|
||||
ta.tsignals(ta.ema(close, 8) > ta.ema(close, 21), asbool=True)
|
||||
|
||||
Source:
|
||||
Kevin Johnson
|
||||
|
||||
Args:
|
||||
trend (pd.Series): Series of 'trend's. The trend can be either a boolean or
|
||||
|
||||
@@ -29,15 +29,21 @@ def xsignals(
|
||||
False, it does the same but for the short side.
|
||||
|
||||
Example:
|
||||
# These are two different outcomes and depends on the indicator and it's
|
||||
# characteristics. Please check BOTH outcomes BEFORE making an Issue.
|
||||
rsi = df.ta.rsi()
|
||||
# Returns tsignal DataFrame when RSI crosses above 20 and then below 80
|
||||
ta.xsignals(rsi, 20, 80, above=True)
|
||||
# Returns tsignal DataFrame when RSI crosses below 20 and then above 80
|
||||
ta.xsignals(rsi, 20, 80, above=False)
|
||||
These are two different outcomes and depends on the indicator and it's
|
||||
characteristics. Please check BOTH outcomes BEFORE making an Issue::
|
||||
|
||||
rsi = df.ta.rsi()
|
||||
|
||||
Returns tsignal DataFrame when RSI crosses above 20 and then below 80::
|
||||
|
||||
Source: Kevin Johnson
|
||||
ta.xsignals(rsi, 20, 80, above=True)
|
||||
|
||||
Returns tsignal DataFrame when RSI crosses below 20 and then above 80::
|
||||
|
||||
ta.xsignals(rsi, 20, 80, above=False)
|
||||
|
||||
Source:
|
||||
Kevin Johnson
|
||||
|
||||
Args:
|
||||
signal (pd.Series): The Signal to compare from. Commonly the 'close'.
|
||||
|
||||
@@ -12,7 +12,7 @@ def polygon_api(ticker: str, **kwargs) -> DataFrame:
|
||||
It returns OCHLV data from polygon (requires a valid subscription of course). To install the
|
||||
`polygon library <https://github.com/pssolanki111/polygon>`__ , use
|
||||
``pip install polygon``.
|
||||
You can customize the range of data using kwargs ``from_date``, ``to_date````timespan`` and ``multiplier``. For a
|
||||
You can customize the range of data using kwargs ``from_date``, ``to_date``, ``timespan`` and ``multiplier``. For a
|
||||
description of these arguments, see
|
||||
`Here <https://polygon.readthedocs.io/en/latest/Stocks.html#get-aggregate-bars-candles>`__
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ def accbands(
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 10
|
||||
c (int): Multiplier. Default: 4
|
||||
mamode (str): See ```help(ta.ma)```. Default: 'sma'
|
||||
mamode (str): See ``help(ta.ma)``. Default: 'sma'
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ def atr(
|
||||
low (pd.Series): Series of 'low's
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): It's period. Default: 14
|
||||
mamode (str): See ```help(ta.ma)```. Default: 'rma'
|
||||
mamode (str): See ``help(ta.ma)``. Default: 'rma'
|
||||
talib (bool): If TA Lib is installed and talib is True, Returns the TA Lib
|
||||
version. Default: True
|
||||
drift (int): The difference period. Default: 1
|
||||
|
||||
@@ -23,7 +23,7 @@ def bbands(
|
||||
length (int): The short period. Default: 5
|
||||
std (int): The long period. Default: 2
|
||||
ddof (int): Degrees of Freedom to use. Default: 0
|
||||
mamode (str): See ```help(ta.ma)```. Default: 'sma'
|
||||
mamode (str): See ``help(ta.ma)``. Default: 'sma'
|
||||
talib (bool): If TA Lib is installed and talib is True, Returns the TA Lib
|
||||
version. Default: True
|
||||
ddof (int): Delta Degrees of Freedom.
|
||||
|
||||
@@ -24,7 +24,7 @@ def kc(
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): The short period. Default: 20
|
||||
scalar (float): A positive float to scale the bands. Default: 2
|
||||
mamode (str): See ```help(ta.ma)```. Default: 'ema'
|
||||
mamode (str): See ``help(ta.ma)``. Default: 'ema'
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
|
||||
@@ -24,7 +24,7 @@ def natr(
|
||||
close (pd.Series): Series of 'close's
|
||||
length (int): The short period. Default: 20
|
||||
scalar (float): How much to magnify. Default: 100
|
||||
mamode (str): See ```help(ta.ma)```. Default: 'ema'
|
||||
mamode (str): See ``help(ta.ma)``. Default: 'ema'
|
||||
talib (bool): If TA Lib is installed and talib is True, Returns the TA Lib
|
||||
version. Default: True
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
@@ -31,7 +31,7 @@ def rvi(
|
||||
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
|
||||
mamode (str): See ```help(ta.ma)```. Default: 'ema'
|
||||
mamode (str): See ``help(ta.ma)``. Default: 'ema'
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
|
||||
@@ -24,7 +24,7 @@ def thermo(
|
||||
length (int): The period. Default: 20
|
||||
long(int): The buy factor
|
||||
short(float): The sell factor
|
||||
mamode (str): See ```help(ta.ma)```. Default: 'ema'
|
||||
mamode (str): See ``help(ta.ma)``. Default: 'ema'
|
||||
drift (int): The diff period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ def aobv(
|
||||
Archer On Balance Volume (AOBV) developed by Kevin Johnson provides
|
||||
additional indicator analysis on OBV. It calculates moving averages, default
|
||||
'ema', of OBV as well as the moving average Long and Short Run Trends, see
|
||||
```help(ta.long_run)```. Lastly, the indicator also calculates the rolling
|
||||
``help(ta.long_run)``. Lastly, the indicator also calculates the rolling
|
||||
Maximum and Minimum OBV.
|
||||
|
||||
Sources:
|
||||
@@ -29,7 +29,7 @@ def aobv(
|
||||
slow (int): The period of the slow moving average. Default: 12
|
||||
max_lookback (int): Maximum OBV bars back. Default: 2
|
||||
min_lookback (int): Minimum OBV bars back. Default: 2
|
||||
mamode (str): See ```help(ta.ma)```. Default: 'ema'
|
||||
mamode (str): See ``help(ta.ma)``. Default: 'ema'
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
|
||||
@@ -23,7 +23,7 @@ def efi(
|
||||
volume (pd.Series): Series of 'volume's
|
||||
length (int): The short period. Default: 13
|
||||
drift (int): The diff period. Default: 1
|
||||
mamode (str): See ```help(ta.ma)```. Default: 'ema'
|
||||
mamode (str): See ``help(ta.ma)``. Default: 'ema'
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
|
||||
@@ -29,7 +29,7 @@ def kvo(
|
||||
fast (int): The fast period. Default: 34
|
||||
slow (int): The slow period. Default: 55
|
||||
signal (int): The signal period. Default: 13
|
||||
mamode (str): See ```help(ta.ma)```. Default: 'ema'
|
||||
mamode (str): See ``help(ta.ma)``. Default: 'ema'
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
Kwargs:
|
||||
|
||||
@@ -29,7 +29,7 @@ def wb_tsv(
|
||||
volume (pd.Series): Series of 'volume's
|
||||
length (int): It's period. Default: 18
|
||||
signal (int): It's avg period. Default: 10
|
||||
mamode (str): See ```help(ta.ma)```. Default: 'sma'
|
||||
mamode (str): See ``help(ta.ma)``. Default: 'sma'
|
||||
drift (int): The difference period. Default: 1
|
||||
offset (int): How many periods to offset the result. Default: 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user