I am using the MT4-Manager-API Api, and I want to close trades
at the current market price
, without having to specify it.
So far I have been able to close a previously opened trade
but specifying the closing price
as follows:
c++
code
TradeTransInfo info = { 0 };
info.type = TT_BR_ORDER_CLOSE;
info.order = 98492174;
info.price = 1.30263; // I don't want to have to specify the price.
info.volume = 1;
ExtManager->TradeTransaction(&info);
I also don't want to switch to pumping
mode.
EDIT
The main reason for not wanting to specify the closing price
is because I can't find a way to obtain it by making an API call
, without switching to pumping mode
.
By getting the current price
of the symbol
, I can then solve my problem and use the code shown.