HOW to plot HH/HL/LH/LL in ribon form in AB ???

mmca2006

Active Member
#1
Code:
_SECTION_BEGIN("Piviot Points");
Q=Param("% Change",2,1,10,1);
Z= Zig(C ,q ) ;
Sellz=HH=((Z<Ref(Z,-1) AND Ref(Z,-1) > Ref(Z,-2)) AND (Peak(z,q,1 ) >Peak(Z,q,2)));
Sellz=LH=((Z<Ref(Z,-1) AND Ref(Z,-1) > Ref(Z,-2)) AND (Peak(Z,q,1 ) <Peak(Z,q,2)));
Buyz=HL=((Z>Ref(Z,-1) AND Ref(Z,-1) < Ref(Z,-2)) AND (Trough(Z,q,1 ) >Trough(Z,q,2)));
Buyz=LL=((Z>Ref(Z,-1) AND Ref(Z,-1) < Ref(Z,-2)) AND (Trough(Z,q,1 ) <Trough(Z,q,2)));
GraphXSpace = 5;
dist = 1.0*ATR(20); 

for( i = 0; i < BarCount; i++ ) 
{ 
if( HH[i] ) PlotText( "HH", i, H[ i ]+dist[i], colorBlue );
if( LH[i] ) PlotText( "LH", i, H[ i ]+dist[i], colorRed ); 
if( HL[i] ) PlotText( "HL", i, L[ i ]-dist[i], colorBlue);
if( LL[i] ) PlotText( "LL", i, L[ i ]-dist[i], colorRed );

}

_SECTION_END();

I want to plot blue Ribbon as soon as previous Pivot ( HH/LH) breached in daily TF and Red ribbon as soon as( HL/LL) breached in daily TF .
As long as daily TF is following HH/HL it will be plotted as Blue ribbon and when Daily TF is following LH/LL it will be plotted as red ribbon, how is it possible, please help.
I am following hourly chart , will be long in Hourly when price will breach HH in Hourly TF and Daily TF is showing Blue ribbon , similarly i will go short in hourly TF when LL is breached in hourly TF and Daily TF is showing Red Ribbon.
 

Similar threads