Forums › ProRealTime English forum › ProBuilder support › ZigZag with cumulative volume › Reply To: ZigZag with cumulative volume
02/21/2017 at 10:02 AM
#25828
Here is the version with negative Volumes when the last zigzag was a peak.
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 |
//PRC_CumulativeVolume ZigZag | indicator //17.02.2017 //Nicolas @ www.prorealcode.com //Sharing ProRealTime knowledge // --- parameters // percentVariation = 9 zz = ZigZag[percentVariation](close) peak = zz<zz[1] and zz[1]>zz[2] tough = zz>zz[1] and zz[1]<zz[2] if color=1 then cumV = cumV+volume else cumV = cumV-volume endif if peak then text = cumV/1000 drawtext("#text#K",barindex[1],cumV[1]+0.17*cumV[1],Dialog,Bold,12) coloured(0,200,0) drawsegment(barindex[1],cumV[1]+0.20*cumV[1],previousX,previousY) cumV = -Volume color = -1 previousX = barindex[1] previousY = cumV[1]+0.20*cumV[1] elsif tough then text = cumV/1000 drawtext("#text#K",barindex[1],cumV[1]+0.23*cumV[1],Dialog,Bold,12) coloured(200,0,0) drawsegment(barindex[1],cumV[1]+0.20*cumV[1],previousX,previousY) cumV = Volume color = 1 previousX = barindex[1] previousY = cumV[1]+0.20*cumV[1] endif return cumV coloured by color |