
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 all,
first of all, thanks to anyone reading this that replied to my previous topic.
This time I'm struggling with time management: I need to check (every 60 seconds) if the trade has reached TP or SL.
For this I'm using the TimeLocal(); function: each tick I store the new value in a variable (carrenttl); then (inside the while op) saving the TimeLocal in a different variable (taimlocal). And I'm trying to run the loop as long as the difference between the second variable and the first one is smaller than 60 (as datetime variables like the two mentioned above are equivalent to the second elapsed from 1/01/1970).
It compiles without errors but when I look at the log it does everything in about 7 seconds, as opposed to the 60 that I'm expecting.
Would you have any suggestion on why this is not working or if there's a way that this can be done more efficiently?
Thank you for your time
E.