[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

 
alsu:
notepad.exe

Thank you!!! I'll find it or download it.
 
Dimka-novitsek:

Press select from the list and scroll to the meta-editor.
 
granit77:
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?
Victor! It seems that the person simply lives with the problem, not with the ways to solve it. He is presented with working codes, but keeps repeating about the unsolved problem, instead of taking advantage of the proposed solution.
 
eddy:

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.

 
DhP:

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

 
eddy:

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....

 
Who says I'm making an EA? :) I'm writing an indicator)
 
artmedia70:
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
That's the problem, these ways of solving the problem don't work for me.
 
eddy:
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...

Reason: