Errors, bugs, questions - page 2141

 
Комбинатор:
What about events from a chart? To be honest, I haven't worked with OBJ_CHART scripts

A script (especially a looped one) cannot catch events.

 
fxsaber:

A script (especially a looped one) cannot catch events.

Damn right, I'm slow.
 

Compilation error

class A {};
void OnStart()
{
        const A *a = new const A; //Error: 'const' - identifier expected
}
 
A100:

Compilation error

It looks like a dynamic constant object cannot be created.

 

How does this differ in meaning from

const A *a = new A;
?
 
Комбинатор:

And how is this different in meaning from

?

When there is no const_cast, nothing.

 
Комбинатор:

How does this differ in meaning from

?

There is an error in the template when substituting

class B {};
template<typename T>
struct A {
    T *f1() { return new T; } //Error: 'T' - identifier expected
    T *f2() { return t;     } //нормально
    T *t;
};
void OnStart()
{
        A<      B> a1; //нормально
        A<const B> a2;
}
class B {};
template<typename T>
void f() { T *t = new T; }
void OnStart()
{
        f<      B>(); //нормально
        f<const B>(); //Error: 'T' - identifier expected
}
 
Vladimir Pastushak:

Indicators do not always return ACCOUNT_LOGIN when starting the terminal

0 11:00:01.880 Custom indicator tester EURUSD,H1: loaded successfully
0 11:00:01.887 tester EURUSD,H1: OnInit 0 < ---- AccountInfoInteger(ACCOUNT_LOGIN) returned 0
0 11:00:01.887 tester EURUSD,H1: initialized
0 11:00:01.887 tester EURUSD,H1: OnCalculate 0 < ---- AccountInfoInteger(ACCOUNT_LOGIN) returned 0
0 11:00:05.980 tester EURUSD,H1: OnCalculate 0 < ---- AccountInfoInteger(ACCOUNT_LOGIN) returned 0
0 11:00:06.654 tester EURUSD,H1: OnCalculate 0 < ---- AccountInfoInteger(ACCOUNT_LOGIN) returned 0
0 11:00:07.030 tester EURUSD,H1: OnCalculate 442394 < ---- AccountInfoInteger(ACCOUNT_LOGIN) returned account number
0 11:00:07.040 tester EURUSD,H1: OnCalculate 442394 < ---- AccountInfoInteger(ACCOUNT_LOGIN) returned account number

Source code

I may be wrong but in my opinion no program can work if account number is not known.....

10 years almost as posted https://www.mql5.com/ru/code/8007

Specification
Specification
  • votes: 3
  • 2008.03.24
  • MetaQuotes Software Corp.
  • www.mql5.com
Иногда возникает необходимость вывести информацию в виде таблицы или в несколько строк с соблюдением табуляции. Просто вывести в главное окно несколько строк не проблема, используйте Comment(строка_1,"\n",строка_2,"\n"...). См. пример Comment2 Но функция Comment () выводит только в главное окно графика, иногда же требуется вывод в подокно...
 
A100:

There is an error in the template when substituting

Yeah, I didn't get to the template. I've never used such a construction before, I was stupid. I wonder where it could have a practical application.

 
A100:

An error occurs in the template when substituting

yes, and it compiles in pluses. you need either compile or const_cast