[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 464
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
Can you tell me which function should close half of the order, OrderClose() or OrderCloseBy()?
If there is an open order and only part of it needs to be closed, it is sufficient to use OrderClose() with specifying the volume to be closed.
Can you tell me which function should close half of the order, OrderClose() or OrderCloseBy()?
Closing half of the order volume:
Close half of the order volume:
OrderSelect() before OrderClose() is not required.
OrderSelect() before OrderClose() is not required.
is required, as it uses OrderLots
In that case:
- first, we have to check the result returned by OrderSelect();
- Secondly, we need to keep an eye on the volume obtained in the process of division, or else it might not close at all.
PapaYozh, MaxZ The lot is 0.1, when calculating 30 ( ClosingPercent = 30) percentages should be 0.03, but error 131 occurs when closing with this lot.
PapaYozh, MaxZ The lot is 0.1, in the calculation of 30 ( ClosingPercent = 30) percentages should be 0.03, but error 131 occurs when closing with this lot.
Why do you normalize the volume to 3 digits?
PapaYozh, MaxZ It is 0.1 lot, when calculating 30 ( ClosingPercent = 30) percent should be 0.03, but error 131 occurs when closing with this lot
1) why normalize to 3 digits?
2) probably the minimum lot is 0.1 and then a smaller lot is in principle unavailable.
Why do you normalise the volume to 3 digits?
Well, if the lot is 0.10, you can't close 30%. But I tried to normalise to 2 digits with 1 lot and still the same error.
Well so if the lot is 0.10 then you can't close 30% already. But I've tried normalising to 2 digits with lot 1 and still the same error.
the digits are not counted as a whole, but after the decimal point.
i.e. normalising the number 10.044425 to 2 digits will result in the number 10.04
Yes, and where is your order selection before using OrderLots?