kartikmadan11 / MetaTraderForecast

RNN based Forecasting App for Meta Trader and similar trading platforms
133 stars 70 forks source link

Update of build.py for TensorFlow 2 #10

Open eddybogosian opened 3 years ago

eddybogosian commented 3 years ago

Hey everyone,

I was testing this out and found a few changes that need to be made to the build.py script.

Remove:

  1. CuDNNLSTM
  2. CuDNNGRU (they are no longer called like that).

Substitute:

  1. tf.ConfigProto with tf.compat.v1.ConfigProto
  2. tf.Session() with tf.compat.v1.Session Same parameters, just change the syntax.

This is just a quick fix and should be rewritten for the new version of tensorflow.

Great work kartikmadan!

eddybogosian commented 3 years ago

To clarify, remove CuDNNLSTM and CuDNNGRU from the "keras.layers import" Remove the CuDNN prefix for the CuDNNLSTM and CuDNNGRU from the "if isCuda:" architecture definition as the new syntax does not use that prefix any longer and this still maintains the use of training in GPU.

Attached is the build script as of now. It still has an issue where, when you run the training sequence, you get a "TypeError": '<' not supported between instances of 'function' and 'str'.

From what I gathered, it looks like some variable is being declared as a string or not defined as an int.

At first I thought this was the "if(bars < window_size):", but even trying to define them as integers and even commenting out the if check didn't work. If I find something I'll update with what I have.

build.py.txt

SiriluckLor commented 3 years ago

Hi Sir, I got some error from file: build.py eval = regressor.evaluate(X_test, scaler.transform(test_set.reshape(-1,1))) <----- error

....\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\util\nest.py:416 flatten return _pywrap_utils.Flatten(structure, expand_composites) TypeError: '<' not supported between instances of 'function' and 'str'

therefore, anybody, please help me to solve this problem.
QLaHPD commented 3 years ago

SiriluckLor, did you managed to connect the socketserver to the mql5?

SiriluckLor commented 3 years ago

For my case, I connected from socketserver to mql4.


Asst.Prof. Dr. Siriluck Lorpunmanee, Ph.D. (Computer Science) Data Science and Analytics/Lecturer Suan Dusit University 295 Rathchasima Rd. Dusit Bangkok, 10300, Thailand Mobile: +66-81-3886877, +66-97-1230067 E-mail: @., @. URL: HPCNET.info


From: QLaHPD @.> Sent: Tuesday, July 13, 2021 8:29 AM To: kartikmadan11/MetaTraderForecast @.> Cc: SiriluckLor @.>; Comment @.> Subject: Re: [kartikmadan11/MetaTraderForecast] Update of build.py for TensorFlow 2 (#10)

SiriluckLor, did you managed to connect the socketserver to the mql5?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/kartikmadan11/MetaTraderForecast/issues/10#issuecomment-878706999, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGBVKDAG3RYNOY5PJYMUC63TXOJJBANCNFSM4XD4N4TQ.

troski2 commented 1 year ago

SiriluckLor, did you managed to connect the socketserver to the mql5?

In MetaTrader, you have to allow connections to localhost (Tools>Options>Expert Advisors):

imagen