Say I enter a position at point a and if it's gone nowhere in 30 mins i want to exit ... how do I calculate the time difference?
I understand that I could do
if (EntryTime+30 minutes<=CurrentTime)
exit code goes here
But how do I achieve the time comparison? If I use ToTime(Time[0]) it turns it into an integer, which is no use as adding 3000 to 163000 doesn't get you to 170000 e.g. 166000<=170000 evaluates as true (so this way is no use to me). Can I turn everythiing into seconds and do a comparison that way?
e.g.
if (EntryTimeinSeconds+1800<=CurrentTimeinSeconds)
exit code goes here
Thanks
Al
Comment