Errors, bugs, questions - page 1220

 

Error in description or implementation '\n'

void OnStart()
{
        ushort ch = '\n';
        Print( int(ch) );
}

Result: 10 and the description says 13

https://www.mql5.com/ru/docs/basis/types/integer/symbolconstants

 

You cannot resize(ArrayResize) an array of const pointers , while const refers to a pointer, not an array

class A {};
void f()
{
        const A * array1[];
              A * array2[];
        ArrayResize( array1, 1 ); //ошибка компиляции
        ArrayResize( array2, 1 );
}
and not const you can. What's the difference?
 

Memory leakage,

class XYZ {
};
class A {
public:
};
void OnStart()
{
        A *a = new A();
}

Result:

but... XYZ object - was not created! Since sometimes className is specified correctly, the error is probably not just in the name

 

Execution error: crash

class A {
public:
           void    operator=( A* a ) { f( a ); }
    virtual void           f( A* a ) {}
};
class B : public A {
public:
    virtual void           f( A* a ) {}
                A        *g() { return ( new B() ); }
};
void OnStart()
{
        B b;
        B c = b.g();
}

build 989

 

Why doesn't this option work in MQL?

static const int size=10;
int array[size];
 
A100:

Execution error: crash

build 969

Thanks for the messages! Check
 
Good afternoon, am I the only one with this picture on the website or does everyone have it?)
 
Mechanic:
Good afternoon, am I the only one with this picture on the site or does everyone have it?)
Sorry, it looks like I'm the only one - I need to clean my computer today
 
meat:

Why doesn't this option work in MQL?

Otherwise const could not be made computable

int f() { return ( 1 ); }
static const int size = f();

void OnStart()
{
        int array[];
        ArrayResize( array, size );
}
 

Error

Challenge:

 Bars(Symbol(),PERIOD_D1);

Leads to a message in the logbook:

HistoryBase 'RTS-12.14' 1 invalid bars removed


I'm fed up with this error. Amongst other things, it's also loading up the communication channel.

The same error appears for other, unidentified reasons.

But, interestingly, it doesn't appear on many other instruments. It appears the most on the RTS futures.


I wrote to servicedesk a few months ago - no reply(Request started: 2014.07.28 13:41, #1046215).


I am attaching the code of the induke that causes this error on every tick of the current (and past) RTS futures (demo account with broker "O..."):

#property version   "1.00"
#property indicator_separate_window
int OnInit(){return(INIT_SUCCEEDED);}
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[])
{
   Bars(Symbol(),PERIOD_D1);
   return(rates_total);
}

Is this a bug in the terminal? Or at the broker? Or me?

What should I do? How can I know number of bars on D1 timeframe otherwise?

Reason: