Download MetaTrader 5

Order Expire in datetime MQL4

To add comments, please log in or register
amando
422
amando  

Helle,

 

in older days, the order expire was a function of Seconds,

 

now it use the datetime and this is a miracle for me since i use MQL4.

can someone help me, how do program on a pending order, that the expiration is after 30 minutes?

 

OrderSend(Symbol(),OP_SELLSTOP,Lots,Price_Sell,Slip,SL,TP,Text,MN,EXPIRATION??????,Red);


 

amando 

  

 PS

@admin, plese do not post this link here, i know you will do it, but i dont understand the crap here

https://docs.mql4.com/basis/types/integer/datetime

Datetime Type - Integer Types - Data Types - Language Basics - MQL4 Reference
Datetime Type - Integer Types - Data Types - Language Basics - MQL4 Reference
  • docs.mql4.com
Datetime Type - Integer Types - Data Types - Language Basics - MQL4 Reference
Stanislav Korotky
19812
Stanislav Korotky  
This is exactly as docs says - expiration time in datetime type. You don't need to bother that it's internally stored as number of seconds passed since epoch. You can use any datetime related functions or simply add seconds to current time.
OrderSend - Trade Functions - MQL4 Reference
OrderSend - Trade Functions - MQL4 Reference
  • docs.mql4.com
OrderSend - Trade Functions - MQL4 Reference
Alain Verleyen
Moderator
31924
Alain Verleyen  
amando:
...

can someone help me, how do program on a pending order, that the expiration is after 30 minutes?



OrderSend(Symbol(),OP_SELLSTOP,Lots,Price_Sell,Slip,SL,TP,Text,MN,TimeCurrent()+30*60,Red);
amando
422
amando  

Thanks

amando
422
amando  
Stanislav Korotky:
This is exactly as docs says - expiration time in datetime type. You don't need to bother that it's internally stored as number of seconds passed since epoch. You can use any datetime related functions or simply add seconds to current time.

This was the missing link document ;-)

thanks a lot

To add comments, please log in or register