AY-VWAP.mq4 - changing the starting point to MN2 or 1Y

 

Hi, just wondering if someone can help me out with this indicator. There is no other free indicator around. "market_statistics_bands.mq4" does not work for me, since my MT4 will be super slow, guess CPU issues. VWAP Bands.mq4 is not the same unfortunately. I trade with the 1D chart and I am trying to set up the starting point quaterly (MN3) or even 1 year.

It seems that MT4 comes with the restriction of .... H4, D1, W1, MN1 and not higherBased on the information from: https://www.mql5.com/en/docs/constants/chartconstants/enum_timeframes 

Is there any chance to simply multiply the given PERIODs (I tried different ways) or is the bar count the work around solution in this case ? 

......int getTfByName(string tfname)

{

   int p;

        if (tfname == "MN1") p = PERIOD_MN1;

   else if (tfname == "W1" ) p = PERIOD_W1;

   else if (tfname == "D1" ) p = PERIOD_D1;

   else if (tfname == "H4" ) p = PERIOD_H4;

   else if (tfname == "H1" ) p = PERIOD_H1;

   else if (tfname == "M30") p = PERIOD_M30;

   else if (tfname == "M15") p = PERIOD_M15;

   else if (tfname == "M5" ) p = PERIOD_M5;

   else if (tfname == "M1" ) p = PERIOD_M1;

   else p = Period();  

   return(p);  


Really looking forward to hearing your solutions and replies

Documentation on MQL5: Constants, Enumerations and Structures / Chart Constants / Chart Timeframes
Documentation on MQL5: Constants, Enumerations and Structures / Chart Constants / Chart Timeframes
  • www.mql5.com
All predefined timeframes of charts have unique identifiers. The PERIOD_CURRENT identifier means the current period of a chart, at which a mql5-program is running.
Files:
ay-vwap.mq4  7 kb
Reason: