TimeCurrent() - OrderOpenTime();
gets time between orderopen and current time, in seconds.
ofcourse you'll have to select the order first.
masterapiz:
the result should return ( Server time - Order open datetime = 26hours)
datetime now = TimeCurrent(); for(pos = OrdersTotal()-1; pos >= 0 ; pos--) if ( OrderSelect(pos, SELECT_BY_POS) // Only my orders w/ && OrderMagicNumber() == magic.number // my magic number && OrderSymbol() == Symbol() ){ // and my pair. datetime then = OrderOrderTime(); Alert("order open for ",(now-then)/3600.0," hours"); }

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi,
Need help creating a function to get the number of hours for (current server datetime - order open datetime).
Eg. Order open Date Time = February 15, 2011, 0300 am
Server Time = February 16, 2011, 0500 am
the result should return ( Server time - Order open datetime = 26hours)
Thanks in advance.