Need help to improve performance on this VWAP indicator

 
Hi, I have this VWAP indicator that can show Daily, Weekly, and Monthly VWAP lines, but there is a problem, if I switch to the lower timeframe like M1, the indicator is slow to load, especially if the Weekly/Monthly VWAP is enabled. So anyone can help me to improve the code performance on the lower timeframe?
Files:
 
xtemer: Hi, I have this VWAP indicator that can show Daily, Weekly, and Monthly VWAP lines, but there is a problem, if I switch to the lower timeframe like M1, the indicator is slow to load, especially if the Weekly/Monthly VWAP is enabled. So anyone can help me to improve the code performance on the lower timeframe?

It is very old and inefficient code. It has to be totally rewritten. Alternatively, search the codebase or market for something better or faster.