Files
mql5-skills/skills/mql5/references/docs/34-standardlibrary/3387-standardlibrary-tradeclasses-ctrade-ctradeordermodify.md
T
2026-06-23 21:47:51 +08:00

55 lines
1.9 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# OrderModify
Modifies the pending order parameters.
```
bool  OrderModify(
   ulong                 ticket,         // order ticket
   double                price,          // execution price
   double                sl,             // Stop Loss price
   double                tp,             // Take Profit price
   ENUM_ORDER_TYPE_TIME  type_time,      // type by expiration
   datetime              expiration,     // expiration
   double                stoplimit       // Limit order price 
   )
```
Parameters
ticket
[in]  Order ticket.
price
[in] The new price by which the order must be executed (or the previous value, if the change is not necessary).
sl
[in] The new price by which the Stop Loss will trigger (or the previous value, if the change is not necessary).
tp
[in] The new price by which the Take Profit will trigger (or the previous value, if the change is not necessary).
type_time
[in] The new type of order by expiration from [ENUM_ORDER_TYPE_TIME](/en/docs/constants/tradingconstants/orderproperties#enum_order_type_time) enumeration (or the previous value, if the change is not necessary).
expiration
[in] The new expiration date of pending order (or the previous value, if the change is not necessary).
stoplimit
[in]  New price used for setting a Limit order when the price reaches price value. It is specified only for StopLimit orders.
Return Value
true - successful check of the basic structures, otherwise - false.
Note
Successful completion of the OrderModify(...) method does not always mean successful execution of the trade operation. It is necessary to check the result of trade request (trade server return code) using [ResultRetcode()](/en/docs/standardlibrary/tradeclasses/ctrade/ctraderesultretcode).