Jump to content

⤴️-Paid Ad- Check advertising disclaimer here. Add your banner here.🔥

Recommended Posts

Posted

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?

Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now


⤴️-Paid Ad- Check advertising disclaimer here. Add your banner here.🔥

×
×
  • Create New...