does anyone can explain?
amando
does anyone can explain?
amando
Explain what ? It's pretty clear and self-explanatory.
If you want to specify an expiry like with MT4, you have to use ORDER_TIME_SPECIFIED and set your expiry time.
Explain what ? It's pretty clear and self-explanatory.
If you want to specify an expiry like with MT4, you have to use ORDER_TIME_SPECIFIED and set your expiry time.
how you mean this Alain?
does this mean i have to use
newOrder.expiration = TimeCurrent() +10*60; for 10 minutes expiration
instead of
newOrder.expiration = ORDER_TIME_SPECIFIED;
?
amando
In case you need a sample. This is a Buy Stop with expired time:
#include <Trade\Trade.mqh> CTrade myTrade; datetime expTime=TimeCurrent()+600; if(myTrade.BuyStop(Lots,SymbolInfoDouble(_Symbol,SYMBOL_ASK)+(100*_Point),NULL,0,0,ORDER_TIME_SPECIFIED,expTime,"Buy Stop")) Print("Order created");
- answered at #4.
-
There is no need to create pending orders in code.
-
The pending has the slight advantage, A) you are closer to the top of the queue (filled quicker), B) there's no round trip network delay (filled quicker.)
Don't worry about it unless you're scalping M1 or trading news.
-
Humans can't watch the screen 24/7, so they use pending orders; EAs can, so no need for pending orders, have it wait until the market reaches the trigger price and just open an order.
-

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
does anyone know how does the experation function fo pending orders Works in MQL5?
i found there is an Void
https://www.mql5.com/en/docs/standardlibrary/expertclasses/expertbaseclasses/cexpertsignal/cexpertsignalexpiration
but also you have the constant from the order Send Function
ENUM_ORDER_TYPE_TIME
Identifier
Description
ORDER_TIME_GTC
Good till cancel order
ORDER_TIME_DAY
Good till current trade day order
ORDER_TIME_SPECIFIED
Good till expired order
ORDER_TIME_SPECIFIED_DAY
The order will be effective till 23:59:59 of the specified day. If this time is outside a trading session, the order expires in the nearest trading time.
when i look back to MT4 this was easy, for 10 Minutes Experation I entered TimeCurrent() + 10*60 and thats all
how it works here?
amando