Forums › ProRealTime forum Italiano › Supporto ProBuilder › Indicatore Volume orario › Reply To: Indicatore Volume orario
09/30/2020 at 7:09 PM
#146005
**VenturerVolHour v1.1**
Piccolo aggiornamento ho aggiunto 2 parametri per settare il numero di barre, e la lunghezza
VenturerVolHour v1.1
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 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
//VenturerVolHour v1.1 HourStart=SesStart //15 HourStop=SesStop //23 once SelEnd=0 once SelStart=0 once SesStart=0 once ConteggioVol=0 if BarColor<2 or BarColor>3 then gr=0 gg=255 gb=0 rr=255 rg=0 rb=0 endif if BarColor=2 then gr=0 gg=100 gb=200 rr=150 rg=0 rb=255 endif if BarColor=3 then gr=0 gg=100 gb=200 rr=0 rg=100 rb=200 endif OraBarra=openhour[0] if OraBarra=HourStart and SelStart=0 then //Inizio sessione SelStart=1 SelEnd=0 SesStart=1 ConteggioVol=1 endif if OraBarra=HourStop and SelEnd=0 then SelStart=0 SelEnd=1 endif volp=volume if SelStart=1 and SesStart=1 then startbar=barindex hh=high ll=low SesStart=0 PrevHour=openhour[0] endif if openhour[0]<>PrevHour and SelStart=1 then startbar=barindex hh=high ll=low ConteggioVol=1 PrevHour=openhour[0] endif if high>hh then hh = high endif if low<ll or ll=0 then ll = low endif div = (hh-ll)/BarNumbers i=0 if SelStart=1 then ConteggioVol=ConteggioVol+1 if ConteggioVol>300 then ConteggioVol=300 endif volsum=summation[ConteggioVol](volp) while i<BarNumbers do lrange=ll+div*i hrange=lrange+div volbull=0 for j = 1 to ConteggioVol do if close[j]>=lrange and close[j]<=hrange then if close[j]>open[j] then volbull=volbull+volp[j] r=gr g=gg b=gb else volbull=volbull+volp[j] r=rr g=rg b=rb endif endif next bullbar = round((volbull*ConteggioVol)/volsum)*BarLength drawrectangle(startbar,(hrange+lrange)/2,startbar+bullbar,(hrange+lrange)/2) coloured(r,g,b,BarOpacity) i=i+1 wend endif return |