| / | Forum |
|
ngchunleng
2008.04.18 22:47
Hi, I am writing a simple script. The script requires me to make a series of pending orders depending on the previous order being opened. For example, i made a pending sellstop order #12345. only when this sellstop becomes a market order to sell, then i will make another pending say buystop order. my question here is how do i know if #12345 has progressed from pending sellstop to sell? can i use Time() or OrderType()? Tks for a prompt reply... |
|
Changing the External Parameters of MQL4 Programs without Restarting The article describes a method of changing the external parameters of MQL4 programs on-the-fly, without restarting. |
|
ukt
2008.04.19 18:14
Hello yes - you got it! use OrderType() having already done OrderSelect(...) When a pending order is active it becomes market order and Terminal shows order as OP_BUY||OP_SELL *and not* as OP_BUYLIMIT||OP_SELLLIMIT||OP_BUYSTOP||OP_SELLSTOP for example: OrderSelect(...); int iOrderType = OrderType(); OrderSelect(...); int iOrderType = OrderType(); have fun! btw, could make above snippets into functions() then just call with say ticket# and they return bool or whatever you normally use. eg, bool isPendingOrder ( int iTicket ) {... bool isMarketOrder ( int iTicket ) {... |