Text on volume BAR

Hii All ,

Happy New Year To all

I am trying to plot text on volume bar, My code plot latest volume to all bar
I want respective volume on bar.

Please help

_SECTION_BEGIN("Volume");


SetChartBkColor(ParamColor("BkColor",ColorRGB(230,230,230)));
period = Param( "Days", 50, 1, 200, 1 );
threshold=Param("% vol diff",0.1,0.1,1,0.1);
Avg_vol=ROUND(MA(V,period));   
dist=0.5*Avg_vol;

Plot( Volume, "Volume", IIf( C > O    , ParamColor("Up Color", colorBlue), ParamColor("Down Color", colorOrange) ), ParamStyle( "Style", styleHistogram | styleThick, maskHistogram  ) ,Null,Null,0,0,-40);
Plot( Avg_vol,_DEFAULT_NAME(), colorBlack);
//Plot( Avg_vol+Avg_vol*50/100,_DEFAULT_NAME(), colorRed);
findVol=IIf(V < 100000 ,1,
			  IIf(V >100000 AND V <10000000,2,
			  IIf(V > 10000000,3,0)));
			  
Voltex=WriteIf(findvol==1,"K",
			 WriteIf(findvol==2," Lk",
			 WriteIf(findvol==3," Cr",	"")));

vol_Tenth=IIf(findvol ==1,V/1000,
					IIf(findvol ==2,V/100000,
					IIf(findvol ==3,V/1000000,0)));


for ( i = 0; i < BarCount; i++ )
{
    if ( Volume[i] > Avg_vol[i]+Avg_vol[i]*threshold )
		{
		
		
		PlotTextSetFont(NumToStr(vol_tenth,1) + voltex, "ARIAL", 8, i-1, v[ i ]+dist[i], colorblue, colorDefault, 0 );  
			//PlotText( NumToStr(vol_tenth,1) + voltex, i, Volume[ i ]+dist[i] , colorBlue );
			
		}
}


_SECTION_END();

volumeTEXT

vol_tenth is an array , inside loops you must use vol_tenth[i]

4 Likes

thank you !! @awilson

1 Like

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.