check out indicator on some timeframe

 

hi every body, I have very simple question:

How to check out indicator just on some timeframes ? 

If indicator is attached to chart, I could select time frames but I want to be checked Indicator on some timeframe and results will show in alerts.

But is it possible to select timeframes in indicator code ?

Documentation on MQL5: Common Functions / TesterHideIndicators
Documentation on MQL5: Common Functions / TesterHideIndicators
  • www.mql5.com
TesterHideIndicators - Common Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
hosein194: But is it possible to select timeframes in indicator code ?

If it is coded as a multi-timeframe (MTF) indicator.

 
hosein194 #:

Thanks for respond. I wrote this code can you check this code?

Please insert the code correctly: when editing a message, press the button    Codeand paste your code into the pop-up window. (The first time I corrected your message)
 
Vladimir Karputov #:
Please insert the code correctly: when editing a message, press the button    and paste your code into the pop-up window. (The first time I corrected your message)
 if (AlertMode == 1 || AlertMode == 3)
   {
   string Message1 = "Tenkan onerlay Kijun: "+Symbol()+" on M5; M15; H1; H4"+Period();
/*
   if ( Tenkan_Buffer[0]=Kijun_Buffer[0] && Tenkan_Buffer[1]=Kijun_Buffer[1])
   PlaySound("alert.wav");
   if ( Tenkan_Buffer[0]=Kijun_Buffer[0] && Tenkan_Buffer[1]=Kijun_Buffer[1])
   PlaySound("alert1.wav");
*/
         if(Tenkan_Buffer[1]==Kijun_Buffer[1] && Open[1] < Kijun_Buffer[1] && Close[1] > Kijun_Buffer[1] && !UptrendAlert1)
            { Alert("Bullish Kijun Overlayed : "+Message1); UptrendAlert1 = true; DntrendAlert1 = false; }
   }
     if (AlertMode == 2 || AlertMode == 3)
   {
   string Message2 = "Bearish Kijun Cross: "+Symbol()+" on M5; M15; H1; H4"+Period();
   /*
   if ( Tenkan_Buffer[0]=Kijun_Buffer[0] && Tenkan_Buffer[1]=Kijun_Buffer[1])
   PlaySound("alert.wav");
   if ( Tenkan_Buffer[0]=Kijun_Buffer[0] && Tenkan_Buffer[1]=Kijun_Buffer[1])
   PlaySound("alert2.wav");
*/
   
         if(Tenkan_Buffer[1]==Kijun_Buffer[1] && Open[1] > Kijun_Buffer[1] && Close[1] < Kijun_Buffer[1] && !DntrendAlert1)
            { Alert("Bearish Kijun Overlayed : "+Message2); UptrendAlert1 = false; DntrendAlert1 = true;} 
            }                      
   return(0);
}
bool IsItNewBar()
{
   static datetime lastTime;
   bool IsNewBar = (Time[0] != lastTime);
   lastTime = Time[0];

   return(IsNewBar);
}
Reason: