Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Simple Pattern for Amibroker (AFL)

Copy & Paste Friendly
_SECTION_BEGIN("Chart Pattern Simple");



Reentry = Re

Breakout = Breakout

TC = uptrend(1) OR downtrend(-1)

Patterns

AT(+1) = Ascending Triangle

DT(-1) = Descending Triangle

ST(+1) = Symmetrical Triangle

ET(-1) = Extended Triangle

RW(+1) = Rising Wedge

FW(-1) = Falling Wedge

ROC SL = daily ROC Support Line (SL)

ROC RL = daily ROC Resistance Line (RL)


*/

Per = 1; 

V1 = 1.05; 

V2 = 1.01; 


Color_SL= colorRed;Color_PHL=colorRed; 

Color_RL= colorBlue;Color_PLL=colorBlue; 

DisRange = 15; 


x = Cum(1); s1=L;s11=H; 


PS = TroughBars(s1,per,1) == 0;

xb = LastValue(ValueWhen(PS,x,1));

xa = LastValue(ValueWhen(PS,x,2));

yb = LastValue(ValueWhen(PS,s1,1));

Ya = LastValue(ValueWhen(PS,s1,2));

xab_log = log(yb/yA)/(xb-xa);

SL = exp((x-xb)*xab_log)*yb;

RocSL = ROC(SL,1);


PR1 = PeakBars(s11,per,1) == 0;

Xd = LastValue(ValueWhen(pR1,x,1 ));

xc = LastValue(ValueWhen(pR1,x,2 ));

yd = LastValue(ValueWhen(pR1,s11,1));

Yc = LastValue(ValueWhen(pR1,s11,2));

xcd_log = log(yd/yc)/(xd-xc);

RL = exp((x-xd)*xcd_log)*yd;

RocRL = ROC(RL,1);


Low_Value = LastValue(Ref(LLV(L,xd-xc),-(x-xd)));

x2 = LastValue(ValueWhen(L==Low_Value & x>xc & x<xd,x));

PLL = IIf(LastValue(x)-x2>5,exp((x-x2)*xcd_log)*Low_Value,-1e10);


Hi_Value = LastValue(Ref(HHV(H,xb-xa),-(x-xb)));

x3 = LastValue(ValueWhen(H==Hi_Value & x>xa & x<xb,x));

PHL = IIf(LastValue(x)-x3>5,exp((x-x3)*xab_log)*Hi_Value,-1e10);



parallel= abs(1-RocRL/RocSL)<0.1;

uptrend= (RocSL>0 & RocRL>0 & parallel) OR (L<1.05*PLL & H>0.95*PLL);

downtrend=(RocSL<0 & RocRL<0 & parallel)OR (H<1.05*PHL & H>0.95*PHL);

DT_UT = IIf (Downtrend & parallel,-1,IIf(Uptrend & parallel,1,0));




bu_Breakout = Cross(C,RL) & X>XD; 

be_Breakout = Cross(SL,C) & X>XB;

breakout = bu_breakout OR be_breakout;


RSL_b = L<V1*SL & L>V2*SL & Ref(L,-1)>V2*SL; 


RSL_a = L<=V2*SL & L>0.99*SL & Ref(L,-1)>SL & C>SL;


RPLL_b = L>Low_Value & L<V1*PLL & L>V2*PLL & Ref(L,-1)>V2*PLL;

RPLL_a = L>Low_Value & L<V2*PLL & L>0.99*PLL & Ref(L,-1)>PLL & C>PLL;

ARb = RSL_b OR RPLL_b; 

ARa = RSL_a OR RPLL_a; 

Ar = ARb OR ARa; 
Xm = xb-xa >4 & xd-xc >4; 

AT= abs(RocRL)<0.03 & RocSL>0.05 & xa<xd & xc<xb & Xm;

DT= abs(RocSL)<0.03 & RocRL<-0.05 & xa<xd & xc<xb & Xm;

AT_DT= IIf(AT,1,IIf(DT,-1,0));

ST= RocSL>0.03 & RocRL<-0.03 & RL>SL & 

xa<xd & xc<xb & Xm;

ET = RocRL>0.03 & RocSL<-0.03 & RL>SL & abs(ROCSL/ROCRL)<3 & xa<xd & xc<xb & Xm;

ST_ET = IIf(ST,1,IIf(ET,-1,0));

RW = RocRL>0.05 & RocSL>0.07 & RocSL>1.5*RocRL & Xm;

FW = RocSL<-0.05 & RocRL<-0.07 & RocRL<1.5*RocSL & Xm;

RW_FW = IIf (RW,1,IIf(FW,-1,0));

//////////////////////////////////////////7



S_RL = H>0.98*RL & C < RL;

S_PHL = H>0.98*PHL & C < PHL;



BS = bu_breakout OR Ar; 

SS = be_breakout OR S_RL OR S_PHL;

Buy = BS; Sell = SS;

Longfilter = C>MA(C,100);

Filter = Longfilter;

Reentry_Column = IIf(ARb,-1,IIf(ARa,1,0));

AddColumn(Reentry_Column,"Re",1.0);

bu_be_breakout = IIf (bu_breakout,1,IIf(be_breakout,-1,0));

AddColumn(bu_be_breakout,"B-out",1.0);

AddColumn(DT_UT,"TC",1);

AddColumn(AT_DT,"AT/DT",1);

AddColumn(ST_ET,"ST/ET",1);

AddColumn(RW_FW,"RW/FW",1);

AddColumn (IIf(C>SL,RocSL,0),"Roc(SL,1)",1.1);

AddColumn (IIf(C<RL,RocRL,0),"Roc(RL,1)",1.1);



PLLd = abs((LastValue(C)/LastValue(PLL))-1)<0.01*DisRange;

PHLd = abs((LastValue(C)/LastValue(PHL))-1)<0.01*DisRange; 

barvisible = Status("barvisible");

firstvisiblebar = barvisible & NOT 

Ref(barvisible,-1);

HHvisible = LastValue(HighestSince(firstvisiblebar,High));

LLvisible = LastValue(LowestSince(firstvisiblebar,Low));

RaH = HHvisible *1.05; 
RaL = LLVisible *0.95; 

SL_plot = IIf(x>=xa & SL>RaL & SL<RaH,SL,IIf(x>=xa & RaL==0 ,SL,-1e10));

RL_plot = IIf(x>=xc & RL>RaL & RL<RaH,RL,IIf(x>=xc & RaL==0,RL,-1e10));

PLL_plot = IIf(x-x2>=0 & abs(LastValue(C)/LastValue(exp((x-x2)*xcd_log)*Low_Value)-1)<0.01*DisRange & PLL>RaL & PLL<RaH,PLL,IIf(x-x2>=0 & RaL==0 & PLLd,PLL,-1e10));

PHL_plot = IIf(x-x3>=0 & abs(LastValue(C)/LastValue(exp((x-x3)*xab_log)*Hi_Value)-1)<0.01*DisRange & PHL>RaL & PHL<RaH,PHL,IIf(x-x3>=0 & RaL==0 & PHLd,PHL,-1e10));



GraphXSpace = 1.5;

LastBar = Cum(1) == LastValue(Cum(1));

Plot(C,"close",IIf(LastBar,IIf(BS,colorGreen,IIf(SS,4,1)),1),64);

Plot(SL_plot ,"SL" ,Color_SL,1+4+styleNoRescale);

Plot(RL_plot ,"RL" ,Color_RL,1+4+styleNoRescale);

Plot(PLL_plot,"PLL",Color_PLL,1+4+styleNoRescale);

Plot(PHL_plot,"PHL",Color_PHL,1+4+styleNoRescale);

Title = Name() + EncodeColor( colorRed )+" pds:" + WriteVal(per,1) +" " 

+ EncodeColor(colorBlue)+ Date()+EncodeColor(3)+" "+WriteVal(C,1.2)+ " ("+WriteIf(C>Ref(C,-1),"+","")+WriteVal(ROC(C,1),1.2)+"%)";

_SECTION_END();
Back