Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alter lib tab_lib to ta #6

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
PyMySQL==0.9.3
scipy==1.5.0
scipy>=1.5.0
plotly==4.5.0
pytz==2019.3
pandas==1.0.1
numpy==1.18.1
TA_Lib==0.4.17
requests==2.22.0
python_dateutil==2.8.2
pytz>=2019.3
pandas>=1.0.1
numpy>=1.18.1
requests>=2.22.0
python_dateutil>=2.8.2
#TA_Lib>=0.4.17
ta==0.10.1
5 changes: 3 additions & 2 deletions sample_binance.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import requests
from rsi_divergence_finder import *
from timeframe import TimeFrame
import talib
import ta

real_path = os.path.dirname(os.path.realpath(__file__))
os.chdir(real_path)
Expand Down Expand Up @@ -85,7 +85,8 @@ def plot_rsi_divergence(candles_df, divergences, pair, file_name):
candles_df[TIME_COLUMN] = pd.to_datetime(candles_df[TIME_COLUMN], unit='ms')
candles_df[BASE_COLUMN] = pd.to_numeric(candles_df[BASE_COLUMN])

candles_df[RSI_COLUMN] = talib.RSI(candles_df[BASE_COLUMN] * 100000, timeperiod=14)
#candles_df[RSI_COLUMN] = talib.RSI(candles_df[BASE_COLUMN] * 100000, timeperiod=14)
candles_df[RSI_COLUMN] = ta.momentum.RSIIndicator(candles_df[BASE_COLUMN], window=14).rsi()
candles_df.dropna(inplace=True)

div_df = get_all_rsi_divergences(candles_df, time_frame)
Expand Down
6 changes: 4 additions & 2 deletions sample_tg_poster.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from timeframe import TimeFrame
from db.one_hour_candle_db import OneHourCandleDB
import logging
import talib
import ta

os.chdir(os.path.dirname(os.path.realpath(__file__)))

Expand Down Expand Up @@ -98,7 +98,9 @@ def find_divergences(time_frames):
continue

# Here I am multiplying close price to 10^5, otherwise TA-Lib is giving incorrect rsi
candles_df[RSI_COLUMN] = talib.RSI(candles_df[BASE_COLUMN] * 100000, timeperiod=14)
#candles_df[RSI_COLUMN] = talib.RSI(candles_df[BASE_COLUMN] * 100000, timeperiod=14)
candles_df[RSI_COLUMN] = ta.momentum.RSIIndicator(candles_df[BASE_COLUMN], window=14).rsi()
#ta.momentum.RSIIndicator(df['close'], window=periodos).rsi()
candles_df.dropna(inplace=True)

divergences = get_rsi_divergences(candles_df,
Expand Down