Update Open Trade
UpdateOpenTrade¶
Updates the details of an existing open trade based on the provided trade parameters.
int UpdateOpenTrade(const TradeRecord& source_trade);
Parameters¶
- source_trade — constant reference to a TradeRecord structure containing the updated trade parameters.
Return Value¶
RET_OK— trade successfully updated.RET_*— error code if the update fails.- Return Codes
Example¶
TradeRecord tr = {};
tr.order = 123456;
tr.login = 1001;
tr.symbol = "EURUSD";
tr.sl = 1.0520; // New Stop Loss
tr.tp = 1.0820; // New Take Profit
if (UpdateOpenTrade(tr) == RET_OK) {
// Trade updated successfully
}
Warning
- This function modifies parameters of an existing open trade.
- It does not open or close trades — only updates their details.
- Always check the return code to confirm the update was successful.