diff --git a/iq.py b/iq.py index 02337e0..26f3ae7 100644 --- a/iq.py +++ b/iq.py @@ -89,7 +89,7 @@ def get_data_needed(iq): #function to gather all the data for candle in current: useful_frame = pd.DataFrame(list(candle.values()),index = list(candle.keys())).T.drop(columns = ['at']) useful_frame = useful_frame.set_index(useful_frame['id']).drop(columns = ['id']) - main = main.append(useful_frame) + main = pd.concat([main, useful_frame]) main.drop_duplicates() if active == 'EURUSD': final_data = main.drop(columns = {'from','to'}) @@ -108,7 +108,7 @@ def fast_data(iq,ratio): #function to gather reduced data for the testing for candle in candles: useful_frame = pd.DataFrame(list(candle.values()),index = list(candle.keys())).T.drop(columns = ['at']) useful_frame = useful_frame.set_index(useful_frame['id']).drop(columns = ['id']) - main = main.append(useful_frame) + main = pd.concat([main, useful_frame]) return main def get_balance(iq): diff --git a/requirements.txt b/requirements.txt index eecf703..2a996ee 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,5 @@ -iqoptionapi @ git+git://github.com/Lu-Yi-Hsun/iqoptionapi.git@e96ba2c5b905a139a4765167b08c5df48cf57773 -numpy==1.18.0 -pandas==1.1.1 -tensorflow==2.3.1 -scikit-learn==0.23.2 -grpcio==1.24.3 \ No newline at end of file +iqoptionapi @ git+https://github.com/Lu-Yi-Hsun/iqoptionapi.git@e96ba2c5b905a139a4765167b08c5df48cf57773 +numpy>=1.23,<2.0 +pandas>=2.0,<3.0 +tensorflow>=2.13,<3.0 +scikit-learn>=1.3,<2.0 diff --git a/testing.py b/testing.py index 7717240..d91848f 100644 --- a/testing.py +++ b/testing.py @@ -122,7 +122,7 @@ def preprocess_prediciton(iq): -NAME = train_data() + '.model' +NAME = train_data() + '.keras' model = tf.keras.models.load_model(f'models/{NAME}') iq = login() @@ -136,7 +136,7 @@ def preprocess_prediciton(iq): while(1): if i >= 10 and i % 2 == 0: - NAME = train_data() + '.model' + NAME = train_data() + '.keras' model = tf.keras.models.load_model(f'models/{NAME}') i = 0 if datetime.datetime.now().second < 30 and i % 2 == 0: #GARANTE QUE ELE VAI APOSTAR NA SEGUNDA, POIS AQUI ELE JÁ PEGA OS DADOS DE UMA NA FRENTE, diff --git a/training.py b/training.py index 1a1479a..78219f7 100644 --- a/training.py +++ b/training.py @@ -32,7 +32,7 @@ def classify(current,future): return 0 def preprocess_df(df): - df = df.drop("future", 1) + df = df.drop("future", axis=1) from sklearn.preprocessing import MinMaxScaler scaler = MinMaxScaler() @@ -204,7 +204,7 @@ def train_data(): model.add(Dense(2, activation='softmax')) - opt = tf.keras.optimizers.Adam(lr=LEARNING_RATE, decay=5e-5) + opt = tf.keras.optimizers.Adam(learning_rate=LEARNING_RATE) # Compile model model.compile( @@ -217,7 +217,7 @@ def train_data(): filepath = "LSTM-best" # unique file name that will include the epoch and the validation acc for that epoch - checkpoint = ModelCheckpoint("models/{}.model".format(filepath), monitor='val_acc', verbose=1, save_best_only=True, mode='max') # saves only the best ones + checkpoint = ModelCheckpoint("models/{}.keras".format(filepath), monitor='val_accuracy', verbose=1, save_best_only=True, mode='max') # saves only the best ones # Train model history = model.fit(