[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 250

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
And think about the function code? Find four differences :) :
found the .... distinction...))))) uh-huh...I just dug into a programming textbook and my head's not cooked))
how do I close an order partially? just change the volume of the trade with OrderModify?
how do I close the order partially? just change the volume of the trade with OrderModify?
Open the opposite order with a smaller lot. The difference is the remainder, which should continue to exist.
Close the opposite lot and part of the existing lot with OrderCloseBy().
Open the opposite order with a smaller lot. The difference is the remainder, which should continue to exist.
Close the opposite lot and part of the existing lot with OrderCloseBy().
This kind of trick will not work at Fiver. Don't forget about requotes and slippages too...
I'm sorry, which five? )) We are on MQL4.
I do not take into accountrequotes and slippages as a natural factor. The matter of fact does not change.
I'm sorry, which five? )) We are on MQL4.
I do not take into account requotes and slippages as a natural factor. The essence does not change.
Do what you want - your choice to do two operations instead of one.
"Two operations instead of one" - more details, please. It may prove useful.
To partially close a position with 1.0 lot, you can make one transaction, closing it with a smaller lot, for example 0.5.
Standard function:
__________________________________________________________________________________________________
bool OrderClose( int ticket, double lots, double price, int slippage, color Color=CLR_NONE )
To close the position. Returns TRUE on successful completion of the function. Returns FALSE if the function fails. To get information about the error, call the GetLastError() function.__________________________________________________________________________________________________
But you propose to make two operations:
1. open the opposite position with a smaller lot;
2. Close them counterclockwise, so that the position whose lot was bigger is left.
__________________________________________________________________________________________________
bool OrderCloseBy( int ticket, int opposite, color Color=CLR_NONE)
Closes one open position with another position opened on the same instrument, but in the opposite direction. Returns TRUE on successful completion of the function. Returns FALSE if the function fails. To get information about the error, call the GetLastError() function._________________________________________________________________________________________________
Accordingly, the number of adverse factors doubles per position.
Why?
For partial closing of a position with 1.0 lot you can make one transaction, closing it with a smaller lot, for example 0.5.
Standard function:
__________________________________________________________________________________________________
bool OrderClose( int ticket, double lots, double price, int slippage, color Color=CLR_NONE )
Closing the position. Returns TRUE on successful completion of the function. Returns FALSE if the function fails. To get information about the error, call the GetLastError() function.__________________________________________________________________________________________________
But you suggest to make two operations:
1. open the opposite position with a smaller lot;
2. Close them counterclockwise, so that the position whose lot was bigger is left.
__________________________________________________________________________________________________
bool OrderCloseBy( int ticket, int opposite, color Color=CLR_NONE)
Closes one open position with another position opened on the same instrument, but in the opposite direction. Returns TRUE on successful completion of the function. Returns FALSE if the function fails. To get information about the error, call the GetLastError() function._________________________________________________________________________________________________
Accordingly, the number of adverse factors doubles per position.
Why?
Yes, you have written in exhaustive detail, but nevertheless I didn't see any difference.
Namely, sending a request to open a lot (my variant) or a command to close a part of a lot (your variant) are subject to the same risk of requotes and slippage.
And closing by OrderCloseBy() carries no risk, because requotes and slippage no longer matter, because after opening a lot (my variant), they de facto do not exist, i.e. mutually exclude each other.