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 ....
WiseTrader Toolbox
#1 Selling Amibroker Plugin featuring:
Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Zerolag Tema System for Amibroker (AFL)
Copy & Paste Friendly
Back
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | _SECTION_BEGIN ( "Heikin Ashi" ); function ZeroLagTEMA( array, period ) { TMA1 = TEMA ( array, period ); TMA2 = TEMA ( TMA1, period ); Diff = TMA1 - TMA2; return TMA1 + Diff ; } /////////////////////// Heikin-Ashi code HaClose = ( O + H + L + C )/4; HaOpen = AMA ( Ref ( HaClose, -1 ), 0.5 ); avp = Param ( "Up TEMA avg" , 34, 1, 100 ); avpdn = Param ( "Dn TEMA avg" , 34, 1, 100 ); // Velvoort is using not original, but modified Heikin-Ashi close HaClose = ( HaClose + HaOpen + Max ( H , HaOpen ) + Min ( L , HaOpen ) )/4; // up average ZlHa = ZeroLagTEMA( HaClose, avp ); ZlCl = ZeroLagTEMA( ( H + L ) / 2, avp ); ZlDif = ZlCl - ZlHa; keep1 = Hold ( HaClose >= HaOpen, 2 ); keep2 = ZlDif >= 0; keeping = keep1 OR keep2; keepall = keeping OR ( Ref ( keeping, -1 ) AND ( C > O ) OR C >= Ref ( C , -1 ) ); keep3 = abs ( C - O ) < ( H - L ) * 0.35 AND H >= Ref ( L , -1 ); utr = keepall OR ( Ref ( keepall, -1 ) AND keep3 ); // dn average ZlHa = ZeroLagTEMA( HaClose, avpdn ); ZlCl = ZeroLagTEMA( ( H + L ) / 2, avpdn ); ZlDif = ZlCl - ZlHa; keep1 = Hold ( HaClose < HaOpen, 2 ); keep2 = ZlDif < 0; keeping = keep1 OR keep2; keepall = keeping OR ( Ref ( keeping, -1 ) AND ( C < O ) OR C < Ref ( C , -1 ) ); keep3 = abs ( C - O ) < ( H - L ) * 0.35 AND L <= Ref ( H , -1 ); dtr = keepall OR ( Ref ( keepall, -1 ) AND keep3 ); upw = dtr == 0 AND Ref ( dtr, -1 ) AND utr; dnw = utr == 0 AND Ref ( utr, -1 ) AND dtr; Haco = Flip ( upw, dnw ); if ( ParamToggle ( "Chart Type" , "Price with color back|HACO wave" ) ) { Plot ( Haco, "Haco" , colorRed ); } else { Plot ( C , "Close" , colorBlack , ParamStyle ( "Style" , styleCandle , maskPrice ) ); Plot ( 1, "" , IIf ( Haco , colorPaleGreen , colorPink ), styleArea | styleOwnScale | styleNoLabel , 0, 1 ); } def_Buy = GetFnData ( "Beta" )>1.1 AND V >1000 AND V > EMA ( V ,50) AND Close >10; def_Sell = GetFnData ( "Beta" )>1.1 AND V >1000 AND V > EMA ( V ,50) AND Close >10; //Buy = def_Buy AND Flip(upw,dnw) AND Ref(Flip(dnw,upw),-1); //Sell = def_Sell AND Flip(dnw,upw) AND Ref(Flip(upw,dnw),-1); sector = SectorID (1); industry = IndustryID (1); //........................................... Haco= Flip (upw,dnw); hc = Haco - Ref (Haco,-1);hc = Ref (hc,-1); Buy = IIf (hc == 1,1,0); BuyPrice = O ; Sell = IIf (hc == -1,1,0); SellPrice = O ; Cover = Buy ; CoverPrice = O ; Short = Sell ; ShortPrice = O ; Filter = Buy OR Sell ; PlotShapes ( IIf ( Buy , shapeUpArrow , shapeNone ), colorGreen ,0, L ,-15); PlotShapes ( IIf ( Buy , shapeHollowUpArrow , shapeNone ), colorWhite ,0, L ,-15); PlotShapes ( IIf ( Buy , shapeHollowSmallCircle , shapeNone ), colorWhite ,0, BuyPrice ,0); PlotShapes ( IIf ( Sell , shapeDownArrow , shapeNone ), colorRed ,0, H ,-15); PlotShapes ( IIf ( Sell ,shapeHollowDownArrow, shapeNone ), colorWhite ,0, H ,-15); PlotShapes ( IIf ( Sell , shapeHollowSmallCircle , shapeNone ), colorWhite ,0, SellPrice ,0); PlotShapes ( IIf ( Short , shapeDownTriangle , shapeNone ), colorYellow ,0, H , IIf ( Short AND Sell ,-30,-15)); PlotShapes ( IIf ( Short ,shapeHollowDownTriangle, shapeNone ), colorWhite ,0, H , IIf ( Short AND Sell ,-30,-15)); PlotShapes ( IIf ( Short , shapeHollowCircle , shapeNone ), colorWhite ,0, ShortPrice ,0); PlotShapes ( IIf ( Cover , shapeUpTriangle , shapeNone ), colorLightBlue ,0, L , IIf ( Cover AND Buy ,-30,-15)); PlotShapes ( IIf ( Cover ,shapeHollowUpTriangle, shapeNone ), colorWhite ,0, L , IIf ( Cover AND Buy ,-30,-15)); PlotShapes ( IIf ( Cover , shapeHollowCircle , shapeNone ), colorWhite ,0, CoverPrice ,0); AddColumn ( IIf ( Buy , 66, IIf ( Sell , 83, Null )), "Buy/Sell" ,formatChar, IIf ( Buy , colorGreen , IIf ( Sell , colorRed , colorDefault )), colorDefault ,width = 60); AddColumn ( C , "Close" ,0, IIf ( C > Ref ( C ,-1), colorGreen , IIf ( C < Ref ( C ,-1), colorRed , colorBlue ))); AddColumn ( ROC ( C ,1), "Change %" ,0, IIf ( C > Ref ( C ,-1), colorGreen , IIf ( C < Ref ( C ,-1), colorRed , colorBlue ))); AddColumn ( V , "Volume" ,1.0, IIf ( V > Ref ( V ,-1) AND C > Ref ( C ,-1), colorGreen , IIf ( V > Ref ( V ,-1) AND C < Ref ( C ,-1), colorRed , colorBlue )), colorDefault ); AddColumn ( GetFnData ( "Beta" ), "Beta" ); AddTextColumn (Sector, "Sector Name" ); AddTextColumn (Industry, "Industry Name" ); AddColumn ( GetFnData ( "InsiderHoldPercent" ), "Insider Hold Percent" ); AddColumn ( GetFnData ( "InstitutionHoldPercent" ), "Institution Hold Percent" ); _SECTION_END (); |