Ciao, sto costruendo un indicatore per vedere il volume profile ed altre informazioni divisi per sessioni, ad esempio con orario RTH. In pratica si configura l’inizio e la fine della sessione, ad esempio 15,22 e nel grafico vengono mostrati: -Il POC Precedente -Volume profile -Apertura e chiusura della sesisone precedente -gap dalla sessione precedente -con background in rosso la sessione fuori orario Ho qualche dubbio suk Poc , per ora è ancora in scrittura, però accetto volentieri suggerimenti. HourStart=15 HourStop=23 dataOggi=date ScaleFactor=2 NbrBars=6 dataTemp=dataOggi Conteggio=0 once SelEnd=0 once SelStart=0 once CountDays=0 once PrezzoChiusura=0 once PrezzoApertura=0 once ColoreSfondo=0 once LastStartBarIndex=0 once LastStopBarIndex=0 //while CountDays=Maxdays do Conteggio=Conteggio+1 if date[Conteggio]<> dataTemp then CountDays=CountDays+1 SelEnd=0 SelStart=0 //PrezzoChiusura=0 endif OraBarra=hour[Conteggio] //MinutiBarra=minute[Conteggio] if OraBarra=HourStart and SelStart=0 then DRAWVLINE(Barindex[Conteggio])Coloured(0,100,0) DRAWTEXT("#DayStart#/#MonthStart# Close", barindex, PrezzoChiusura+(1*pipsize)) DRAWTEXT("#DayStart#/#MonthStart# Open", barindex, PrezzoApertura+(1*pipsize)) DRAWSEGMENT(Barindex[Conteggio],PrezzoChiusura,LastStopBarIndex,PrezzoChiusura) Coloured(100,10,22) DRAWSEGMENT(Barindex[Conteggio],PrezzoApertura,LastStartBarIndex,PrezzoApertura) Coloured(100,75,22) if Close[conteggio]>PrezzoChiusura then //Green R=127 G=255 B=0 else R=255 G=0 B=0 endif DRAWRECTANGLE(Barindex[Conteggio],Close[conteggio],Barindex,PrezzoChiusura) Coloured(R,G,B) DRAWTEXT("GAP", barindex, (Close[conteggio]+PrezzoChiusura)/2) DayStart=day MonthStart=month if DayStart and MonthStart then endif PrezzoApertura=open[Conteggio] SelStart=1 ColoreSfondo=0 LastStartBarIndex=barindex //DisegnaLariga endif if OraBarra=HourStop and SelEnd=0 then PrezzoChiusura=close[Conteggio] DayStop=day MonthStop=month //Calcolo POC StopLookback=barindex-LastStartBarIndex hh=highest[StopLookback](high) ll=lowest[StopLookback](low) div = (hh-ll)/NbrBars i=0 volsum=summation[StopLookback](volume) startbar = barindex[StopLookback] maxbar = 0 while i<NbrBars do lrange=ll+div*i hrange=lrange+div volbull=0 volbear=0 ij=1 //for ij = 1 to StopLookback do while ij<=StopLookback do j=ij 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 ij=ij+1 wend //next bullbar = round((volbull*StopLookback)/volsum)*scalefactor bearbar = round((volbear*StopLookback)/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,15) coloured(46,139,87) else drawtext("■",startbar+bearbar,(lrange+hrange)/2,Dialog,Bold,15) coloured(255,0,0) endif //VPOC if(bullbar>maxbar) then vpoclevel = (lrange+hrange)/2 maxbar=bullbar endif if(bearbar>maxbar) then vpoclevel = (lrange+hrange)/2 maxbar=bearbar endif i=i+1 wend ///if intradaybarindex=1 then yesterdayVPOC=vpoclevel[1] drawtext("---------------------------- #DayStop#/#MonthStop# VPOC [#yesterdayVPOC#]----------------------------------------------",BarIndex,vpoclevel[2],dialog,bold,15) coloured(0,0,0) //endif SelEnd=1 DRAWVLINE(Barindex[Conteggio]) Coloured(255,0,0) ColoreSfondo=1 LastStopBarIndex=barindex //DisegnaLariga endif if ColoreSfondo=1 then BACKGROUNDCOLOR(255,0,0,5) endif dataTemp=date[Conteggio] //wend return