Errors, bugs, questions - page 1429

 
Vladimir Pastushak:

Function overload

...and then what?
 
Joo Zepper:
...and then what?

You declared two identical methods, which is not allowed, in case of overloading the methods must respond to each other with a set of internal parameters.

class C_A
{
  void B(int a);
  void B(double a);
};
 
Vladimir Pastushak:

You have declared two identical methods, which is not allowed; in the case of overloading, methods must respond to each other with a set of internal parameters.

I'm aware of the overloading. But that's not what I meant - the ME compiler doesn't notice the error, unlike the console compiler.
 
Joo Zepper:
I'm aware of the overloading. But that's not what I meant - ME compiler doesn't notice the error, unlike console compiler.
Yes, that's true, I also noticed that.
 
Joo Zepper:
I'm aware of the overloading. But that's not what I meant - the ME compiler doesn't notice the error, unlike the console compiler.
It doesn't notice the error until you declare body of this method. That is, it has no effect on program execution.
 
Ilya Malev:
It does not detect an error until you declare the body of that function. That is, it has no effect on program execution.
However, this does not mean that there is no need to fix the behaviour of the ME compiler.
 
Joo Zepper:
however, this does not mean that there is no need to fix the behaviour of the ME compiler.
Indeed, the compiler accepts for prefetching - fix it, an error will be issued.
 

How can this be?

There is an "EA":

//+------------------------------------------------------------------+
//|                                               Exp_TickTest01.mq4 |
//|                        Copyright 2015, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2015, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   Comment("Exp Ask>>",Ask);
   Print("Exp Ask>>",Ask);
  }
//+------------------------------------------------------------------+

And an "indicator" installed in the EA test window:

//+------------------------------------------------------------------+
//|                                               Ind_TickTest01.mq4 |
//|                        Copyright 2015, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2015, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
#property indicator_separate_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   
//---
   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[])
  {
//---
   IndicatorShortName("Ind Ask>>"+DoubleToString(Ask,_Digits));
   Print("Ind Ask>>"+DoubleToString(Ask,_Digits));   
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+

The result of work on the screen:

TickTest01

The result of work in logs (fragment):

2015.11.12 10:07:50.801 2015.11.11 02:17  Ind_TickTest01 EURUSD,M1: Ind Ask>>1.07496
2015.11.12 10:07:50.801 2015.11.11 02:17  Exp_TickTest01 EURUSD,M1: Exp Ask>>1.07429
2015.11.12 10:07:50.737 2015.11.11 02:17  Ind_TickTest01 EURUSD,M1: Ind Ask>>1.07496
2015.11.12 10:07:50.737 2015.11.11 02:17  Exp_TickTest01 EURUSD,M1: Exp Ask>>1.0743
2015.11.12 10:07:50.673 2015.11.11 02:16  Ind_TickTest01 EURUSD,M1: Ind Ask>>1.07496
2015.11.12 10:07:50.673 2015.11.11 02:16  Exp_TickTest01 EURUSD,M1: Exp Ask>>1.0743
2015.11.12 10:07:50.609 2015.11.11 02:16  Ind_TickTest01 EURUSD,M1: Ind Ask>>1.07496
2015.11.12 10:07:50.609 2015.11.11 02:16  Exp_TickTest01 EURUSD,M1: Exp Ask>>1.07429
2015.11.12 10:07:50.545 2015.11.11 02:16  Ind_TickTest01 EURUSD,M1: Ind Ask>>1.07496
2015.11.12 10:07:50.545 2015.11.11 02:16  Exp_TickTest01 EURUSD,M1: Exp Ask>>1.07428
2015.11.12 10:07:50.481 2015.11.11 02:16  Ind_TickTest01 EURUSD,M1: Ind Ask>>1.07496
2015.11.12 10:07:50.481 2015.11.11 02:16  Exp_TickTest01 EURUSD,M1: Exp Ask>>1.07427

The values displayed in the EA and the indicator are different.

It seems that the EA takes data from the tester and the indicator takes current data of the instrument which the EA is tested on.

Release 902.

Files:
 
Yury Kirillov:

How can this be?

There is an "EA":

And an "indicator" installed in the EA test window:

The result is on the screen:

The result of work in logs (fragment):

Values displayed in the EA and the indicator are different.

It looks like the EA takes data from the tester and the indicator takes current data of the instrument which the EA has been tested on.

Release 902.

Thank you for your feedback! Fixed.
 

Alexander:
Спасибо за обращение! Исправлено.

Thank you for your reply!

Has it been fixed already?

Or is it in the next release?

Reason: