From 94e6f37f079e2c940120d604e1843122514065e9 Mon Sep 17 00:00:00 2001 From: Gaurav Swaroop Date: Sat, 11 Jul 2020 17:42:13 +0530 Subject: [PATCH 1/2] Solving for cold start - setting a default trend value of +1 --- pandas_ta/overlap/supertrend.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pandas_ta/overlap/supertrend.py b/pandas_ta/overlap/supertrend.py index de022ce..ad4b9a7 100644 --- a/pandas_ta/overlap/supertrend.py +++ b/pandas_ta/overlap/supertrend.py @@ -18,7 +18,7 @@ def supertrend(high, low, close, length=None, multiplier=None, offset=None, **kw # Calculate Results m = close.size - dir_, trend = [0] * m, [0] * m + dir_, trend = [1] * m, [0] * m long, short = [npNaN] * m, [npNaN] * m hl2_ = hl2(high, low) @@ -82,7 +82,9 @@ Sources: Calculation: Default Inputs: length=7, multiplier=3.0 - + Default Direction: + Set to +1 or bullish trend at start + MID = multiplier * ATR LOWERBAND = HL2 - MID UPPERBAND = HL2 + MID From 334f3648c159d4e0fa67d5d5e631ec691cc50bf9 Mon Sep 17 00:00:00 2001 From: YuvalWein <65113623+YuvalWein@users.noreply.github.com> Date: Tue, 21 Jul 2020 11:30:11 +0300 Subject: [PATCH 2/2] Update cmf.py Confusing documentation: note that in the Arg of doc we have open before volume, and open is not an optional parameter. its different from the real function arguments. --- pandas_ta/volume/cmf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas_ta/volume/cmf.py b/pandas_ta/volume/cmf.py index 03ad4cd..f259a53 100644 --- a/pandas_ta/volume/cmf.py +++ b/pandas_ta/volume/cmf.py @@ -68,8 +68,8 @@ Args: high (pd.Series): Series of 'high's low (pd.Series): Series of 'low's close (pd.Series): Series of 'close's - open (pd.Series): Series of 'open'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 @@ -79,4 +79,4 @@ Kwargs: Returns: pd.Series: New feature generated. -""" \ No newline at end of file +"""