Monday – Friday : 9:00 AM – 6:30 PM

Color Coded

Traders can use AFL code in Amibroker to develop color-coded indicators and strategies. This allows for quick visual interpretation of market conditions, making it easier to spot trading opportunities and signals. The Amibroker data feeder supports this by providing the necessary price and data inputs for creating color-coded trading systems.

_SECTION_BEGIN("Color Coded Short Term Reversal Signals");
/*Color Coded Short Term Reversal Signals
by Larry Lovrencic

Some of the colors may need to change depending on your choice of background color.
This has been coded for a white background*/

/*Closing Price Reversals*/
CPRbuy=O<(L+0.2*(H-L)) AND C>(H-0.2*(H-L)) AND H<Ref(H,-1) AND L<Ref(L,-1) AND C>Ref(C,-1);
CPRsell=O>(L+0.8*(H-L)) AND C<(H-0.8*(H-L)) AND H>Ref(H,-1) AND L>Ref(L,-1) AND C<Ref(C,-1);

/*Hook Reversals*/
HRbuy=O<(L+0.2*(H-L)) AND C>(H-0.2*(H-L)) AND H<Ref(H,-1) AND L>Ref(L,-1);
HRsell=O>(L+0.8*(H-L)) AND C<(H-0.8*(H-L)) AND H<Ref(H,-1) AND L>Ref(L,-1);

/*Island Reversals*/
IRbuy=Ref(L,-2)>Ref(H,-1) AND L>Ref(H,-1); 
IRsell=Ref(H,-2)<Ref(L,-1) AND H<Ref(L,-1);

/*Key Reversals*/
KRbuy=O<Ref(C,-1) AND L<Ref(L,-1) AND C>Ref(H,-1);
KRsell=O>Ref(C,-1) AND H>Ref(H,-1) AND C<Ref(L,-1);

/*Open Close Reversals*/
OCRbuy=O<(L+0.2*(H-L)) AND C>(H-0.2*(H-L)) AND H<Ref(H,-1) AND L<Ref(L,-1) AND C<Ref(C,-1);
OCRsell=O>(L+0.8*(H-L)) AND C<(H-0.8*(H-L)) AND H>Ref(H,-1) AND L>Ref(L,-1) AND C>Ref(C,-1);

/*Pivot Point Reversals*/
PPRbuy=Ref(L,-1)<Ref(L,-2) AND Ref(L,-1)<L AND C>Ref(H,-1);
PPRsell=Ref(H,-1)>Ref(H,-2) AND Ref(H,-1)>H AND C<Ref(L,-1);

Graph0 = Close;
Graph0Style = 128;


Graph0BarColor = IIf( CPRbuy, 8, IIf( CPRsell,4,  IIf( HRbuy,10, IIf( HRsell,11, IIf( IRbuy,3,  IIf( IRsell,15, IIf( KRbuy,6,  IIf( KRsell,7,  IIf( OCRbuy,9,  IIf( OCRsell,13,  IIf( PPRbuy,16,  IIf( PPRsell,12, 1 ) ) ) ) ) ) ) ) ) ) ) ) ;

ch= (Close-(Ref(Close,-1)));

Title =Date()+" "+Name()+" Open"+WriteVal(O)+" High"+WriteVal(H)+" Low"+WriteVal(L)+" Close" + WriteVal(Graph0) + " Previous Close " + WriteVal((Ref(Graph0,-1))) + "Change=" + WriteVal(ch)+" ("+WriteVal(chpct,format=1.2)+"%)";

Open chat
Hi, how can I help you?