Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1858

 

Mihail Matkovskij #:

Why do I need your screenshot if I followed the link and read:https://docs.mql4.com/ru/trading/ordersend

So read it carefully. There, as I write, the opening price without any normalisation.

Mihail Matkovskij#:

Well you can call it what you like :)

I call it what it is, not "as you like".

 
Mihail Matkovskij #:

Stop with the idle chatter.

Don't bring this rudeness to the forum, please.

 

Historically there have been situations where an Ask Bid has come in non-normalised or High/Low/Close incorrect (EMPTY_VALUE), so all incoming data should be checked. There can be server component restarts or reconciliation between peers. There can also be simple errors.

And when sending a trade order, you should make every effort on your part to make sure it is correct. Therefore ALWAYS normalise prices by Digits and volumes by minLot,lotStep.

 
Andrey Sokolov #:

Don't bring that boorishness onto the forum, please.

That's it. No comments.

 
Maxim Kuznetsov a trade order, you have to do your best to make sure that it is correct.

Don't worry about it. He who needs to know. :)

 
Mihail Matkovskij #:

This is because static arrays cannot be dimensioned by variables. A dynamic array should be used instead:

And tell me, is there a difference in processing speed between a static array and a dynamic one?
 
Владимир Казаков #:
And tell me, is there a difference in processing speed between a static array and a dynamic one?

If you compare the handling of two very large arrays, static and dynamic, there may or may not be a difference... In normal use, there is practically no difference.

 

Mihail Matkovskij, Andrey Sokolov, thanks friends, for the clear and quick answer!

There really was an error with OP_SELL, OP_BUY (mixed up due to inattention). I've normalized everything by nDigits, added a check by OrderSend for errors. I hope everything will work. I cannot check it now, the market is closed )). Now till Monday

 
Mihail Matkovskij #:

If you compare 2 very large arrays, static and dynamic, there may or may not be a difference... In normal use, there is almost no difference.

Unfortunately, there is...

The difference in the use of the two functions :

double foo(someargs..) {
   double tmpdata[];
   ArrayResize(tmpdata,100);
   ...
}
static double tmpdatabar[100];
double bar(someargs..) {
   ...
}

will be significant.

If you know in advance the maximum size of the array and it's not too big 🚲

it's better to spread it out beforehand

 
Владимир Казаков #:
Is there a difference in processing speed between a static array and a dynamic one?

What is meant by treatment?

In any case, the existence of a difference and its size to a particular case can be learned from profiling.