Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 548

 
evillive:

Digits , too, should preferably be "pulled" from the appropriate symbol ;)

Thank you, it's working.
 
artmedia70:
And that's not all. To normalize the price of another symbol, you should take digits from another symbol as well. Besides, I should not normalize the real number but use DoubleToString();

to output it in comments.

I don't care about comments, the most important thing for me is to open orders, but the terminal still generates an error, even with DoubleTtoStr(), it writes wrong prices.

 
Example2:

I don't care about comments, the most important thing is that orders would open, but the terminal still generates an error, even with DoubleTtoStr(), it writes the wrong prices.

The remarks made are correct. The normalization sometimes fails but it is not good. You should write to the developers in MetaTrader 4 Client Terminal build 610 for checking. But I have only managed to reproduce incorrect normalization twice

DoubleTtoStr() will cut but the number itself will not change because of this, it may cause an error when comparing variables, placing orders, etc. I can't say right now how important it is when setting an order 1 in the 16th bit, but comparing numbers is definitely incorrect.

 
GSB:

The remarks you made are correct, but the fact that normalization sometimes fails is not good. You should write to MetaTrader 4 Client Terminal build 610 to the developers for verification. But I have only managed to reproduce incorrect normalization for two times

DoubleTtoStr() will cut but the number itself will not change because of this, it may cause an error when comparing variables, placing orders, etc. I can't say right now how important it is when setting an order 1 in the 16th bit, but comparing numbers is definitely incorrect.

The Expert Advisor opens orders only once, so does it have to be written for each pair separately?
 
Example2:
The Expert Advisor opens orders every once in a while, so it has to be written for each pair separately?
No, it does not. Orders are unlikely to open "intermittently" for this reason, look at the log and before you place an order, make sure to ResetLastError(); and then if(GetLastError()>1) Print(GetLastError() ); and make sure to correct the error with Digits
 
GSB:
No, you don't. Orders are unlikely to open "intermittently" for this reason, see the log and before placing an order, be sure to ResetLastError(); and then if(GetLastError()>1) Print(GetLastError() ); And be sure to correct the Digits

error.

GetLastError() says "wrong prices". I already took the Digits separately for each currency pair.
 
Example2:

GetLastError() says "wrong prices". Digits I have already taken separately for each currency pair.

Have you taken the Stop-Level into account? Check what it is with the script
 
GSB:

Has the stop level been taken into account? What does it amount to, check with the script


I have market orders.

 

129 error occurs when the price has time to change before the DC executes your order, use a bigger slippage.

 
GSB:

No it does not, if you put int slippage first it will allocate 4 bytes, so you must add up to 8 (int reserve) or use long instead of int


There is one more strange moment here. If it is an element of a string structure, then if the number of variable characters of this string type is more than 7, will we place it above the others? Because strings always have a null-character \n at the end of the string, and if there are more than 7 items in the string, for example, 8 items, then the string will have 8 + 1 bytes, because 8 + \n. Right?
Reason: