- September 24, 2018 at 4:58 pm #2104
The question was whether this function can be used to modify the opening prices of pending orders, or if these orders have to be deleted and re-created at a new price every time. The answer is YES, of course you can change the opening price of a pending order using OrderModify().
Here is a quote from the MQL4 website:
bool OrderModify( int ticket, double price, double stoploss, double takeprofit, datetime expiration, color arrow_color=CLR_NONE)
Modification of characteristics for the previously opened position or pending orders. If the function succeeds, the returned value will be TRUE. If the function fails, the returned value will be FALSE. To get the detailed error information, call GetLastError() function.
Notes: Open price and expiration time can be changed only for pending orders.
If unchanged values are passed as the function parameters, the error 1 (ERR_NO_RESULT) will be generated.
Pending order expiration time can be disabled in some trade servers. In this case, when a non-zero value is specified in the expiration parameter, the error 147 (ERR_TRADE_EXPIRATION_DENIED) will be generated.
You must be logged in to reply to this topic.