[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 194
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
notepad.exe
Thank you!!! I'll find it or download it.
The proposed codes check whether this is the first input or not by the FirstStart flag. If it is the first tick, the value tik=GetTickCount() is assigned. With further ticks, the value of the global variable FirstStart=false, the condition if(FirstStart) is not executed, and re-assignment of the new value to the global variable tik is not performed; its first and only value is saved.
Isn't this what was required?
1. I told you - because if you make a flag at the start - it will be checked every time.
2. How to wait and remember the time of the first tick in milliseconds I can't see.
Did I give you code at start? Do you see start() ??? There's code written in init()
The code in init() works at initialization - at first start, when you change TF.
And further - insert into this block everything that needs to be worked out at the first start.
_________________________________________________________________________
int GetTickCount()
The GetTickCount() function returns the number of milliseconds elapsed since the system started. The count is limited by the resolution of the system timer. Since the time is stored as an unsigned integer, it overflows every 49.7 days._________________________________________________________________________
datetime TimeCurrent()
Returns last known server's time(time of last quote) as number of seconds elapsed since 00:00, January 1, 1970.
_________________________________________________________________________
If you don't know how to calculate time - grab your 1-3 grade general school textbooks.
Why actually init?
Wait at start, write it to global, if you're afraid of losing it, write it to terminal global.
I explained, because I do not want to make a flag at start that will be checked all the time.
granit77 05.03.2011 15:44
If it is first tick, then tik=GetTickCount(). With subsequent ticks, the value of the global variable FirstStart=false, the condition if(FirstStart) is not satisfied
the condition is not satisfied, but the check of this condition is performed each tick
artmedia70, I need to wait for the first tick in init and remember its time in milliseconds, understand?)
I don't need to "work something at first init", I need to work something after the first tick
I told you because I don't want to make a flag in the start that will be checked all the time.
the condition is not met, but the check for that condition happens every tick.
This is something new!
The whole work of the EA is based on the constant checking of the conditions....
The man seems to live for the problem rather than the solutions. He is presented with working codes and continues to harp on about an unsolved problem
I'm writing an indicator)
I can't help but admire you.
I've long noticed you have a genius mind,
your train of thought is beyond the comprehension of ordinary people...