Errors, bugs, questions - page 1925

 

Forum on trading, automated trading systems and trading strategy testing

Bugs, bugs, questions

fxsaber, 2017.07.10 20:16

To alleviate a lot of questions about correctly filling out the MqlTradeRequest-structure, I suggest when you press F9 in the terminal while manually filling out the fields, to make a footnote "Details", where all fields of the corresponding trading structure will be visible (with one-click copying option). Now this structure is fully available if you catch it in OnTradeTransaction after pressing F9-window action.

Failed. The implementation of catching the filled structure via OnTradeTransaction can be seen here.

 
Yury Kirillov:

Starting from at least build 1625 MT5 drops when tested.

Bild 1626:

Plays at least in "every tick..." and "all ticks" modes.


Afternoon. Need steps for playback. Need expert/indicator and test settings. Please write to servicedesk.

 
Alexander:

Good afternoon. Need steps for playback. Need expert/indicator and test settings. Please write to servicedesk.


Have written to TA#1794147.

Crash seems to be generated when using HistoryDealGetTicket(i), with a parameter greater than the number of transactions available.

 
Yury Kirillov:

I wrote to TP#1794147.

Crash seems to be generated when using HistoryDealGetTicket(i), with a parameter greater than the available number of transactions.

Yes, I saw it. Thanks

 

No error message

struct A {
        int z;
};
void OnStart()
{
        int const b; //'b' - 'const' variable must be initialized
        A   const a; //нет сообщения об ошибке //по сути равнозначно записи: int const а.z; 
}
Either an explicit constructor or an initialising sequence must be present
 
A100:

No error message

Because of the constructor. So it's OK.

 
fxsaber:

Because of the constructor. So it's OK.

Because of a constructor who does nothing?

struct A {
        A() {}
        int a;
}; 
void OnStart()
{
        const A a; //нормально
}

If it is possible not to initialize const int A::a, then why necessarily initialize const int b in the previous case?

 
A100:

Because of a constructor that does nothing ?

Yes, because of the empty default constructor.

If you can uninitialize const int A::a, then why necessarily initialize const int b in the previous case?

Why does it show Error instead of Warning? Well it can be done this way

void OnStart()
{
  int a;
  const int b = a;
}

IMHO, there must be a Warning when a const variable of a simple type is not initialized. And there shouldn't be Warning when the OrderSend value is not checked. But this seems to be the developers' view of the correct one. I.e. the reasoning is subjective.

 
fxsaber:

Why does it show Error instead of Warning? After all, you can do it this way

Because using an uninitialized constant variable makes no sense - hence the error (it contains a random value and cannot be changed later)

 
A100:

Because using uninitialized constant variable makes no sense - hence the error (it contains a random value and its further use will lead to hard-to-find errors)

I crossed out one word in the quote, but the meaning won't change if there are only read-only operations in the future. For non-const it gives Warning, for const it gives Error. It's just one of the developers' controversial decisions.