Upper Lower Cloud Beautiful AFL


Upper Lower Cloud Beautiful AFL
Upper Lower Cloud Beautiful AFL

//www.aflcode.com

Version(4.80); 

SetChartBkGradientFill( ParamColor("BgTop", colorWhite),ParamColor("BgBottom", colorLightYellow)); 

Periods = Param("Channel Periods", 34, 1, 250 );
Smooth = Param("Smoothing", 1, 1, 55 );
Value2 = Param("Over Bought", 70, 50, 99 );
Value3 = Param("Over Sold", 30, 1, 50 );
Value4 = Param("Upper Neutral Zone", 55, 50, 99 );
Value5 = Param("Lower Neutral Zone", 45, 1, 50 );

r = RSI( Periods );
OB = EMA( r - Value2, Smooth );
OS = EMA( r - Value3, Smooth );
NzU = EMA( r - Value4, Smooth );
NzL = EMA( r - Value5, Smooth );
Ch1 = Close - Close * OB / 100;
Ch2 = Close - Close * NzU / 100;
Ch3 = Close - Close * NzL / 100;
Ch4 = Close - Close * OS / 100;

//-- TohMz: Allow selection of Bar/Candlestick charting ----------------------------------------
//  Select top Menu <View> => <Price Char Style> => [Auto|Line|Line with dots|CandleSticks|Bars]
//
_N(Title = StrFormat("{{NAME}}- {{INTERVAL}} {{DATE}} O= %g, H= %g, L= %g, C= %g (%.1f%%) V= " +WriteVal( V, 1.0 ) +"\n{{VALUES}}", O, H, L, C,
SelectedValue( ROC( C, 1 )) ));
PriceStyle = GetPriceStyle();
PriceStyleOpt = ParamStyle("Style") | PriceStyle;

if (PriceStyle==styleCandle)
   Plot( C, "", colorBlack,  PriceStyleOpt); 
else
   Plot( C, "", IIf( Close >= Ref(C, -1), colorBlue, colorRed ),
PriceStyleOpt);
//----------------------------------------------------------------------------------------------

Plot( Ch1, "", colorLightGrey );
Plot( Ch2, "", colorLightGrey, styleNoLabel | styleNoTitle );
PlotOHLC( Ch1, Ch1, Ch2, Ch2, "Upper Channel ", ParamColor("Upper Channel Color",ColorRGB( 230, 230, 230)), styleCloud );  //TohMz: Color Selection
Plot( Ch3, "", colorLightBlue );
Plot( Ch4, "", colorLightBlue, styleNoLabel | styleNoTitle );
PlotOHLC( Ch3, Ch3, Ch4, Ch4, "Lower Channel ", ParamColor("Lower Channel Color",ColorRGB( 210, 210, 255)), styleCloud );  //TohMz: Color Selection

Previous
Next Post »