Errors, bugs, questions - page 3085

 
Ivan Titov #:

The graphs all show up. I would like a clearer message instead of "history check timeout" to understand the reason.

Send all data for playback. Only ticks are possible.

 
fxsaber #:

Send all the data for playback. Only ticks are possible.

There are no ticks, only minute bars. But the simulation stands OHLC on M1. It used to work.

Files:
Test.ZIP  9375 kb
 
Ivan Titov #:

There are no ticks, only minute bars. But the simulation stands OHLC on M1. It used to work before.

Unfortunately, I cannot say anything about this working mode. I only run it by "real ticks".

 
Dmitriy Skub #:

Nah, you got excited too soon.

2021.09.12 11:59:20.806 Experts initializing of XXXXXXXL (USDSEK,H1) failed with code 0(prepare for execution failed)

It crashes out of debug until the point OnInit.

Waiting for 3039

Please provide EX5 file for investigation

 

Hello. I can't figure out how to initialize static arrays in MQL. I tried to do it in the following way:

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
struct S_MA_MethodAndName {
  ENUM_MA_METHOD method;
  string desc;
};

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
class MA_MethodInfo {
public:
  MA_MethodInfo() {}
  ~MA_MethodInfo() {}

  static const S_MA_MethodAndName info[4];
};

S_MA_MethodAndName MA_MethodInfo::info = { {MODE_SMA, "Simple"}, {MODE_EMA, "Exponential"}, {MODE_SMMA, "Smoothed"}, {MODE_LWMA, "Linear Weighted"} };

But when I try to compile this code, it generates the following error:

'info' - redefinition; different type modifiers

Are such constructions possible in MQL, or maybe I'm doing something wrong?
 
Mihail Matkovskij #:

I can't figure out how to initialise static arrays in MQL.

static const S_MA_MethodAndName MA_MethodInfo::info[4] = { {MODE_SMA, "Simple"}, {MODE_EMA, "Exponential"}, {MODE_SMMA, "Smoothed"}, {MODE_LWMA, "Linear Weighted"} };
 
fxsaber #:

Strange. VS, for example, swears at static:

Allowed only:

const S_MA_MethodAndName MA_MethodInfo::info[4] = { {MODE_SMA, "Simple"}, {MODE_EMA, "Exponential"}, {MODE_SMMA, "Smoothed"}, {MODE_LWMA, "Linear Weighted"} };

And I've never had to do anything like that in MQL. That's why I decided to ask it on the forum. Thank you!

 

Also, static constants in MQL do not need the static keyword:

class C1 {
public:
  static const int value;
};

const int C1::value = 3;

But in case of an array, it must be mandatory:. It turns out a bit different than in C++.

 
On ios I see new message in notifications, but it's not in the app itself mt4

p.s comes, but with a delayed update
 
Ilyas #:

Please provide an EX5 file for examination

Submitted by.
Reason: