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
wrong - there is no initialisation
Here is a proof from the help
Global variables are initialized only once right after the program is loaded into the client terminal memory.
it's not initialization at all, it's a variable change
please read the code carefully
You always have StringVal condition != backup and firsttime will always be true, because it (init) is started only once EVERY time the EA is started, and a new start is made when you change the tf window or when you change the set when the terminal starts.
That's not what you mean.
because you didn't read the posts carefully.
The problem occurs when extern string Value
the second variable also changes when the first one changes
all the time
it should be changed only once
And write the reason for deinitialization in init() in the log. Then you will understand why the initialization happens.
what are you talking about?
forget about the initialization
Take the last example without init() and test
Why are you talking nonsense if you do not understand what I mean?
what are you talking about?
forget about the initialization
take the last example without init() and test it
Why are you talking nonsense if you don't understand what we're talking about?
Either break your neck further or read why variables are initialized when input parameters are changed.
"... Global variables are initialised only once after the program is loaded into the client terminal's memory... "
What you've highlighted in red and the thickness of the font - it doesn't give you a guarantee that after changing the value of an external variable, it won't initialize again as it did at first startup. You can even change the font size in messages. But initialization will still happen, even if you remove init() from the program.
that's not what you mean
because you didn't read the post carefully.
The problem occurs when extern string Value is changed
and the second variable also changes when the first one is changed
all the time
and should only be changed once
once EVERY time you start the EA, and it starts every time you change this variable and press OK
what do you mean by "load the program into the client terminal memory..."??? when did you compile the code?
Either break your spears further, or read why variables are initialised when input parameters are changed.
"... The global variables are initialised once, immediately after the program is loaded into the client terminal memory... "
What you highlighted in red and the thickness of the font - it does not give you a guarantee that after changing the value of an external variable it won't initialize again as it did at first startup.
why reply if you don't read your posts carefully?
2. The variable is not initialized, it takes the value of 1.
If you are too lazy to test it, don't waste your time.
If you want to help, I'd be grateful!
Read your posts carefully and test it.
where did you get this from?
it doesn't guarantee that after you change the value of an external variable, it won't re-initialize like the first run.
I haven't seen any re-initialisation of global variables yet
Why answer if you don't read the posts carefully?
2. the variable is not initialized but takes value 1.
If you're too lazy to test it, don't waste your time.
If you want to help, I'd be grateful!
Read your posts carefully and test it.
where did you get this from?
it doesn't guarantee that after you change the value of an external variable, it won't re-initialize like the first run.
I haven't seen any re-initialisation of global variables yet
what do you mean by "loading the program into the client terminal memory..." ?"??? is that when you compiled the code?
in this case too
you mean when the program is first attached to the chart
but I'll say it again.
it's not about initialization
read above.
When you change an external variable, the EA is restarted. I suggested that you display the reasons for deinitialisation in the log. You chose not to do this.
why?
what will it do for me?
I know why deinitialisation happens
I change the external variable
in this case, too.
it is the first time the program is attached to the chart
but I'll say it again.
It's not about initiation.
read above
Vlad, there is a mistake here, initialisation happens every time you change external parameters. And that's exactly the point, if it's about the inite.