problem with pivot point indicator

 

Hi all, I'm trying to apply the attached indicator on a M2 offline chart.

If I recall the daily pivot with iCustom(NULL,PERIOD_D1,"All Pivot Points",0,0) there's no problem.

If I try to recall the weekly or the monthly pivot, I have the following alert

int OnInit()
  {
   Status=true;
   IsChartLoaded=false;
   if(Period()>InpTimeframe)
     {
      Alert("Loading failed, please set a higher timeframe.");
      Status=false;
     }

How can I solve?

Thank you!

Files:
Reason: