Skip to content

Commit

Permalink
ADD: 3 more festures, which increased the avg accuracy by 10%
Browse files Browse the repository at this point in the history
  • Loading branch information
bszek213 committed Apr 3, 2023
1 parent 4e8d0d0 commit 5dcdb4a
Show file tree
Hide file tree
Showing 43 changed files with 199 additions and 70 deletions.
11 changes: 10 additions & 1 deletion ADA.csv
Original file line number Diff line number Diff line change
Expand Up @@ -1961,4 +1961,13 @@ Open,High,Low,Close,Volume,Dividends,Stock Splits
0.371192991733551,0.3869589865207672,0.35148099064826965,0.36061298847198486,792747065,0.0,0.0
0.36057600378990173,0.3843640089035034,0.35505199432373047,0.37204501032829285,435026934,0.0,0.0
0.37206000089645386,0.37272000312805176,0.357028990983963,0.3600830137729645,305578157,0.0,0.0
0.35968679189682007,0.36287596821784973,0.34999141097068787,0.352222204208374,212685360,0.0,0.0
0.3600989878177643,0.3628759980201721,0.34995201230049133,0.3519960045814514,211460876,0.0,0.0
0.35200101137161255,0.3614110052585602,0.34979599714279175,0.3562450110912323,219918828,0.0,0.0
0.3562529981136322,0.3569889962673187,0.33873799443244934,0.34551000595092773,302198799,0.0,0.0
0.34556499123573303,0.36945900321006775,0.34380900859832764,0.3683539927005768,319572685,0.0,0.0
0.36830300092697144,0.3895060122013092,0.36743101477622986,0.38158899545669556,472185946,0.0,0.0
0.3816100060939789,0.3869290053844452,0.3708980083465576,0.376459002494812,391063045,0.0,0.0
0.37649598717689514,0.40793800354003906,0.37508100271224976,0.39892300963401794,637648499,0.0,0.0
0.3988800048828125,0.4012320041656494,0.38275301456451416,0.38538798689842224,355308379,0.0,0.0
0.3931959867477417,0.3931959867477417,0.37731701135635376,0.38175299763679504,300032590,0.0,0.0
0.3818819522857666,0.40330609679222107,0.3728748559951782,0.38308703899383545,578428544,0.0,0.0
2 changes: 1 addition & 1 deletion ADA_model/fingerprint.pb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ֈߐՐ��b����냰�����⏅�� ��������(䊘��ð��2
�����IJ����܍�����ވ�đ��u ��ߺ����(�Į������2
4 changes: 2 additions & 2 deletions ADA_model/keras_metadata.pb

Large diffs are not rendered by default.

Binary file modified ADA_model/saved_model.pb
Binary file not shown.
Binary file modified ADA_model/variables/variables.data-00000-of-00001
Binary file not shown.
Binary file modified ADA_model/variables/variables.index
Binary file not shown.
11 changes: 10 additions & 1 deletion BTC.csv
Original file line number Diff line number Diff line change
Expand Up @@ -3110,4 +3110,13 @@ Open,High,Low,Close,Volume,Dividends,Stock Splits
28158.720703125,28803.3359375,26759.99609375,27307.4375,33382021890,0.0,0.0
27301.95703125,28729.84375,27183.36328125,28333.97265625,24220433689,0.0,0.0
28324.111328125,28388.4375,27039.265625,27493.28515625,25980310960,0.0,0.0
27486.4140625,27780.93359375,27220.1875,27456.591796875,13416822784,0.0,0.0
27487.337890625,27791.826171875,27196.234375,27494.70703125,13383005987,0.0,0.0
27495.5234375,28178.14453125,27445.046875,27994.330078125,13878363192,0.0,0.0
27994.068359375,28037.92578125,26606.689453125,27139.888671875,18188895178,0.0,0.0
27132.888671875,27460.71875,26677.818359375,27268.130859375,17783600385,0.0,0.0
27267.03125,28619.54296875,27259.662109375,28348.44140625,20684945906,0.0,0.0
28350.140625,29159.90234375,27720.16015625,28033.5625,22435349951,0.0,0.0
28032.26171875,28639.896484375,27583.71484375,28478.484375,19001327598,0.0,0.0
28473.33203125,28802.45703125,28297.171875,28411.03515625,10876469901,0.0,0.0
28462.845703125,28518.958984375,27884.087890625,28199.30859375,12284641999,0.0,0.0
28162.6875,28440.708984375,27644.890625,27764.0859375,17633808384,0.0,0.0
2 changes: 1 addition & 1 deletion BTC_model/fingerprint.pb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
�۴���Ś����냰�����⏅�� ��������(�������2
ɺ���յ����܍�����ވ�đ��u ��ߺ����(����ݑ��s2
4 changes: 2 additions & 2 deletions BTC_model/keras_metadata.pb

Large diffs are not rendered by default.

Binary file modified BTC_model/saved_model.pb
Binary file not shown.
Binary file modified BTC_model/variables/variables.data-00000-of-00001
Binary file not shown.
Binary file modified BTC_model/variables/variables.index
Binary file not shown.
11 changes: 10 additions & 1 deletion DOGE.csv
Original file line number Diff line number Diff line change
Expand Up @@ -1961,4 +1961,13 @@ Open,High,Low,Close,Volume,Dividends,Stock Splits
0.07687000185251236,0.0776429995894432,0.07213400304317474,0.07399900257587433,693511781,0.0,0.0
0.07399599999189377,0.07893399894237518,0.073294997215271,0.07741200178861618,637122733,0.0,0.0
0.07740399986505508,0.07749000191688538,0.0733880028128624,0.07468000054359436,396748009,0.0,0.0
0.07468792051076889,0.07588913291692734,0.07298284769058228,0.07375582307577133,287920000,0.0,0.0
0.07468199729919434,0.07591400295495987,0.07296399772167206,0.07404399663209915,286831067,0.0,0.0
0.07405500113964081,0.075375996530056,0.07372099906206131,0.07441700249910355,228916506,0.0,0.0
0.07442600280046463,0.07583100348711014,0.07175599783658981,0.07289499789476395,435284210,0.0,0.0
0.0728989988565445,0.07392500340938568,0.07193700224161148,0.0738229975104332,276514415,0.0,0.0
0.07382400333881378,0.07673300057649612,0.07364200055599213,0.07562699913978577,423884022,0.0,0.0
0.07564199715852737,0.07664100080728531,0.07368399947881699,0.07424499839544296,372289117,0.0,0.0
0.07425899803638458,0.07772199809551239,0.07380799949169159,0.07703500241041183,378314248,0.0,0.0
0.07702499628067017,0.08527900278568268,0.07614400237798691,0.08405099809169769,933070185,0.0,0.0
0.08185900002717972,0.08527900278568268,0.07784800231456757,0.07908900082111359,929778146,0.0,0.0
0.07901941239833832,0.10230608284473419,0.07663155347108841,0.09190445393323898,2925777664,0.0,0.0
2 changes: 1 addition & 1 deletion DOGE_model/fingerprint.pb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ֈߐՐ��b����냰�����⏅�� ��������(��爏 2
�����IJ����܍�����ވ�đ��u ��ߺ����(������±�2
4 changes: 2 additions & 2 deletions DOGE_model/keras_metadata.pb

Large diffs are not rendered by default.

Binary file modified DOGE_model/saved_model.pb
Binary file not shown.
Binary file modified DOGE_model/variables/variables.data-00000-of-00001
Binary file not shown.
Binary file modified DOGE_model/variables/variables.index
Binary file not shown.
11 changes: 10 additions & 1 deletion ETH.csv
Original file line number Diff line number Diff line change
Expand Up @@ -1961,4 +1961,13 @@ Open,High,Low,Close,Volume,Dividends,Stock Splits
1804.95703125,1821.458251953125,1717.76513671875,1737.717041015625,12484103560,0.0,0.0
1737.140869140625,1853.8880615234375,1732.524658203125,1816.4051513671875,11012966854,0.0,0.0
1815.81982421875,1819.935302734375,1730.3494873046875,1752.0447998046875,10913669383,0.0,0.0
1752.5189208984375,1762.674560546875,1719.502685546875,1739.0853271484375,6727498752,0.0,0.0
1751.469482421875,1762.674560546875,1716.6519775390625,1743.7647705078125,6614309912,0.0,0.0
1743.8421630859375,1797.8802490234375,1741.182861328125,1775.6767578125,6990313307,0.0,0.0
1775.4813232421875,1781.3792724609375,1690.5166015625,1715.4608154296875,8585750760,0.0,0.0
1715.327392578125,1791.1109619140625,1702.564697265625,1772.78564453125,8346890042,0.0,0.0
1772.89990234375,1825.6009521484375,1772.89990234375,1793.0018310546875,9136176952,0.0,0.0
1793.345947265625,1827.2802734375,1766.2489013671875,1792.7371826171875,9724496987,0.0,0.0
1793.6201171875,1844.6773681640625,1783.1422119140625,1822.0220947265625,9149379763,0.0,0.0
1821.704345703125,1840.173095703125,1811.1185302734375,1813.860595703125,5556443606,0.0,0.0
1821.192138671875,1824.328857421875,1774.8724365234375,1795.7081298828125,6199721188,0.0,0.0
1793.747802734375,1835.900390625,1765.5743408203125,1778.10546875,9191772160,0.0,0.0
2 changes: 1 addition & 1 deletion ETH_model/fingerprint.pb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ֈߐՐ��b����냰�����⏅�� ��������(�������2
�����IJ����܍�����ވ�đ��u ��ߺ����(�΃��͖�2
4 changes: 2 additions & 2 deletions ETH_model/keras_metadata.pb

Large diffs are not rendered by default.

Binary file modified ETH_model/saved_model.pb
Binary file not shown.
Binary file modified ETH_model/variables/variables.data-00000-of-00001
Binary file not shown.
Binary file modified ETH_model/variables/variables.index
Binary file not shown.
11 changes: 10 additions & 1 deletion LINK.csv
Original file line number Diff line number Diff line change
Expand Up @@ -1961,4 +1961,13 @@ Open,High,Low,Close,Volume,Dividends,Stock Splits
7.406498908996582,7.697200775146484,7.0700459480285645,7.180304050445557,586895392,0.0,0.0
7.17984676361084,7.629281044006348,7.119134902954102,7.621306896209717,329204523,0.0,0.0
7.62053108215332,7.646345138549805,7.152146816253662,7.206892013549805,295497990,0.0,0.0
7.2022294998168945,7.2510294914245605,6.994295120239258,7.052063941955566,191346096,0.0,0.0
7.20620584487915,7.251605987548828,6.994295120239258,7.084826946258545,193197164,0.0,0.0
7.085594177246094,7.284111976623535,7.06675910949707,7.262111186981201,165218457,0.0,0.0
7.262615203857422,7.271117210388184,6.804008960723877,6.872753143310547,230593321,0.0,0.0
6.8729681968688965,7.02065896987915,6.77236795425415,6.955334186553955,211056975,0.0,0.0
6.954264163970947,7.458693027496338,6.94170618057251,7.382523059844971,297994491,0.0,0.0
7.382503986358643,7.528229236602783,7.1701250076293945,7.232709884643555,279488316,0.0,0.0
7.232532024383545,7.655243873596191,7.231266021728516,7.594569206237793,340384822,0.0,0.0
7.595728874206543,7.6271820068359375,7.459664821624756,7.47448205947876,183579045,0.0,0.0
7.55074405670166,7.55074405670166,7.224246025085449,7.259294033050537,188792643,0.0,0.0
7.258115768432617,7.424676895141602,7.073147296905518,7.084716796875,284152512,0.0,0.0
2 changes: 1 addition & 1 deletion LINK_model/fingerprint.pb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ֈߐՐ��b����냰�����⏅�� ��������(������2
�����IJ����܍�����ވ�đ��u ��ߺ����(�ݯ�����/2
4 changes: 2 additions & 2 deletions LINK_model/keras_metadata.pb

Large diffs are not rendered by default.

Binary file modified LINK_model/saved_model.pb
Binary file not shown.
Binary file modified LINK_model/variables/variables.data-00000-of-00001
Binary file not shown.
Binary file modified LINK_model/variables/variables.index
Binary file not shown.
11 changes: 10 additions & 1 deletion LTC.csv
Original file line number Diff line number Diff line change
Expand Up @@ -3110,4 +3110,13 @@ Open,High,Low,Close,Volume,Dividends,Stock Splits
82.71697998046875,88.15037536621094,79.94864654541016,87.35688781738281,969686696,0.0,0.0
87.34841918945312,94.44811248779297,86.03134155273438,93.70100402832031,1054746379,0.0,0.0
93.69886016845703,95.75912475585938,89.8736801147461,93.70990753173828,866952422,0.0,0.0
93.96833038330078,93.96833038330078,90.43731689453125,91.44096374511719,515442624,0.0,0.0
93.7067642211914,93.96833038330078,90.42384338378906,91.58114624023438,493921885,0.0,0.0
91.5821762084961,94.64312744140625,90.98301696777344,93.52519226074219,489851737,0.0,0.0
93.51691436767578,93.6174545288086,88.17765808105469,89.24687194824219,552145190,0.0,0.0
89.24317932128906,89.42103576660156,86.03421020507812,89.13937377929688,556233998,0.0,0.0
89.13932800292969,92.87533569335938,89.09891510009766,91.34173583984375,541611636,0.0,0.0
91.34050750732422,92.9992904663086,87.33723449707031,89.05989074707031,593012954,0.0,0.0
89.07251739501953,90.20854187011719,87.93004608154297,89.68412780761719,452243261,0.0,0.0
89.68643951416016,93.85362243652344,89.5528335571289,92.87535095214844,548762293,0.0,0.0
92.662841796875,94.4293441772461,90.8553237915039,93.01597595214844,549452266,0.0,0.0
92.9996566772461,95.37003326416016,90.96139526367188,91.40279388427734,637808896,0.0,0.0
2 changes: 1 addition & 1 deletion LTC_model/fingerprint.pb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
�۴���Ś����냰�����⏅�� ��������(��������2
ɺ���յ����܍�����ވ�đ��u ��ߺ����(�Džِ���2
4 changes: 2 additions & 2 deletions LTC_model/keras_metadata.pb

Large diffs are not rendered by default.

Binary file modified LTC_model/saved_model.pb
Binary file not shown.
Binary file modified LTC_model/variables/variables.data-00000-of-00001
Binary file not shown.
Binary file modified LTC_model/variables/variables.index
Binary file not shown.
Binary file modified classifier_ADA.joblib
Binary file not shown.
Binary file modified classifier_BTC.joblib
Binary file not shown.
Binary file modified classifier_DOGE.joblib
Binary file not shown.
Binary file modified classifier_ETH.joblib
Binary file not shown.
Binary file modified classifier_LINK.joblib
Binary file not shown.
Binary file modified classifier_LTC.joblib
Binary file not shown.
167 changes: 121 additions & 46 deletions classify_pos_neg.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from sklearn.metrics import accuracy_score
import joblib
from sys import argv
import ta

def get_ohlc(crypt):
crypt_name = crypt + '-USD'
Expand All @@ -38,50 +39,53 @@ def OBV(data):
If the closing price of the asset is lower than the previous day?s closing price:
OBV = Previous OBV - Current Day's Volume
"""
#TODO: add a linear regression lineover like 10-20 data points and use that
# as a buy signal if it is positive
data['OBV'] = np.zeros(len(data))
# crypto_df_final['OBV'].iloc[0] = crypto_df_final['volume'].iloc[0]
OBV_iter = data['Volume'].iloc[0]
data['OBV'].iloc[0] = OBV_iter
for i in range(1,len(data['OBV'])):
if (data['Close'].iloc[i-1] < data['Close'].iloc[i]):
OBV_iter += data['Volume'].iloc[i]
if (data['Close'].iloc[i-1] > data['Close'].iloc[i]):
OBV_iter -= data['Volume'].iloc[i]
if (data['Close'].iloc[i-1] == data['Close'].iloc[i]):
OBV_iter += 0
data['OBV'].iloc[i] = OBV_iter
# #TODO: add a linear regression lineover like 10-20 data points and use that
# # as a buy signal if it is positive
# data['OBV'] = np.zeros(len(data))
# # crypto_df_final['OBV'].iloc[0] = crypto_df_final['volume'].iloc[0]
# OBV_iter = data['Volume'].iloc[0]
# data['OBV'].iloc[0] = OBV_iter
# for i in range(1,len(data['OBV'])):
# if (data['Close'].iloc[i-1] < data['Close'].iloc[i]):
# OBV_iter += data['Volume'].iloc[i]
# if (data['Close'].iloc[i-1] > data['Close'].iloc[i]):
# OBV_iter -= data['Volume'].iloc[i]
# if (data['Close'].iloc[i-1] == data['Close'].iloc[i]):
# OBV_iter += 0
# data['OBV'].iloc[i] = OBV_iter
data['OBV'] = ta.volume.OnBalanceVolumeIndicator(data['Close'], data['Volume']).on_balance_volume()
return data

def RSI(data):
update = pd.DataFrame()
update['change'] = data.Close.diff()
# crypto_df['U'] = [x if x > 0 else 0 for x in crypto_df.change]
# crypto_df['D'] = [abs(x) if x < 0 else 0 for x in crypto_df.change]
update['U'] = update['change'].clip(lower=0)
update['D'] = -1*update['change'].clip(upper=0)
update['U'] = update['U'].ewm(span=14,
min_periods=1).mean()
update['D'] = update['D'].ewm(span=14,
min_periods=1).mean()
update['RS'] = update['U'] / update['D']
data['RSI'] = 100 - (100/(1+update['RS']))
# update = pd.DataFrame()
# update['change'] = data.Close.diff()
# # crypto_df['U'] = [x if x > 0 else 0 for x in crypto_df.change]
# # crypto_df['D'] = [abs(x) if x < 0 else 0 for x in crypto_df.change]
# update['U'] = update['change'].clip(lower=0)
# update['D'] = -1*update['change'].clip(upper=0)
# update['U'] = update['U'].ewm(span=14,
# min_periods=1).mean()
# update['D'] = update['D'].ewm(span=14,
# min_periods=1).mean()
# update['RS'] = update['U'] / update['D']
# data['RSI'] = 100 - (100/(1+update['RS']))
data['RSI'] = ta.momentum.RSIIndicator(data['Close'], window=14).rsi()
return data

def vol_RSI(data):
update = pd.DataFrame()
update['change_vol'] = data.Volume.diff()
# crypto_df['U'] = [x if x > 0 else 0 for x in crypto_df.change]
# crypto_df['D'] = [abs(x) if x < 0 else 0 for x in crypto_df.change]
update['U_vol'] = update['change_vol'].clip(lower=0)
update['D_vol'] = -1*update['change_vol'].clip(upper=0)
update['U_vol'] = update.U_vol.ewm(span=14,
min_periods=1).mean()
update['D'] = update.D_vol.ewm(span=14,
min_periods=1).mean()
update['RS_vol'] = update.U_vol / update.D_vol
data['RSI_vol'] = 100 - (100/(1+update.RS_vol))
# update = pd.DataFrame()
# update['change_vol'] = data.Volume.diff()
# # crypto_df['U'] = [x if x > 0 else 0 for x in crypto_df.change]
# # crypto_df['D'] = [abs(x) if x < 0 else 0 for x in crypto_df.change]
# update['U_vol'] = update['change_vol'].clip(lower=0)
# update['D_vol'] = -1*update['change_vol'].clip(upper=0)
# update['U_vol'] = update.U_vol.ewm(span=14,
# min_periods=1).mean()
# update['D'] = update.D_vol.ewm(span=14,
# min_periods=1).mean()
# update['RS_vol'] = update.U_vol / update.D_vol
# data['RSI_vol'] = 100 - (100/(1+update.RS_vol))
data['RSI_vol'] = ta.momentum.RSIIndicator(data['Volume'], window=14).rsi()
return data

def moving_averages(data):
Expand Down Expand Up @@ -139,19 +143,86 @@ def aroon_ind(data,lb=25):
if up[i] >= 70 and down[i] <= 30: buy
if up[i] <= 30 and down[i] >= 70: sell
"""
data['aroon_up'] = 100 * ((data['High'].rolling(lb).apply(lambda x: x.argmax())) / lb)
data['aroon_down'] = 100 * ((data['Low'].rolling(lb).apply(lambda x: x.argmin())) / lb)
# data['aroon_up'] = 100 * ((data['High'].rolling(lb).apply(lambda x: x.argmax())) / lb)
# data['aroon_down'] = 100 * ((data['Low'].rolling(lb).apply(lambda x: x.argmin())) / lb)
aroon = ta.trend.AroonIndicator(data['Close'],window=25)
data['aroon'] = aroon.aroon_indicator()
return data

def stoch_RSI(data):
min_val = data['RSI'].rolling(window=14, center=False).min()
max_val = data['RSI'].rolling(window=14, center=False).max()
data['Stoch_RSI'] = ((data['RSI'] - min_val) / (max_val - min_val)) * 100
# min_val = data['RSI'].rolling(window=14, center=False).min()
# max_val = data['RSI'].rolling(window=14, center=False).max()
# data['Stoch_RSI'] = ((data['RSI'] - min_val) / (max_val - min_val)) * 100
data['Stoch_RSI'] = ta.momentum.StochRSIIndicator(data['RSI']).stochrsi()
return data

def volume_osc(data):
"""
Volume Oscillator = [(Shorter Period SMA of Volume – Longer Period SMA of Volume)
/ Longer Period SMA of Volume ] * 100
"""
short = data['Volume'].ewm(span=14,min_periods=13).mean()
long = data['Volume'].ewm(span=28,min_periods=27).mean()
data['volume_os'] = ((short - long) / long) * 100

return data

def cmf_line(df):
"""
If the CMF is above zero, it suggests that buying pressure is increasing and the price is likely to rise.
If the CMF is below zero, it suggests that selling pressure is increasing and the price is likely to fall.
"""
# Calculate the money flow multiplier
mf_mult = ((df['Close'] - df['Low']) - (df['High'] - df['Close'])) / (df['High'] - df['Low'])
mf_mult = mf_mult.fillna(0) # Replace NaN values with 0

# Calculate the money flow volume
mf_vol = mf_mult * df['Volume']

# Calculate the cumulative money flow volume and volume
cumulative_mfv = mf_vol.cumsum()
cumulative_vol = df['Volume'].cumsum()

# Calculate the CMF
cmf = cumulative_mfv / cumulative_vol
cmf *= (2 * (df['Close'] - df['Low']) - (df['High'] - df['Close'])) / (df['High'] - df['Low'])
cmf[:2] = [np.nan, np.nan]

df['cmf'] = cmf

return df

def vwma_macd(df):
# Calculate the volume-weighted moving average (VWMA) of the volume
df['VWMA'] = (df['Volume'] * (df['High'] + df['Low']) / 2).cumsum() / df['Volume'].cumsum()

# Calculate the 12-day and 26-day exponential moving averages (EMA) of the VWMA
ema12 = df['VWMA'].ewm(span=12, adjust=False).mean()
ema26 = df['VWMA'].ewm(span=26, adjust=False).mean()

# Calculate the MACD line as the difference between the 12-day and 26-day EMAs
macd_line = ema12 - ema26

# Calculate the 9-day EMA of the MACD line as the signal line
signal_line = macd_line.ewm(span=9, adjust=False).mean()

# Calculate the MACD histogram as the difference between the MACD line and the signal line
macd_hist = macd_line - signal_line

df['vol_macd'] = macd_line
df['vol_macd_signal'] = signal_line

return df

def force_index_indicator(df):
force = ta.volume.ForceIndexIndicator(df['close'],df['volume'])
df['force_index'] = force.force_index()
return df

def split_x_y(df):
X = df[['OBV', 'macd_diff', 'signal_line','MFI','ewmshort','ewmmedium','ewmlong',
'RSI_vol','RSI','aroon_up','Stoch_RSI']].fillna(method='bfill')#.values[:-1]
'RSI_vol','RSI','aroon','Stoch_RSI','volume_os','vol_macd','vol_macd_signal',
'cmf']].fillna(method='bfill')#.values[:-1]
#Make sure this is right
Y = np.where(df['Close'].shift(-1).values > df['Close'].values, 1, 0)
Y = np.pad(Y, (1, 0), mode='constant')
Expand Down Expand Up @@ -232,7 +303,8 @@ def deep_model(X_train,y_train,X_test,y_test):
# print(classification_report(y_test, y_pred_class))
def random_forest(df):
X = df[['OBV', 'macd_diff', 'signal_line','MFI','ewmshort','ewmmedium','ewmlong',
'RSI_vol','RSI','aroon_up','Stoch_RSI']].fillna(method='bfill')#.values[:-1]
'RSI_vol','RSI','aroon','Stoch_RSI','volume_os','vol_macd','vol_macd_signal',
'cmf']].fillna(method='bfill')#.values[:-1]
#Make sure this is right
Y = np.where(df['Close'].shift(-1).values > df['Close'].values, 1, 0)
Y = np.pad(Y, (1, 0), mode='constant')
Expand Down Expand Up @@ -260,7 +332,7 @@ def random_forest(df):
print("Accuracy:", acc)

def main():
#Possible Cryptos: BTC, ETH, DOGE, LTC, SOL
#Possible Cryptos: BTC, ETH, DOGE, LTC, ADA, LINK
print(f'creating model for {argv[1]}')
crypt = argv[1]
df = get_ohlc(crypt)
Expand All @@ -272,6 +344,9 @@ def main():
df = macd(df)
df = aroon_ind(df)
df = stoch_RSI(df)
df = volume_osc(df)
df = cmf_line(df)
df = vwma_macd(df)
X_train, X_test, y_train, y_test = split_x_y(df)
deep_model(X_train,y_train,X_test,y_test)
random_forest(df)
Expand Down

0 comments on commit 5dcdb4a

Please sign in to comment.