bekomme Seltsame RSI Werte herausgegeben... - Seite 2

 

Ja, dann kannst Du Dir das Scrollen sparen. Liegt vielleicht am OnInit, hier sollte man noch nicht auf die Historien zugreifen. Mach es beim ersten Aufruf von OnTick.

void OnTick
  {
   static bool isFirstCall=true;
   if(isFirstCall) { isFirstCall=false; InitializeStructures(); }
 
lippmaje:

Ja, dann kannst Du Dir das Scrollen sparen. Liegt vielleicht am OnInit, hier sollte man noch nicht auf die Historien zugreifen. Mach es beim ersten Aufruf von OnTick.

 :/ brauche es leider unbedingt aus dem OnInit() heraus ... (hier wird alles was in an daten brauche in ein csv gepackt, anschließend mein Modell darauf trainiert und im OnTick durchlauf, sehe ich wie gut mein Modell funktioniert... ) gibt es denn gar keine möglichkeit?
 
Bayne:
 :/ brauche es leider unbedingt aus dem OnInit() heraus... gibt es denn gar keine möglichkeit?

Warum das? Mach doch Deine eigene Init Funktion. Übrigens Christian wollte darauf hinweisen, dass Du ein uninitialisiertes Array gelesen hast.

int OnInit() { return INIT_SUCCEEDED; }

void MyInit() { Print("YES!!!"); }

void OnTick
  {
   static bool isFirstCall=true;
   if(isFirstCall) { isFirstCall=false; MyInit(); }
 
lippmaje:

Warum das? Mach doch Deine eigene Init Funktion. Übrigens Christian wollte darauf hinweisen, dass Du ein uninitialisiertes Array gelesen hast.

Die Idee ist großartig danke :)

@lippmaje gerade probiert... Das problem ist nur das die Initialisierung in 90% der Fälle nicht funktioniert und 10 mal länger dauert, wenn doch...

int OnInit()
   {
   if(inp_RSI)
      {
      int RSI_Handle = RSI_Handle =iRSI(my_symbol,my_timeframe,inp_RSIperiod,PRICE_CLOSE);
      if(RSI_Handle<0){Print("The creation of iRSI has failed: Runtime error =",GetLastError());DebugBreak();}
      }
   return(INIT_SUCCEEDED);
   }     

Debugger kommt gar nicht erst bei OnInit() an, beendet sich selbst und im log steht dann:

2019.07.14 00:13:58.528 test Experts\Advisors\MyFirstNeuralNetwork.ex5 on EURUSD,H1 thread finished
 
Christian:

Das musst du genauer erklären.....

Was soll denn da lange dauern ?

Mein code ist relativ groß schätze es hängt damit zusammen. jedenfalls wird nichtmal die OnInit() aufgerufen, und dann ... seht selbst (stopped by user kann absolut nicht sein, sondern es stoppt sich selbst):

2019.07.13 22:39:55.990 Tester  Local network farm using switch off
2019.07.13 22:39:56.009 Tester  Cloud servers using switch off
2019.07.13 22:41:11.828 Tester  EURUSD: history data begins from 2007.01.01 00:00
2019.07.13 22:41:15.893 Tester  EURUSD: preliminary downloading of history ticks started, it may take quite a long time
2019.07.13 22:41:15.893 Tester  EURUSD: preliminary downloading of history ticks completed
2019.07.13 22:41:15.893 Tester  EURUSD: ticks data begins from 2011.12.19 00:00
2019.07.13 22:41:16.088 Core 1  agent process started on 127.0.0.1:3000
2019.07.13 22:41:16.088 Core 1  connecting to 127.0.0.1:3000
2019.07.13 22:41:17.100 Core 1  connected
2019.07.13 22:41:17.117 Core 1  authorized (agent build 2085)
2019.07.13 22:41:17.121 Tester  EURUSD,H1 (ICMarkets-MT5): visual testing of Experts\Advisors\MyFirstNeuralNetwork.ex5 from 2015.01.01 00:00 to 2018.01.01 00:00
2019.07.13 22:41:17.150 Core 1  common synchronization completed
2019.07.13 22:41:21.557 Core 1  EURUSD: ticks synchronized already [43 bytes]
2019.07.13 23:11:11.237 Core 1  disconnected
2019.07.13 23:11:11.237 Core 1  connection closed
2019.07.13 23:11:11.237 Tester  stopped by user
2019.07.13 23:11:14.520 Tester  EURUSD: history data begins from 2007.01.01 00:00
2019.07.13 23:11:14.531 Tester  EURUSD: preliminary downloading of history ticks started, it may take quite a long time
2019.07.13 23:11:14.531 Tester  EURUSD: preliminary downloading of history ticks completed
2019.07.13 23:11:14.531 Tester  EURUSD: ticks data begins from 2011.12.19 00:00
2019.07.13 23:11:14.531 Core 1  connecting to 127.0.0.1:3000
2019.07.13 23:11:14.532 Core 1  connected
2019.07.13 23:11:14.539 Core 1  authorized (agent build 2085)
2019.07.13 23:11:14.544 Tester  EURUSD,H1 (ICMarkets-MT5): visual testing of Experts\Advisors\MyFirstNeuralNetwork.ex5 from 2015.01.01 00:00 to 2018.01.01 00:00
2019.07.13 23:11:14.576 Core 1  common synchronization completed
2019.07.13 23:11:15.651 Core 1  EURUSD: ticks synchronized already [43 bytes]
2019.07.13 23:12:34.227 Core 1  disconnected
2019.07.13 23:12:34.227 Core 1  connection closed
2019.07.13 23:12:34.228 Tester  stopped by user
2019.07.13 23:12:37.117 Tester  EURUSD: history data begins from 2007.01.01 00:00
2019.07.13 23:12:37.117 Tester  EURUSD: ticks data begins from 2011.12.19 00:00
2019.07.13 23:12:37.118 Core 1  connecting to 127.0.0.1:3000
2019.07.13 23:12:37.118 Core 1  connected
2019.07.13 23:12:37.122 Core 1  authorized (agent build 2085)
2019.07.13 23:12:37.124 Tester  EURUSD,H1 (ICMarkets-MT5): visual testing of Experts\Advisors\MyFirstNeuralNetwork.ex5 from 2015.01.01 00:00 to 2018.01.01 00:00
2019.07.13 23:12:37.158 Core 1  common synchronization completed
2019.07.13 23:12:37.244 Core 1  EURUSD: ticks synchronized already [43 bytes]
2019.07.13 23:13:42.981 Core 1  disconnected
2019.07.13 23:13:42.981 Core 1  connection closed
2019.07.13 23:13:42.981 Tester  stopped by user
2019.07.13 23:13:50.468 Tester  EURUSD: history data begins from 2007.01.01 00:00
2019.07.13 23:13:50.468 Tester  EURUSD: ticks data begins from 2011.12.19 00:00
2019.07.13 23:13:50.468 Core 1  connecting to 127.0.0.1:3000
2019.07.13 23:13:50.469 Core 1  connected
2019.07.13 23:13:50.473 Core 1  authorized (agent build 2085)
2019.07.13 23:13:50.474 Tester  EURUSD,H1 (ICMarkets-MT5): visual testing of Experts\Advisors\MyFirstNeuralNetwork.ex5 from 2015.01.01 00:00 to 2018.01.01 00:00
2019.07.13 23:13:50.543 Core 1  common synchronization completed
2019.07.13 23:13:50.603 Core 1  EURUSD: ticks synchronized already [43 bytes]
2019.07.13 23:14:50.243 Core 1  disconnected
2019.07.13 23:14:50.243 Core 1  connection closed
2019.07.13 23:14:50.243 Tester  stopped by user
2019.07.13 23:14:54.367 Tester  EURUSD: history data begins from 2007.01.01 00:00
2019.07.13 23:14:54.368 Tester  EURUSD: ticks data begins from 2011.12.19 00:00
2019.07.13 23:14:54.368 Core 1  connecting to 127.0.0.1:3000
2019.07.13 23:14:54.368 Core 1  connected
2019.07.13 23:14:54.375 Core 1  authorized (agent build 2085)
2019.07.13 23:14:54.380 Tester  EURUSD,H1 (ICMarkets-MT5): visual testing of Experts\Advisors\MyFirstNeuralNetwork.ex5 from 2015.01.01 00:00 to 2018.01.01 00:00
2019.07.13 23:14:54.448 Core 1  common synchronization completed
2019.07.13 23:14:54.511 Core 1  EURUSD: ticks synchronized already [43 bytes]
2019.07.13 23:19:31.532 Core 1  disconnected
2019.07.13 23:19:31.532 Core 1  connection closed
2019.07.13 23:19:31.533 Tester  stopped by user
2019.07.13 23:20:40.875 Tester  EURUSD: history data begins from 2007.01.01 00:00
2019.07.13 23:20:40.875 Tester  EURUSD: ticks data begins from 2011.12.19 00:00
2019.07.13 23:20:40.876 Core 1  connecting to 127.0.0.1:3000
2019.07.13 23:20:40.876 Core 1  connected
2019.07.13 23:20:40.880 Core 1  disconnected
2019.07.13 23:20:40.881 Core 1  connection closed
2019.07.13 23:21:19.338 Tester  EURUSD: history data begins from 2007.01.01 00:00
2019.07.13 23:21:19.339 Tester  EURUSD: ticks data begins from 2011.12.19 00:00
2019.07.13 23:21:19.339 Core 1  connecting to 127.0.0.1:3000
2019.07.13 23:21:19.340 Core 1  connected
2019.07.13 23:21:19.345 Core 1  authorized (agent build 2085)
2019.07.13 23:21:19.346 Tester  EURUSD,H1 (ICMarkets-MT5): visual testing of Experts\Advisors\MyFirstNeuralNetwork.ex5 from 2015.01.01 00:00 to 2018.01.01 00:00
2019.07.13 23:21:19.628 Core 1  common synchronization completed
2019.07.13 23:21:19.670 Core 1  EURUSD: ticks synchronized already [43 bytes]
2019.07.13 23:22:53.348 Core 1  disconnected
2019.07.13 23:22:53.348 Core 1  connection closed
2019.07.13 23:22:53.348 Tester  stopped by user
2019.07.13 23:23:02.364 Tester  EURUSD: history data begins from 2007.01.01 00:00
2019.07.13 23:23:02.365 Tester  EURUSD: ticks data begins from 2011.12.19 00:00
2019.07.13 23:23:02.365 Core 1  connecting to 127.0.0.1:3000
2019.07.13 23:23:02.366 Core 1  connected
2019.07.13 23:23:02.373 Core 1  authorized (agent build 2085)
2019.07.13 23:23:02.378 Tester  EURUSD,H1 (ICMarkets-MT5): visual testing of Experts\Advisors\MyFirstNeuralNetwork.ex5 from 2015.01.01 00:00 to 2018.01.01 00:00
2019.07.13 23:23:02.417 Core 1  common synchronization completed
2019.07.13 23:23:02.528 Core 1  EURUSD: ticks synchronized already [43 bytes]
2019.07.13 23:24:08.487 Core 1  disconnected
2019.07.13 23:24:08.487 Core 1  connection closed
2019.07.13 23:24:08.487 Tester  stopped by user
2019.07.13 23:24:12.697 Tester  EURUSD: history data begins from 2007.01.01 00:00
2019.07.13 23:24:12.697 Tester  EURUSD: ticks data begins from 2011.12.19 00:00
2019.07.13 23:24:12.698 Core 1  connecting to 127.0.0.1:3000
2019.07.13 23:24:12.698 Core 1  connected
2019.07.13 23:24:12.704 Core 1  authorized (agent build 2085)
2019.07.13 23:24:12.705 Tester  EURUSD,H1 (ICMarkets-MT5): visual testing of Experts\Advisors\MyFirstNeuralNetwork.ex5 from 2015.01.01 00:00 to 2018.01.01 00:00
2019.07.13 23:24:12.741 Core 1  common synchronization completed
2019.07.13 23:24:12.844 Core 1  EURUSD: ticks synchronized already [43 bytes]
2019.07.13 23:29:53.447 Core 1  disconnected
2019.07.13 23:29:53.447 Core 1  connection closed
2019.07.13 23:29:53.447 Tester  stopped by user
2019.07.13 23:30:01.988 Tester  EURUSD: history data begins from 2007.01.01 00:00
2019.07.13 23:30:01.989 Tester  EURUSD: ticks data begins from 2011.12.19 00:00
2019.07.13 23:30:01.989 Core 1  connecting to 127.0.0.1:3000
2019.07.13 23:30:01.990 Core 1  connected
2019.07.13 23:30:01.996 Core 1  authorized (agent build 2085)
2019.07.13 23:30:02.001 Tester  EURUSD,H1 (ICMarkets-MT5): visual testing of Experts\Advisors\MyFirstNeuralNetwork.ex5 from 2015.01.01 00:00 to 2018.01.01 00:00
2019.07.13 23:30:02.086 Core 1  common synchronization completed
2019.07.13 23:30:02.107 Core 1  EURUSD: ticks synchronized already [43 bytes]
2019.07.13 23:34:40.504 Core 1  disconnected
2019.07.13 23:34:40.504 Core 1  connection closed
2019.07.13 23:34:40.504 Tester  stopped by user
2019.07.13 23:34:43.981 Tester  EURUSD: history data begins from 2007.01.01 00:00
2019.07.13 23:34:43.981 Tester  EURUSD: ticks data begins from 2011.12.19 00:00
2019.07.13 23:34:43.982 Core 1  connecting to 127.0.0.1:3000
2019.07.13 23:34:43.982 Core 1  connected
2019.07.13 23:34:43.987 Core 1  authorized (agent build 2085)
2019.07.13 23:34:43.988 Tester  EURUSD,H1 (ICMarkets-MT5): visual testing of Experts\Advisors\MyFirstNeuralNetwork.ex5 from 2015.01.01 00:00 to 2018.01.01 00:00
2019.07.13 23:34:44.059 Core 1  common synchronization completed
2019.07.13 23:34:44.095 Core 1  EURUSD: ticks synchronized already [43 bytes]
2019.07.13 23:35:18.187 Core 1  disconnected
2019.07.13 23:35:18.188 Core 1  connection closed
2019.07.13 23:35:18.188 Tester  stopped by user
2019.07.13 23:35:25.152 Tester  EURUSD: history data begins from 2007.01.01 00:00
2019.07.13 23:35:25.153 Tester  EURUSD: ticks data begins from 2011.12.19 00:00
2019.07.13 23:35:25.153 Core 1  connecting to 127.0.0.1:3000
2019.07.13 23:35:25.154 Core 1  connected
2019.07.13 23:35:25.158 Core 1  authorized (agent build 2085)
2019.07.13 23:35:25.159 Tester  EURUSD,H1 (ICMarkets-MT5): visual testing of Experts\Advisors\MyFirstNeuralNetwork.ex5 from 2015.01.01 00:00 to 2018.01.01 00:00
2019.07.13 23:35:25.200 Core 1  common synchronization completed
2019.07.13 23:35:25.271 Core 1  EURUSD: ticks synchronized already [43 bytes]
2019.07.13 23:35:49.937 Core 1  disconnected
2019.07.13 23:35:49.937 Core 1  connection closed
2019.07.13 23:35:49.937 Tester  stopped by user
2019.07.13 23:36:25.964 Tester  EURUSD: history data begins from 2007.01.01 00:00
2019.07.13 23:36:25.965 Tester  EURUSD: ticks data begins from 2011.12.19 00:00
2019.07.13 23:36:25.966 Core 1  connecting to 127.0.0.1:3000
2019.07.13 23:36:25.966 Core 1  connected
2019.07.13 23:36:25.970 Core 1  authorized (agent build 2085)
2019.07.13 23:36:25.972 Tester  EURUSD,H1 (ICMarkets-MT5): visual testing of Experts\Advisors\MyFirstNeuralNetwork.ex5 from 2015.01.01 00:00 to 2018.01.01 00:00
2019.07.13 23:36:26.041 Core 1  common synchronization completed
2019.07.13 23:36:26.076 Core 1  EURUSD: ticks synchronized already [43 bytes]
2019.07.13 23:38:06.411 Core 1  disconnected
2019.07.13 23:38:06.411 Core 1  connection closed
2019.07.13 23:38:06.411 Tester  stopped by user
2019.07.13 23:38:10.036 Tester  EURUSD: history data begins from 2007.01.01 00:00
2019.07.13 23:38:10.037 Tester  EURUSD: ticks data begins from 2011.12.19 00:00
2019.07.13 23:38:10.037 Core 1  connecting to 127.0.0.1:3000
2019.07.13 23:38:10.037 Core 1  connected
2019.07.13 23:38:10.042 Core 1  authorized (agent build 2085)
2019.07.13 23:38:10.043 Tester  EURUSD,H1 (ICMarkets-MT5): visual testing of Experts\Advisors\MyFirstNeuralNetwork.ex5 from 2015.01.01 00:00 to 2018.01.01 00:00
2019.07.13 23:38:10.106 Core 1  common synchronization completed
2019.07.13 23:38:10.147 Core 1  EURUSD: ticks synchronized already [43 bytes]
2019.07.13 23:38:53.754 Core 1  disconnected
2019.07.13 23:38:53.754 Core 1  connection closed
2019.07.13 23:38:53.754 Tester  stopped by user
2019.07.13 23:38:57.591 Tester  EURUSD: history data begins from 2007.01.01 00:00
2019.07.13 23:38:57.592 Tester  EURUSD: ticks data begins from 2011.12.19 00:00
2019.07.13 23:38:57.592 Core 1  connecting to 127.0.0.1:3000
2019.07.13 23:38:57.592 Core 1  connected
2019.07.13 23:38:57.597 Core 1  authorized (agent build 2085)
2019.07.13 23:38:57.598 Tester  EURUSD,H1 (ICMarkets-MT5): visual testing of Experts\Advisors\MyFirstNeuralNetwork.ex5 from 2015.01.01 00:00 to 2018.01.01 00:00
2019.07.13 23:38:57.631 Core 1  common synchronization completed
2019.07.13 23:38:57.704 Core 1  EURUSD: ticks synchronized already [43 bytes]
2019.07.13 23:39:42.020 Core 1  disconnected
2019.07.13 23:39:42.020 Core 1  connection closed
2019.07.13 23:39:42.020 Tester  stopped by user
2019.07.13 23:39:50.592 Tester  EURUSD: history data begins from 2007.01.01 00:00
2019.07.13 23:39:50.593 Tester  EURUSD: ticks data begins from 2011.12.19 00:00
2019.07.13 23:39:50.593 Core 1  connecting to 127.0.0.1:3000
2019.07.13 23:39:50.593 Core 1  connected
2019.07.13 23:39:50.598 Core 1  authorized (agent build 2085)
2019.07.13 23:39:50.599 Tester  EURUSD,H1 (ICMarkets-MT5): visual testing of Experts\Advisors\MyFirstNeuralNetwork.ex5 from 2015.01.01 00:00 to 2018.01.01 00:00
2019.07.13 23:39:50.655 Core 1  common synchronization completed
2019.07.13 23:39:50.714 Core 1  EURUSD: ticks synchronized already [43 bytes]
2019.07.13 23:42:25.997 Core 1  disconnected
2019.07.13 23:42:25.997 Core 1  connection closed
2019.07.13 23:42:25.998 Tester  stopped by user
2019.07.13 23:43:57.138 Tester  EURUSD: history data begins from 2007.01.01 00:00
2019.07.13 23:43:57.138 Tester  EURUSD: ticks data begins from 2011.12.19 00:00
2019.07.13 23:43:57.139 Core 1  connecting to 127.0.0.1:3000
2019.07.13 23:43:57.139 Core 1  connected
2019.07.13 23:43:57.144 Core 1  authorized (agent build 2085)
2019.07.13 23:43:57.145 Tester  EURUSD,H1 (ICMarkets-MT5): visual testing of Experts\Advisors\MyFirstNeuralNetwork.ex5 from 2015.01.01 00:00 to 2018.01.01 00:00
2019.07.13 23:43:57.189 Core 1  common synchronization completed
2019.07.13 23:43:57.261 Core 1  EURUSD: ticks synchronized already [43 bytes]
2019.07.13 23:51:18.696 Core 1  disconnected
2019.07.13 23:51:18.696 Core 1  connection closed
2019.07.13 23:51:18.696 Tester  stopped by user
2019.07.13 23:51:44.502 Tester  EURUSD: history data begins from 2007.01.01 00:00
2019.07.13 23:51:44.503 Tester  EURUSD: ticks data begins from 2011.12.19 00:00
2019.07.13 23:51:44.503 Core 1  connecting to 127.0.0.1:3000
2019.07.13 23:51:44.503 Core 1  connected
2019.07.13 23:51:44.508 Core 1  authorized (agent build 2085)
2019.07.13 23:51:44.509 Tester  EURUSD,H1 (ICMarkets-MT5): visual testing of Experts\Advisors\MyFirstNeuralNetwork.ex5 from 2015.01.01 00:00 to 2018.01.01 00:00
2019.07.13 23:51:44.580 Core 1  common synchronization completed
2019.07.13 23:51:44.626 Core 1  EURUSD: ticks synchronized already [43 bytes]
2019.07.13 23:58:31.557 Core 1  disconnected
2019.07.13 23:58:31.557 Core 1  connection closed
2019.07.13 23:58:31.558 Tester  stopped by user
2019.07.13 23:58:36.692 Tester  EURUSD: history data begins from 2007.01.01 00:00
2019.07.13 23:58:36.693 Tester  EURUSD: ticks data begins from 2011.12.19 00:00
2019.07.13 23:58:36.693 Core 1  connecting to 127.0.0.1:3000
2019.07.13 23:58:36.694 Core 1  connected
2019.07.13 23:58:36.699 Core 1  authorized (agent build 2085)
2019.07.13 23:58:36.700 Tester  EURUSD,H1 (ICMarkets-MT5): visual testing of Experts\Advisors\MyFirstNeuralNetwork.ex5 from 2015.01.01 00:00 to 2018.01.01 00:00
2019.07.13 23:58:36.733 Core 1  common synchronization completed
2019.07.13 23:58:36.828 Core 1  EURUSD: ticks synchronized already [43 bytes]
2019.07.14 00:21:25.806 Core 1  connection closed
aber wenn es denn mal klappt, dann kriege ich auf jeden fall die richtigen RSI werte :)
 

Ich glaube das geht nicht in der OnInit: iRSI(my_symbol,...). Poste den kompletten EA hier. RSI_Handle muss global deklariert werden.

Und was soll das sein:

int RSI_Handle = RSI_Handle =iRSI(my_symbol,my_timeframe,inp_RSIperiod,PRICE_CLOSE);
Guck erstmal, dass Du den normalen Start hinkriegst bevor Du Deinen Algorithmus anwirfst.
 

Meine Frage bezog sich noch auf das Array mit Init :-)

Ist schon spät ...hab es wieder gelöscht.

 

nicht erschrecken: der code ist eine riesen Baustelle mit 100en Kommentaren.

(der RSI part findet sich in der funktion "Switch_Input_Types(int Case, int i)", aber da er ja nun funktioniert, liegt der problemfokus eher auf der initialisierung selbst.

 

Also alles, was in der OnInit steht erstmal nach MyOnInit verschieben und my_symbol, my_timeframe solltest Du initialisieren. Oder gleich _Symbol / _Period nehmen.

Und wenn der Tester nicht in die OnInit springt, würde ich mal ins lokale Tester Log schauen.