Download MetaTrader 5

Order Expire in datetime MQL4

To add comments, please log in or register
Share your programs. That will improve your rating.
amando
424
amando 2016.11.15 19:49 

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
17906
Stanislav Korotky 2016.11.15 20:47  
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
30730
Alain Verleyen 2016.11.15 20:53  
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
424
amando 2016.11.15 21:02  

Thanks

amando
424
amando 2016.11.15 21:04  
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