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?
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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now