Where have you define the variable "myCondition" ? it must be the same for DEINIT and START()
Where have you define the variable "myCondition" ? it must be the same for DEINIT and START()
myCondition is global for script, so same scope in init,start,deinit.
my start function of course returns (0);
the problem is: the start function runs, until myCondition=true.
So when deleting from chart, i need a call into script in order to set myCondition.
(all this would be no problem, if could detach EA from within EA).
Where have you define the variable "myCondition" ? it must be the same for DEINIT and START()
the simplified code:
int deinit()
{
finished=true;
return(0);
}
int start()
{
while(finished == false)
{
Sleep(2000);
}
return(0);
}
Be tempted to have a controling EA that creates or destroys other EA's as objects. Effecency would be poor though.
[...] But when trying to "delete" from Chart, this script is still running.
Anyone has an idea ?
If I understand what you're doing here, then you should simply be using IsStopped() - e.g. while(!IsStopped()) { ... }
If I understand what you're doing here, then you should simply be using IsStopped() - e.g. while(!IsStopped()) { ... }
while(finished == false && IsStopped() == false)
{
Sleep(2000);
}
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
i like to have script which contains a loop in the main function:
while(myCondition=false)
{
Sleep(2000);
}
in deinit i set
myCondition=true;
But when trying to "delete" from Chart, this script is still running.
Anyone has an idea ?
thank you