a bit rough yet, but helps to determine trend
it's based on Bollinger bands.
basically works like this...if the middle of the bollingerbands are up compared to the previous, the histogram is green, unless other criteria is met
_SECTION_BEGIN("BollingerTrend");
P = C;
Periods = Param("Periods", 15, 2, 100, 1 );
Width = Param("Width", 2, 0, 10, 0.05 );
bbt = BBandTop( P, Periods, Width );
bbb = BBandBot( P, Periods, Width );
bbm = ((bbt +bbb )/2);
_SECTION_END();
_SECTION_BEGIN("Histogram");
myarray=bbm-Ref(bbm,-1);
trendUP=(bbm>Ref(bbm,-1) AND NOT (C<bbm OR H<bbm AND C<O)) OR (C>bbm AND L>bbm AND C>O);
trendDown=(bbm<Ref(bbm,-1) AND NOT (C>bbm AND L>bbm AND C>O)) OR (C<bbm AND H<bbm AND C<O);
Style2 = ParamStyle("Style2") | styleHistogram |styleArea ;;
Plot( myarray, "Histogram",IIf( trendUP, colorSeaGreen, IIf( trendDown, colorOrange, colorLavender )), Style2 , -0.5, 100 );
_SECTION_END();
it's based on Bollinger bands.
basically works like this...if the middle of the bollingerbands are up compared to the previous, the histogram is green, unless other criteria is met
_SECTION_BEGIN("BollingerTrend");
P = C;
Periods = Param("Periods", 15, 2, 100, 1 );
Width = Param("Width", 2, 0, 10, 0.05 );
bbt = BBandTop( P, Periods, Width );
bbb = BBandBot( P, Periods, Width );
bbm = ((bbt +bbb )/2);
_SECTION_END();
_SECTION_BEGIN("Histogram");
myarray=bbm-Ref(bbm,-1);
trendUP=(bbm>Ref(bbm,-1) AND NOT (C<bbm OR H<bbm AND C<O)) OR (C>bbm AND L>bbm AND C>O);
trendDown=(bbm<Ref(bbm,-1) AND NOT (C>bbm AND L>bbm AND C>O)) OR (C<bbm AND H<bbm AND C<O);
Style2 = ParamStyle("Style2") | styleHistogram |styleArea ;;
Plot( myarray, "Histogram",IIf( trendUP, colorSeaGreen, IIf( trendDown, colorOrange, colorLavender )), Style2 , -0.5, 100 );
_SECTION_END();