[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 196

 

SergNF:

init() is executed only once, regardless of whether there are ticks or not. Moreover, when executing init (if the function is heavy), it may skip ticks. But the essence of the start function is just to be executed when a new tick arrives.
so what? what do you want me to say?) to use start as intended? i stated clearly what i need - to wait for a tick in init and remember its time, i explained why in init. and i don't think your advice is relevant
 
eddy:
so what? what do you want me to say?) to use start for its intended purpose? i clearly stated what i need - to wait for a tick in init and remember its time, i explained why in init. and your advice is not relevant

Sorry. Wait for it.
 
eddy:
so what? what do you want me to say?) to use start for its intended purpose? i clearly stated what i need - to wait for a tick in init and remember its time, i explained why in init. and i don't think your advice is relevant

???

 
DhP: ???
What? I want to process the first tick in start() the rest in init()
 
eddy:
so what? what do you want me to say?) to use start for its intended purpose? i clearly stated what i need - to wait for a tick in init and remember its time, i explained why in init. and your advice does not seem to be relevant
Waiting for a tick in init() won't work. It is made so that init() and deinit() cannot wait. Everything that waits in these functions is ignored. Everything has 2.5 seconds for everything. The documentation says.
 
cp
 
eddy:
What? I want to process the first tick in start() and the rest in init()

I don't think you will find an answer here on the forum.

As I understand it, you have "your own way", unknown before...

 
eddy:
So what do you want me to say?) to use start() as intended? I stated clearly what I need - to wait for a tick in init and memorize its time, i explained why in init.

They are trying to explain to you that inside init() function the arrival of the tick is not identified in any way, so you can wait for the tick to come to it to death.

Your task is solved elementary inside the start() function. You input a Boolean variable, initialize it with the value true, at the very beginning of the start() function put if() from this variable, and inside it remember everything you need and change the variable's value to false. This conditional operator will be executed only once, at the first start(), i.e. on the first tick of your indicator or Expert Advisor.

eddy:
I want to process the first tick in start() the rest in init()

And this, sorry, is a fantasy. There cannot be a return from start() to init() at all.

But it's interesting to know why I need such a perversion?

 
eddy:
What? I want to process the first tick in start() the rest in init()
I meant the first one in init
 
Yurixx:

They are trying to explain to you that inside init() the arrival of the tick is not identified in any way

see