Errors, bugs, questions - page 2207

 
pavlick_:

This is a predicate for binary search, which is not universal and is used only once in one function, why should I put it somewhere? For example, we have an array of structures (no comparison operator, you can't compare them clumsily with <, or the comparison condition is very tricky), and we want to find an element through binary search. In the plus library, algorithm functions take a functor (conveniently passed as a lambda), inside which we compare array elements. A very elegant solution in my opinion.

But due to mcl limitations, created an instance of the predicate class.

By the way, it's interesting how this code will be optimal at compilation ))

 
Konstantin:

By the way, I wonder how this code would be optimal when compiling it ))

The function is easy to inline (stl is all on templates, i.e. the sources are available - a paradise for the compiler), don't worry ))

 

Who has encountered this, can this really happen?

I got one close time in the log and another in the history

Demo account.


i understand correctly that the closing time in the log is 23:34:14.983

and the history is 00:33:32 +1 gtm

 
I'm sitting here wondering how the prefix form code could come in handy ?
++x
 
Aleksey Rodionov:
I'm sitting here wondering how the prefix form code could come in handy ?

Can't be useful in any way, it hasn't worked since some time.

A different design can be used.

for(int i = PositionsTotal(); i-- > 0;)

Instead of

for(int i = PositionsTotal()-1; i >= 0; i--)
 
Alexandr Bryzgalov:

Who has encountered this, can this really happen?

I got one close time in the log and another in the history

Demo account.


i understand correctly that the closing time in the log is 23:34:14.983

and the history is 00:33:32 +1 gtm

Probably in the log is the PC time and in the history is the server time...

 
Aleksey Vyazmikin:

Probably PC time in the log and server time in the history...

other parts of the log coincide with the trades

 
Alexandr Bryzgalov:

the other parts of the log coincide with the transactions

So what does this imply? Either the time on the PC has changed, or the server has changed, or there was a glitch...

 
Aleksey Rodionov:
I'm sitting here wondering how the prefix form code could come in handy ?

It's more a matter of habit, it works in c++ and in mql it's the same as postfix, unless I missed any changes in the language ))

 
Konstantin:

not in mql, it's more a matter of habit, it works in c++, and in mql it's the same as postfix, unless of course I missed any changes in the language ))

as it seems to work in C++. That's what I asked, decided to read C++, for example. Same value by one just in difference. It seems to assign 5 to y in the second case and then add it, while in the first example it first adds and then assigns (it took me a long time to figure out how it works =D )

int x = 5;
int y = ++x;

int x = 5;
int y = x++;
Reason: