How to show indicator just on some timeframes ?

 

Hello,

I have very simple question:

How to show indicator just on some timeframes ? 

If indicator is attached to chart, I could select time frames I want to be shown on Indicator->Visualization.

But is it possible to select timeframes in indicator code ?

 

Thanks,

Edward 

 

Hello!

if vou know for which time frames to show use something like this:

if (Period()==1 || Period()==15 ||Period()==240...){
//your code here
}

or if you want to select for which time frame to show you need extern variables...

extern bool M1=false;
extern bool M5=false;
extern bool M15=false;
...