FORTS Veuillez nous aider

 

Bonjour !

Encore une fois, le servodex ne peut pas reproduire l'erreur !

Veuillez compiler ce code et "lancer" l'indicateur sur le symbole MIX-6.15

( pas de MetaEditor )

//+------------------------------------------------------------------+
//|                                                         Test.mq5 |
//|                        Copyright 2014, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#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( "RTS-6.15", true );
  SymbolSelect( "Si-6.15", true );
//---  
  ResetLastError();
//---
  if ( SymbolSelect( "MIX-6.15", true ) )
  {
    long total_bars = long( SeriesInfoInteger( "MIX-6.15", PERIOD_M1, SERIES_BARS_COUNT ) );
    if ( total_bars > 0 )
    {
      if ( SymbolSelect( "RTS-6.15", true ) )
      {
        total_bars = long( SeriesInfoInteger( "RTS-6.15", PERIOD_M1, SERIES_BARS_COUNT ) );
        if ( total_bars > 0 )
        {
          if ( SymbolSelect( "Si-6.15", true ) )
          {
            total_bars = long( SeriesInfoInteger( "Si-6.15", PERIOD_M1, SERIES_BARS_COUNT ) );
            if ( total_bars > 0 )
            {
              Print( "Init OK." );
            }
            else
            {
              is_failed = true;
              Print( "Get Bars failed RTS-6.15 Last error = ", string(GetLastError() ) );
            }    
          }
          else
          {
            is_failed = true;
            Print( "Symbol Si-6.15 not selected" );
          }
        }
        else
        {
          is_failed = true;
          Print( "Get Bars failed RTS-6.15 Last error = ", string(GetLastError() ) );
        }
      } 
      else
      {
        is_failed = true;
        Print( "Symbol RTS-6.15 not selected" );
      }
    }
    else
    {
      is_failed = true;
      Print( "Get Bars failed MIX-6.15 Last error = ", string(GetLastError() ) );
    }
  } 
  else
  {
    is_failed = true;
    Print( "Symbol MIX-6.15 not selected" );
  } 
//---
   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[])
  {
//---
   if ( is_failed )
   {
     Print( "Sorry! Get Bars failed." );
   }
   else Print( "Bingo! We done.");
//--- return value of prev_calculated for next call
   return(rates_total);

Veuillez poster les résultats (qui seront affichés dans l'onglet Experts) ici.

 
2015.03.26 11:44:13.934	test (MIX-6.15,H1)	Bingo! We done.
2015.03.26 11:44:13.934	test (MIX-6.15,H1)	Init OK.

tous les instruments disponibles sont inclus dans l'étude de marché.

J'ai retravaillé le test. J'ai lancé exactement sur MIX avec tous les autres instruments inclus.

Tout va bien.

 

Le compte est réel dans Otkritie. Les graphiques Ri et Si sont également ouverts.

 
2015.03.26 13:56:05.487 Test (MIX-6.15,M1) Bingo ! Nous avons fait.
2015.03.26 13:56:05.020 Test (MIX-6.15,M1) Bingo ! Nous avons fait.
2015.03.26 13:56:02.566 Test (MIX-6.15,M1) Bingo ! Nous avons fait.
2015.03.26 13:56:02.566 Test (MIX-6.15,M1) Bingo ! Nous avons fait.
2015.03.26 13:56:02.560 Test (MIX-6.15,M1) Bingo ! Nous avons fait.
2015.03.26 13:56:01.232 Test (MIX-6.15,M1) Bingo ! Nous avons fait.
2015.03.26 13:56:01.232 Test (MIX-6.15,M1) Bingo ! Nous avons fait.
2015.03.26 13:56:01.144 Test (MIX-6.15,M1) Bingo ! Nous avons fait.
2015.03.26 13:56:01.024 Test (MIX-6.15,M1) Bingo ! Nous avons fait.

2015.03.26 13:56:01.024 Test (MIX-6.15,M1) Init OK.

Ouverture réelle win7 x64 C:\Program Files\Open Broker\terminal64.exe build 1085


 

Merci !

Je l'ai fait :

Win7/64 Ultimate MT5 build 1085

2015.03.26 15:30:37.229 Test (MIX-6.15,M1)      Sorry! Get Bars failed.
2015.03.26 15:30:37.229 Test (MIX-6.15,M1)      Get Bars failed RTS-6.15 Last error = 4401
 

Je suis en train de tomber en panne sur MIX-6.15, WIN 7-64 home premium MT5 build 1085 :

2015.03.26 15:44:27.729 Test (MIX-6.15,H1)      Get Bars failed MIX-6.15 Last error = 4401
2015.03.26 15:44:27.729 Test (MIX-6.15,H1)      Sorry! Get Bars failed.
 

Utilisateurs de FORTS !

Veuillez prendre 3 minutes de votre temps !

Pour réparer l'erreur "flottante", vous devez

PLUS de statistiques !

 
Mikalas:

Utilisateurs de FORTS !

Veuillez prendre 3 minutes de votre temps !

Pour réparer l'erreur "flottante", vous devez

PLUS de statistiques !

Dépense 3 min))

Michael, tu ne peux pas faire ça - avec une seule demande dans l'inite. Il n'y a aucune garantie que toutes les données soient prêtes.

C'est comme ça qu'on fait - par le sens, bien sûr.

#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 )
        {
          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);
  }
 

Un indicateur multi-devises n'est pas si simple.

Tout d'abord, vérifiez la disponibilité des instruments :

bool CorrectSymbol( string symbol )
{
        ResetLastError();
        if ( SymbolInfoDouble( symbol, SYMBOL_BID ) > DBL_EPSILON ) return(true);

        // символ не выбран в "Обзоре рынка" (нет в списке доступных)
        if ( GetLastError() == 4302 )
        {
                if ( SymbolSelect( symbol, true ) && SymbolInfoInteger( symbol, SYMBOL_SELECT ) ) return(true);
        }

        return(false);
}

Ouvrez ensuite les graphiques de tous les instruments utilisés (un objet graphique invisible suffit) afin que l'historique soit chargé normalement.

Et seulement ensuite, essayez de charger l'historique en utilisant CheckLoadHistory.

Mais cela pourrait ne pas suffire non plus.

 
Dima_S:

Dépenser 3 minutes))

Michael, vous ne pouvez pas faire ça - avec une demande unique à l'Inite. Il n'y a aucune garantie que toutes les données soient déjà prêtes.

C'est comme ça qu'on fait - par le sens, bien sûr.

Je suis d'accord, c'est un peu faux, j'ai réécrit le code (voir le code source), MAIS le résultat est le même !

2015.03.26 16:20:55.564 Test (MIX-6.15,M1)      Sorry! Get Bars failed.
2015.03.26 16:20:55.564 Test (MIX-6.15,M1)      Get Bars failed Si-6.15 Last error = 4401
 
Mikalas:

D'accord, un peu incorrect, j'ai réécrit le code, MAIS le résultat est le même !

Avez-vous essayé le mien ?
Raison: