gotts:
But it displays an empty sub window and keeps running start() function..
Is there any smart way?
But it displays an empty sub window and keeps running start() function..
Is there any smart way?
- Displays the sub window because that is what the indiator is. It runs start which does nothing because that is what you coded.
- Don't attach the indicator on those time frames.
WHRoeder:
- Displays the sub window because that is what the indiator is. It runs start which does nothing because that is what you coded.
- Don't attach the indicator on those time frames.
Hi,
Thank you for the reply.
You are right:-) That's what I coded.
My intention was if my indicator is used by someone and is attached to invalid time frames,
I would like it to alert and detach automatically.
If it is impossible, I will write README or somewhere.
Thanks a lot,
Paul_B:
The above should work. Place in the indicator body before anything else is checked.
The above should work. Place in the indicator body before anything else is checked.
Ah, I didn't know Comment() function. It looks good. Thank you for the great suggestion!
Useful code, thank you!
You might try How do I close an Expert programmatically? - MQL4 forum to see if it closes the indicator
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
bool IsInvalid = false;
int init() {
if(Period() > PERIOD_H4) {
IsInvalid = true;
return(0);
}
...
int start() {
if(IsInvalid) return(0);
...