FORTS Bitte helfen Sie - Seite 4

 
alexvd:
Der Servicedesk hat Ihnen den Quellcode gegeben. Versuchen Sie, Ihren letzten Code in die Funktion Test() einzufügen.
Dima_S:
Michael, ich verstehe deine Hartnäckigkeit nicht. Oder Sie haben Probleme beim Kopieren/Einfügen)). Probieren Sie meinen Code aus und Sie werden angenehm überrascht sein.
Mikalas gehört zu seinem Repertoire. Ein Mann ist kein Leser, er ist ein Schriftsteller.)
 
Dima_S:
Michael, ich verstehe deine Hartnäckigkeit nicht. Oder Sie haben ein Problem mit Kopieren/Einfügen)) Testen Sie meinen Code - Sie werden angenehm überrascht sein.
2015.03.26 18:12:41.068 Test_dima (MIX-6.15,M1) Get Bars failed RTS-6.15 Last error = 4401
2015.03.26 18:12:41.068 Test_dima (MIX-6.15,M1) Get Bars failed RTS-6.15 Last error = 4401
2015.03.26 18:12:41.068 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:41.698 Test_dima (MIX-6.15,M1) Get Bars failed Si-6.15 Last error = 4401
2015.03.26 18:12:41.698 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:41.858 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:41.858 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:41.978 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:41.978 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:43.230 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:43.230 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:45.134 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:45.134 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:46.244 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:46.244 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:46.314 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:46.314 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:46.314 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:46.314 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:46.314 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:46.314 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:46.324 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:46.324 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:46.334 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:46.334 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:46.664 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:46.664 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:47.704 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:47.704 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:47.834 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:47.834 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:47.854 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:47.854 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:47.974 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:47.974 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:49.014 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:49.014 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:49.044 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:49.044 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:49.304 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:49.304 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:49.324 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:49.324 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:49.344 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:49.344 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:49.364 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:49.364 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:49.394 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:49.394 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:49.404 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:49.404 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:49.474 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:49.474 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:49.494 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:49.494 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:49.514 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:49.514 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:49.524 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:49.524 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:49.564 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:49.564 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:49.594 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:49.594 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:49.614 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:49.614 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:49.634 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:49.634 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:49.654 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:49.654 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:49.674 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:49.674 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:49.724 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:49.724 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:49.754 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:49.754 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:49.774 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:49.774 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:49.794 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:49.794 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:49.814 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:49.814 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:49.854 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:49.854 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:50.374 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:50.374 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:50.484 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:50.484 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:50.504 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:50.504 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:50.524 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:50.524 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:50.554 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:50.554 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:50.574 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:50.574 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:50.604 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:50.604 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:50.634 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:50.634 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:50.664 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:50.664 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:50.684 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:50.684 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:50.764 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:50.764 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:50.784 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:50.784 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:50.824 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:50.824 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:50.834 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:50.834 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:50.854 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:50.854 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:50.874 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:50.874 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:50.884 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:50.884 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:50.934 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:50.934 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:50.954 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:50.954 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:50.974 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:50.974 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:50.994 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:50.994 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:51.004 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:51.004 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:51.034 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:51.034 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:51.064 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:51.064 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:51.094 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:51.094 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:51.104 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:51.104 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
2015.03.26 18:12:51.134 Test_dima (MIX-6.15,M1) Init OK.
2015.03.26 18:12:51.134 Test_dima (MIX-6.15,M1) Sorry! Get Bars failed.
 
Mikalas:

Das kann nicht richtig sein. Sie haben eine Art Systemfehler. Ich meine im Terminal)).

Versuchen Sie zunächst, die Verlaufsdaten von der Festplatte zu löschen und das Terminal neu zu starten.

 
Dima_S:

Das kann nicht richtig sein. Sie haben eine Art Systemfehler. Ich meine im Terminal)).

Versuchen Sie zunächst, die Verlaufsdaten von der Festplatte zu löschen und das Terminal neu zu starten.

In Ihrem Code müssen Sie direkt nach ResetLastError() den Fehler in der globalen Variable is_failed löschen. Andernfalls erhalten Sie eine entsprechende Meldung, sobald Sie einen Fehler entdeckt haben
 
Dima_S:

Das kann nicht richtig sein. Sie haben eine Art Systemfehler. Ich meine, im Terminal))

Versuchen Sie zunächst, die Verlaufsdaten von der Festplatte zu löschen und das Terminal neu zu starten.

Was meinen Sie mit "das kann nicht sein"?

Wollen Sie damit andeuten, dass ich Protokolle verfälsche?

 
komposter:
Mikalas gehört zu seinem Repertoire. Ein Mann ist kein Leser, ein Mann ist ein Schriftsteller.)

komposter!

Wenn man etwas nicht versteht oder missversteht, nennt einen niemand Tschuktsch.

Warum sollten sie?

 

Lass uns Freunde sein :)

alexvd:
Gerade in Ihrem Code, in dem Sie unmittelbar nach ResetLastError() rechnen, müssen Sie den Fehler in der globalen Variable is_failed zurücksetzen. Andernfalls erhalten Sie eine entsprechende Meldung, sobald Sie einen Fehler entdeckt haben.

Aber nicht sofort - sondern bei erfolgreicher Belastung.

#property copyright "Copyright 2014, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_plots   1
//
bool is_failed = false;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
  SymbolSelect( "MIX-6.15", true );
  SymbolSelect( "RTS-6.15", true );
  SymbolSelect( "Si-6.15", true );
//---  
  ResetLastError();
//---  
  int total_bars = Bars( "MIX-6.15", PERIOD_M1 );
  if ( total_bars > 0 )
  {
    total_bars = Bars( "RTS-6.15", PERIOD_M1 );
    if ( total_bars > 0 )
    {
      total_bars = Bars( "Si-6.15", PERIOD_M1 );
      {
        if ( total_bars > 0 )
        {
          Print( "Init OK." );
        }
        else
        {
          is_failed = true;
          Print( "Get Bars failed Si-6.15 Last error = ", string(GetLastError() ) );
        }
      }
    }
    else
    {
      is_failed = true;
      Print( "Get Bars failed RTS-6.15 Last error = ", string(GetLastError() ) );
    }
  }
  else
  {
    is_failed = true;
    Print( "Get Bars failed MIX-6.15 Last error = ", string(GetLastError() ) );
  } 
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
  ResetLastError();
//---  
  int total_bars = Bars( "MIX-6.15", PERIOD_M1 );
  if ( total_bars > 0 )
  {
    total_bars = Bars( "RTS-6.15", PERIOD_M1 );
    if ( total_bars > 0 )
    {
      total_bars = Bars( "Si-6.15", PERIOD_M1 );
      {
        if ( total_bars > 0 )
        {
          is_failed = false;
          Print( "Init OK." );
        }
        else
        {
          is_failed = true;
          Print( "Get Bars failed Si-6.15 Last error = ", string(GetLastError() ) );
        }
      }
    }
    else
    {
      is_failed = true;
      Print( "Get Bars failed RTS-6.15 Last error = ", string(GetLastError() ) );
    }
  }
  else
  {
    is_failed = true;
    Print( "Get Bars failed MIX-6.15 Last error = ", string(GetLastError() ) );
  } 
//---
   if ( is_failed )
   {
     Print( "Sorry! Get Bars failed." );
   }
   else Print( "Bingo! We done.");
//--- return value of prev_calculated for next call
   return(rates_total);
  }
 
MigVRN:

Lass uns Freunde sein :)

Nicht sofort - aber mit einem erfolgreichen Download.

Das ist in Ordnung. Das ist keine Frage des Prinzips.

 
alexvd:

So kann man es machen. Das ist keine große Sache.

Oh, nun... Sie können also alles auf einmal machen.

Mikalas:

Nach Ihren letzten Protokollen zu urteilen, wird der Fehler von der Funktion 3 Mal zurückgegeben. 2 Mal während der Initialisierung und 1 Mal inOnCalculate(). Es funktioniert also alles :)

 
MigVRN:

Ach ja, richtig... Es stellt sich heraus, dass man alles auf einmal machen kann.

Nach Ihren letzten Protokollen zu urteilen, wird von der Funktion 3 Mal ein Fehler zurückgegeben. 2 Mal während der Initialisierung und 1 Mal inOnCalculate(). Es hat also funktioniert :)

Ja, aber was ist, wenn es wirklich keine Daten gibt?

Was dann? Zyklus? mit wie vielen Iterationen?

Grund der Beschwerde: