leonfoo Posted May 30, 2012 Report Posted May 30, 2012 i'm trying to make up a code to know the total time for each open order. below is the code. for(int nCnt=OrdersTotal(); nCnt>=0; nCnt--) { if (!OrderSelect(nCnt,SELECT_BY_POS)) continue; if(OrderSymbol()==Symbol() && OrderMagicNumber()==Magic) { double tmp = (TimeCurrent()-OrderOpenTime())/3600.0; Print("Current trade Duration is ",NormalizeDouble(tmp,8)); } } but the log shows for every trade is "Current trade Duration is 0". can anyone advice what went wrong? Quote
iwjw Posted May 30, 2012 Report Posted May 30, 2012 just checked with some of my longer running trades and I'm getting a duration > 0 if it's a fresh trade maybe the resulting value of tmp is too small for the Print function Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.