Forums › ProRealTime forum Italiano › Supporto ProBuilder › traduzione codice TW Rolling Point of Control (POC) [AlgoAlpha] › Reply To: traduzione codice TW Rolling Point of Control (POC) [AlgoAlpha]
04/26/2024 at 2:28 PM
#231968
Ecco la traduzione.
https://www.prorealcode.com/prorealtime-indicators/rolling-poc-volume-profile-indicator/
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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
//------------------------------------------------------// //PRC_Rolling POC Volume profile //version = 0 //26.04.24 //Iván González @ www.prorealcode.com //Sharing ProRealTime knowledge //------------------------------------------------------// defparam drawonlastbaronly = true //-----Inputs-------------------------------------------// plook=40 res=15 scale=30 hlen=25 smoothPOC=1 showchannel=1 showtrend=0 //------------------------------------------------------// //-----Create arrays for High, Low and volume-----------// maxx = highest[plook](high) minn = lowest[plook](low) step = (maxx-minn)/res //height of the rectangle volsum=summation[plook](volume) startbar = barindex+7 //------------------------------------------------------// //-----Calculation POC----------------------------------// for i=0 to res-1 do binsize=0 volsize=0 mybot=minn+(i*step) mytop=minn+((i+1)*step) $bottomboundaries[i]=mybot $topboundaries[i]=mytop for j=0 to plook-1 do if close[j]>=mybot and close[j]<=mytop then volsize=volsize+volume[j] endif next $VolLen[i]=volsize volbar = (volsize*res/volsum)*scale drawrectangle(startbar,mytop,startbar+volbar,mybot)fillcolor("black",70) next for k=0 to res-1 do if $VolLen[k]=ArrayMax($VolLen) then x = k break endif next poc = ($topboundaries[x]+$bottomboundaries[x])/2 //------------------------------------------------------// //-----POC Bar and line---------------------------------// drawrectangle(startbar,$topboundaries[x],startbar+($VolLen[x]*res/volsum)*scale,$bottomboundaries[x])fillcolor("yellow",90) drawsegment(barindex,poc,startbar,poc)coloured("purple")style(dottedline) mypoc = round(poc,2) drawtext("POC = #mypoc#",round((startbar+startbar+($VolLen[x]*res/volsum)*scale)/2),poc+0.35*tr)coloured("red") //-----POC Smoothed if smoothPOC then smPOC = average[max(1,round(sqrt(plook)))](poc) else smPOC = poc endif if close > smpoc then r=0 g=255 b=80 else r=255 g=0 b=0 endif colorbetween(close,smPOC,r,g,b,50) //------------------------------------------------------// //-----Trend--------------------------------------------// if showtrend then hpoc = weightedaverage[hlen](poc) if hpoc >= hpoc[1] then rhpoc=0 ghpoc=255 else rhpoc=255 ghpoc=0 endif else hpoc = undefined endif //------------------------------------------------------// //-----Max and Min Channel------------------------------// if showchannel then rh = highest[plook](high) rl = lowest[plook](low) else rh = undefined rl = undefined endif //------------------------------------------------------// return smPOC as "POC smoothed" coloured(r,g,b),rh as "Max High"coloured("blue"), rl as "Min Low"coloured("blue"),hpoc as "Trend" coloured(rhpoc,ghpoc,0)style(line,3) |