Forums › ProRealTime foro Español › Soporte ProBuilder › Bull & Bear Volume-by-Price levels – modo VPOC › Reply To: Bull & Bear Volume-by-Price levels – modo VPOC
12/17/2018 at 11:42 AM
#87275
Éste agrega el área de volúmenes mínimos con una línea roja, como la forma que desee.
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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
//PRC_Bull&Bear Volume on Price | indicator //05.07.2018 //Nicolas @ www.prorealcode.com //Sharing ProRealTime knowledge defparam drawonlastbaronly=true defparam calculateonlastbars=1000 // --- settings ScaleFactor = 3 NbrBars=10 lookback=150 // --- end of settings hh=highest[lookback](high) ll=lowest[lookback](low) div = (hh-ll)/NbrBars i=0 volsum=summation[lookback](volume) startbar = barindex[lookback] maxbar = 0 while i<NbrBars do lrange=ll+div*i hrange=lrange+div volbull=0 volbear=0 for j = 1 to lookback do if close[j]>=lrange and close[j]<=hrange then if close[j]>open[j] then volbull=volbull+volume[j] else volbear=volbear+volume[j] endif endif next bullbar = round((volbull*lookback)/volsum)*scalefactor bearbar = round((volbear*lookback)/volsum)*scalefactor drawrectangle(startbar,lrange,startbar+bullbar,hrange) coloured(46,139,87) drawrectangle(startbar,lrange,startbar+bearbar,hrange) coloured(255,0,0) if bullbar>bearbar then drawtext("■",startbar+bullbar,(lrange+hrange)/2,Dialog,Bold,22) coloured(46,139,87) else drawtext("■",startbar+bearbar,(lrange+hrange)/2,Dialog,Bold,22) coloured(255,0,0) endif //VPOC if(bullbar>maxbar) then vpocbar=startbar+bullbar vpoclevel = (lrange+hrange)/2 maxbar=bullbar endif if(bearbar>maxbar) then vpocbar=startbar+bearbar vpoclevel = (lrange+hrange)/2 maxbar=bearbar endif //minBAR if i = 0 then minbar=min(bullbar,bearbar) else if(bullbar<minbar) then vpocbarmin=startbar+bullbar vpoclevelmin = (lrange+hrange)/2 minbar=bullbar endif if(bearbar<minbar) then vpocbarmin=startbar+bearbar vpoclevelmin = (lrange+hrange)/2 minbar=bearbar endif endif i=i+1 wend drawvline(barindex[lookback]) drawsegment(vpocbar,vpoclevel,barindex,vpoclevel) drawsegment(vpocbarmin,vpoclevelmin,barindex,vpoclevelmin) coloured(255,0,0) return |