Hi Experts, I’ve encountered a ‘divide by zero’ error in the automated trading while utilizing the code shared in the forum. https://www.prorealcode.com/prorealtime-indicators/vwap-intraday/ // ===================== d = max(1, intradaybarindex) VWAP = SUMMATION[d](volume*typicalprice)/SUMMATION[d](volume) if(intradaybarindex=0) then sd= 0 else sd= SUMMATION[d](max(abs(high–vwap),abs(vwap–low)))/d endif SDup1 = vwap+sd SDlw1 = vwap–sd SDup2 = vwap+sd*2 SDlw2 = vwap–sd*2 SDup3 = vwap+sd*3 SDlw3 = vwap–sd*3 // ===================== Recognizing that the ‘d’ variable is protected, I’ve adjusted the code to address this concern. The system is now running with the updated code, but I haven’t observed its performance yet. I’m uncertain if ‘sd’ was the root cause of the issue, the new code is a trial-and-error approach, and would greatly appreciate any insights or opinions. new lines: // ===================== d = max(1, intradaybarindex) VWAP = SUMMATION[d](volume*typicalprice)/SUMMATION[d](volume) // ===================== KT