Set specific visualization values in Custom Indicator

 
Is there any way to add code to a Custom Indicator, which will then restrict the indicator to be present only on specific time period charts, e.g., 5 min and 1 hour, say? This is to prevent the necessity of manually selecting the Visualization tab, unchecking the All Timeframes box, and then manually selecting the time periods required on which the indicator will be visible.
 
at start(), if the timeframe is not to your liking, exit before drawing/calculating

int start(){
   if(Period() != PERIOD_H1) return(0);
 
   ...  processing for periods you like here






 
Hi phy,
I tried your line, and it removed the indicator from all charts except the 1 hour. How do I do the opposite? I want to remove the indicator from the 1 hour, but keep it for all the rest.
 
int start(){
if(Period() == PERIOD_H1) return(0);

... processing for periods you like here
 
Thanks, phy. Much appreciated. That was really helpful and did exactly what I wanted.

Would you have a web link or tutorial anywhere that I could use to teach myself how to programme this kind of thing?
 
No, just take an idea, write code, figure out how to make the idea work. Do it again.