_SECTION_BEGIN("HighVol");
SetChartOptions(0,chartShowArrows|chartShowDates|chartWrapTitle);
SetChartBkColor(ParamColor("Background", colorLightGrey)) ;
useforeign = ParamToggle("Set Foreign", "No|Yes", 0) ;
//List = GetCategorySymbols(categoryMarket, 0) ;
//forscript = ParamList("Scrip", List, 0) ;
forscript = ParamStr("Foreign Script", "BANKNIFTY-I") ;
if (useforeign)
SetForeign(forscript);
settf = ParamToggle("Set TF", "No|Yes", 0) ;
tf = Param("TF", 5, 1, 100000, 1) ;
if (settf)
{
SetChartOptions(3,chartShowDates);
TimeFrameSet(tf*in1Minute) ;
}
Layer = Param("Layer", 0, -5, 5, 1) ;
if (settf)
tz = NumToStr(tf, 8.0) +"-minute";
else
tz = NumToStr(Interval()/in1Minute, 8.0) +"-minute";
strname = Name();
if (useforeign)
strname = forscript ;
//_N(Title = StrFormat(Name() + " " +tz + " " + NumToStr(ddt, formatDateTime) + " Range %g {{VALUES}}", SelectedValue( dh-dl) ));
_N(Title = StrFormat(strname+tz+ NumToStr(DateTime(), formatDateTime)+ EncodeColor( colorGreen ) + " Open %g," + EncodeColor( colorBlue ) + " Hi %g, " + EncodeColor( colorRed ) + " Lo %g, " + EncodeColor( colorBlack ) + " Close %g (%.1f%%){{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
showprice = ParamToggle("Show Price", "No|Yes", 1) ;
styleprice = IIf(showprice, 0, styleNoDraw) ;
//if (showprice)
Plot( C, "Close", colorBlack, styleNoTitle | styleCandle|styleprice,0,0,0,Layer );
ToolTip = "Open = " + O + "\nHigh = " + H + "\nLow = " + L + "\nClose = " + C ;
if (settf)
{
Daych = Day() != Ref(Day(), -1) ;
Plot(IIf(Daych, 100, 0), "", colorBlack, styleHistogram|styleNoLabel|styleOwnScale, 0, 100, 0, -5) ;
}
//Peaking Volumes
HiVolume = IIf(V > (2 * MA(V,10)), True, False);
PlotShapes(shapeSmallCircle * HiVolume, IIf(C > O, colorBlack, colorWhite), 0, (O+C)/2, 0);
//TimeFrameRestore()
Clronclose = ParamToggle("Color on yday close", "No|Yes", 0) ;
if (Clronclose)
{
ydayc = TimeFrameGetPrice("C", inDaily,0, expandLast) ;
Clr = IIf(C > ydayc, colorBlue, IIf(C < ydayc, colorRed, colorGrey40)) ;
SetBarFillColor(Clr) ;
Plot(C, "", Clr, styleCandle|styleNoLabel, 0, 0, 0, 1) ;
}
scalefromclose = ParamToggle("Scale from Close", "No|Yes", 1) ;
per = Param("Percentage",40,0,50,10);
Mingap = Param("Min Gap", 20, 1, 10000, 1) ;
if (scalefromclose)
{
Lvh = Lvl = SelectedValue(C);
Lvhh = HighestVisibleValue(H) ;
Lvll = LowestVisibleValue(L) ;
spl = sph = (Lvhh-Lvll)*per/100 ; // Param("pointsup",50,0,500,10);
Plot( Max(Max(Lvh+sph, Lvhh+sph/2), Lvh+Mingap), "", colorBlack,styleNoDraw);
Plot( Min(Min(Lvl-spl, Lvll-spl/2), Lvl-Mingap), "", colorBlack,styleNoDraw);
}
_SECTION_END();