_SECTION_BEGIN("Triades");
// Converted by : Extremist
m1 = H<Ref(H,-1) AND L<Ref(L,-1);
m2 = H<Ref(H,-2) AND L<Ref(L,-2) AND H>Ref(H,-1)AND L<Ref(L,-1);
m3 =H<Ref(H,-3) AND L<Ref(L,-3) AND H>Ref(H,-2) AND L<Ref(L,-2) AND H>Ref(H,-1) AND L<Ref(L,-1);
marka = m1 OR m2 OR m3;
set = L >ValueWhen(marka,L) AND H>ValueWhen(marka,H) AND LowestSince(Ref(marka,-1),L) > ValueWhen(marka,L);
sig=0;
sig = Iif(marka,1, Iif(set,0,Ref(sig,-1)));
m1 = H>Ref(H,-1) AND L>Ref(L,-1);
m2 = H>Ref(H,-2) AND L>Ref(L,-2) AND H>Ref(H,-1) AND L<Ref(L,-1);
m3 = H>Ref(H,-3) AND L>Ref(L,-3) AND H>Ref(H,-2) AND L<Ref(L,-2) AND H>Ref(H,-1) AND L<Ref(L,-1);
markd = m1 OR m2 OR m3;
set =L<ValueWhen(markd,L) AND H<ValueWhen(markd,H) AND HighestSince(Ref(markd,-1) , H) < ValueWhen(markd,H);
sig=0;
sig = Iif(markd,1, Iif(set, 0, Ref(sig,-1)));
dec= ExRem(markd,marka);
ace= ExRem(marka,markd);
Coloro=IIf( ace, colorred, IIf(dec, colorbrightgreen,null ));
setbarfillcolor(IIf( ace, colorred, IIf( dec, colorbrightgreen,colorBlack )));
Plot( C, "Close", coloro, styleNoTitle | GetPriceStyle() );
_SECTION_END();