FORTS Please help

 

Good afternoon!

Again the servodex can't reproduce the error!

Please compile this code and "throw" the indicator on the MIX-6.15 symbol

( not from 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);

Please post the results (to be displayed in the Experts tab) here.

 
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.

all available instruments are included in the market review.

Reworked the test. threw exactly on MIX with all other instruments included.

All ok.

 

The account is real in Otkritie. The Ri and Si charts are also open.

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

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

real Opening win7 x64 C:\Program Files\Open Broker\terminal64.exe build 1085


 

Thank you!

I have:

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
 

I've got MIX-6.15 falling down, 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.
 

FORTS users!

Please take 3 min. of your time!

To fix "floating" error - you need

MORE statistics!

 
Mikalas:

FORTS users!

Please take 3 min. of your time!

To fix "floating" error - you need

MORE statistics!

Spending 3 min))

Michael, you can't do that - with a single request in the inite. There is no guarantee that all data is ready.

That's how you do it - by sense, of course.

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

A multi-currency indicator is not that simple.

First, check the availability of the 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);
}

Then open the charts of all the instruments used (an invisible chart object is enough) so that the history is loaded normally.

And only then try to load history using CheckLoadHistory.

But this may not be enough either.

 
Dima_S:

Spending 3 minutes))

Michael, you can't do that - with a one-time request to the Inite. There is no guarantee that all the data is already ready.

That's how you do it - by sense, of course.

I agree, it's a bit wrong, I rewrote the code (see the source code), BUT the result is the same!

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:

Agreed, a bit incorrect, rewrote the code, BUT the result is the same!

Have you tried mine?
Reason: