Skip to content
Open
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
4 changes: 2 additions & 2 deletions iq.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'})
Expand All @@ -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):
Expand Down
11 changes: 5 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
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
4 changes: 2 additions & 2 deletions testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions training.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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(
Expand All @@ -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(
Expand Down