Hello,
It seems there is an issue with the SD.
They just remains with same value. (snapshot attached).
I tried to use another vwap code using MTF and adding the SD to it, but the work around isnt showing anything besides the mtf vwap:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
// --- settings startDate = 20210621 startTime = 20000 viewSD = 1 // --- end of settings timeframe (15 minutes,updateonclose) VWAP=undefined SDup1 = undefined SDlw1 = undefined SDup2 = undefined SDlw2 = undefined SDup3 = undefined SDlw3 = undefined if opendate=startDate and opentime=starttime then startbar=barindex flag = 1 endif if opendate>=startDate and flag then barcount=barindex-startbar d = max(1, barcount) VWAP = SUMMATION[d](volume*typicalprice)/SUMMATION[d](volume) if(barcount=0) then sd = 0 else sd = SUMMATION[d](max(abs(high-vwap),abs(vwap-low)))/d endif if viewSD then SDup1 = vwap+sd SDlw1 = vwap-sd SDup2 = vwap+sd*2 SDlw2 = vwap-sd*2 SDup3 = vwap+sd*3 SDlw3 = vwap-sd*3 endif if vwap>vwap[1] then color = 1 else color = -1 endif endif RETURN VWAP as "VWAP dev weekly" |