Skip to content

Commit

Permalink
adding PSAR to wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
bukosabino committed Nov 27, 2019
1 parent df73371 commit b8099ae
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions ta/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
DailyReturnIndicator)
from ta.trend import (MACD, ADXIndicator, AroonIndicator, CCIIndicator,
DPOIndicator, EMAIndicator, IchimokuIndicator,
KSTIndicator, MassIndex, TRIXIndicator, VortexIndicator)
KSTIndicator, MassIndex, PSARIndicator, TRIXIndicator,
VortexIndicator)
from ta.volatility import (AverageTrueRange, BollingerBands, DonchianChannel,
KeltnerChannel)
from ta.volume import (AccDistIndexIndicator, ChaikinMoneyFlowIndicator,
Expand Down Expand Up @@ -186,11 +187,19 @@ def add_trend_ta(df: pd.DataFrame, high: str, low: str, close: str, fillna: bool
df[f'{colprefix}trend_visual_ichimoku_b'] = indicator.ichimoku_b()

# Aroon Indicator
indicator = AroonIndicator(df[close], n=25, fillna=fillna)
indicator = AroonIndicator(close=df[close], n=25, fillna=fillna)
df[f'{colprefix}trend_aroon_up'] = indicator.aroon_up()
df[f'{colprefix}trend_aroon_down'] = indicator.aroon_down()
df[f'{colprefix}trend_aroon_ind'] = indicator.aroon_indicator()

# PSAR Indicator
indicator = PSARIndicator(high=df[high], low=df[low], close=df[close], step=0.02, max_step=0.20, fillna=fillna)
df[f'{colprefix}trend_psar'] = indicator.psar()
df[f'{colprefix}trend_psar_up'] = indicator.psar_up()
df[f'{colprefix}trend_psar_down'] = indicator.psar_down()
df[f'{colprefix}trend_psar_up_indicator'] = indicator.psar_up_indicator()
df[f'{colprefix}trend_psar_down_indicator'] = indicator.psar_down_indicator()

return df


Expand Down

0 comments on commit b8099ae

Please sign in to comment.