[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 248
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
ERR_INVALID_TRADE_VOLUME 131 Incorrect volume - get to know this form and set the volume "right" according to your account type, for example in micro accounts the volume is usually 0.01 lot, in 'classic' accounts = 0.1 lot... Enter a constant value of 0.1 lot into the order opening function and check it out...
Have you tested on weekdays? Is the spread floating?
Why is this alert popping up? I spent a lot of effort to find out that when comparing a digit with a fractional part, I need to normalize it with NormalizeDouble(). But I decided to try it for fun today and the alert pops up! What kind of glitches? Or not glitches?
The EA trades with a certain % of the ekvit, i.e. I can only enter a percentage, e.g. 10, 5, there is no option to enter a lot of 0.1 or 0.01. This problem has only occurred with a 4 digit broker.
Why is this alert popping up? I spent a lot of effort earlier on trying to figure out that when comparing a digit with a fractional part, I needed to normalize it using the NormalizeDouble() function. But I decided to try it for fun today and the alert pops up! What kind of glitches? Or not glitches?
1). The compiler can simply ignore this condition (if statement).
2). If, however, the compiler doesn't ignore this condition, it will write each number to memory and allocate 8 bits for each number. It compares the numbers, not as we do with our eyes, but bit by bit. The numbers in memory are the same and the condition will hold.
I am very surprised by your question, because I can not understand how these two numbers (two records) are not perceived as equal?
You didn't answer my question about the spread.
Following your comment, I tried it on a 4-digit terminal with a fixed spread, everything is OK. But another problem appeared, error number 131, which did not happen on the 5-digit terminal.
Please advise how to do this correctly. My MM calculation function is complex and in one part of it, when calculating the lot, the function returns 0.18 as a maximum possible lot and you can open either 0.1, 0.2 or 0.3, i.e. the step is 0.1.
If I normalize the lot it is rounded down to 0.2 and the order is no longer allowed, although the maximum allowed lot is 0.18. What is the correct way to round it down or to normalize it correctly?
""""...
Я очень удивлён был Вашему вопросу, так как не могу понять как можно два эти числа (две записи) воспринять не равными??""""