![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Thank you! The current bid and offer price is zero. Deal Ticket . Ticket order. Right, there's Dad.
Thanks !!! I'll have a look at the retcode !
THANK YOU!!!! I got it! Nowhere without you.
Hello.
I've encountered this problem, which I don't understand at all. Can you explain why in this case NormalizeDouble() does not always work?
I'm adding price and other datato file for current timeframe. About 10% of all entries are strings like:
1971.01.07,00:00,0.5368000000000001,0.5368000000000001,0.5368000000000001,0.5368000000000001,1
The result is independent of the normalization order, I substitute 1, 2, 3, 4, 5, Digits - all the same. Where is the problem?
Hello.
I've encountered this problem, which I don't understand at all. Can you explain why in this case NormalizeDouble() does not always work?
I'm adding price and other datato file for current timeframe. About 10% of all entries are strings like:
1971.01.07,00:00,0.5368000000000001,0.5368000000000001,0.5368000000000001,0.5368000000000001,1
The result is independent of the normalization order, I substitute 1, 2, 3, 4, 5, Digits - all the same. Where is the problem?
There is no ambush. This is what some normalised values look like. see the section in the Reference Manual about this function.
Well in the handbook there is a remark only about the output with Print.
So what function do you use to output these normalised values? :) - Ah, got it. Reading from a file. In the example from the Reference Manual, the Print() function simply prints the number "as it is".
Suppose that not only this function, but all others also "normalise". And how should we then send such a value in the form of prices to a pending order?
And that is exactly how it should be presented. What is required for the order? - Normalized prices. So we normalize them and submit. And it's not our problem what these normalized prices look like when they are printed.)
Moreover, if you output "prices for the current timeframe", it means that these very prices with a large number of decimal places are acceptable as normalized prices on the server. ...This is sort of my conclusion, but I cannot find any counter arguments.
Hello.
I've encountered this problem, which I don't understand at all. Can you explain why in this case NormalizeDouble() does not always work?
I'm adding price and other datato file for current timeframe. About 10% of all entries are strings like:
1971.01.07,00:00,0.5368000000000001,0.5368000000000001,0.5368000000000001,0.5368000000000001,1
The result does not depend on the order of normalization, I substitute 1, 2, 3, 4, 5, Digits - all the same. Where is the problem?
Sooner or later you will accept a small inaccuracy and round off the value.
The same thing happens with real numbers written in binary form (as presented by the computer).
If it is not possible to represent the number with a mantissa of 52 bits (e.g. 0.53680) there is a "slight" inaccuracy...
Hello, could you please tell me how to correctly declare a variable as a type? Here is a sample function naming convention.
string OrderType() {
string Si=";
POSITION_TYPE Type; bool Bull=false;
Bull =PositionGetInteger(POSITION_TYPE,Type);
if ( Bull ) {
if ( Type==POSITION_TYPE_BUY) Si="OP_BUY";
if ( Type==POSITION_TYPE_SELL) Si="OP_SELL";
return (Si); }
ORDER_TYPE ORType;
Bull =OrderGetInteger(ORDER_TYPE,ORType);
if ( Bull ) {
if ( Type==ORDER_TYPE_BUY_LIMIT ) Si = OP_BUY_LIMIT;
if ( Type==ORDER_TYPE_SELL_LIMIT) Si="OP_SELL_LIMIT";
if ( Type==ORDER_TYPE_BUY_STOP) Si="OP_BUY_STOP";
if ( Type==ORDER_TYPE_SELL_STOP) Si="OP_SELL_STOP";
return (Si); }
}
Maybe there is something wrong with it, for example, I haven't tried to get the values of PositionGetInteger and OrderGetInteger functions in this way.
Good afternoon! Could you please tell me how to correctly declare a variable as a type? Here's a sample function overlay.
Maybe there is something wrong with it at all, for example, I haven't tried to get the values of PositionGetInteger and OrderGetInteger functions in this way.