Stock Portfolio Organizer
The ultimate porfolio management solution.
WiseTrader Toolbox
#1 Selling Amibroker Plugin featuring:
Trend Exploration: Slope Moving Average for Amibroker (AFL)
This exploration uses a lot of color and the slope of a moving averages to rank and filter out securities in the exploration window.
By marcus – marcusdavidsson
Indicator / Formula
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 111 112 113 114 115 116 | // I use this moving averige exploration with daily data! ////////////////////////////////////////////////////////////// SetOption ( "NoDefaultColumns" , True ); Filter = Status ( "lastbarinrange" ); DTL=140; // DTL = Define Trend Long DTM=50; // DTM = Define Trend Medium DTS=10; // DTS = Define Trend Short ////////////////////////////////////////////////////////////// TL= LinRegSlope ( MA ( C , DTL),2); // TL = Trend Long TM= LinRegSlope ( MA ( C , DTM),2); // TM = Trend Medium TS= LinRegSlope ( MA ( C , DTS),2); // TS = Trend Short TLL= IIf ( LinRegSlope ( MA ( C , DTL),2) > 0, True , False ); TMM= IIf ( LinRegSlope ( MA ( C , DTM),2) > 0, True , False ); TSS= IIf ( LinRegSlope ( MA ( C , DTS),2) > 0, True , False ); TLLL= WriteIf (TL>0 AND TL<0.3, "+" , WriteIf (TL>=0.3 AND TL<0.6 , "+ +" , WriteIf (TL>=0.6, "+ + +" , WriteIf (TL<0 AND TL>-0.3, "-" , WriteIf (TL<=-0.3 AND TL>-0.6 , "- -" , WriteIf (TL<=-0.6, "- - -" , "" )))))); TMMM= WriteIf (TM>0 AND TM<0.3, "+" , WriteIf (TM>=0.3 AND TM<0.6 , "+ +" , WriteIf (TM>=0.6, "+ + +" , WriteIf (TM<0 AND TM>-0.3, "-" , WriteIf (TM<=-0.3 AND TM>-0.6 , "- -" , WriteIf (TM<=-0.6, "- - -" , "" )))))); TSSS= WriteIf (TS>0 AND TS<0.3, "+" , WriteIf (TS>=0.3 AND TS<0.6 , "+ +" , WriteIf (TS>=0.6, "+ + +" , WriteIf (TS<0 AND TS>-0.3, "-" , WriteIf (TS<=-0.3 AND TS>-0.6 , "- -" , WriteIf (TS<=-0.6, "- - -" , "" )))))); ///////////////////////////////////////////////////////////// AddTextColumn ( Name (), "ticker" , 1, colorDefault , IIf (TLL== True AND TMM== True AND TSS== True , colorGreen , IIf (TLL== False AND TMM== False AND TSS== False , colorRed , colorYellow )),-1 ) ; AddColumn ( DateTime (), "date/time" , formatDateTime, colorDefault , IIf (TLL== True AND TMM== True AND TSS== True , colorGreen , IIf (TLL== False AND TMM== False AND TSS== False , colorRed , colorYellow )),-1 ) ; AddTextColumn ( TLLL, "MA" +-DTL, 1 , colorDefault , IIf ( TLL== True , colorGreen , colorRed ),-1 ); AddTextColumn ( TMMM, "MA" +-DTM, 1 , colorDefault , IIf ( TMM== True , colorGreen , colorRed ),-1 ); AddTextColumn ( TSSS, "MA" +-DTS, 1 , colorDefault , IIf ( TSS== True , colorGreen , colorRed ),-1 ); ////////////////////////////////////////////////////////////// message= WriteIf (TL>=0.3 AND TM>=0.3 AND TS>=0.3, "Strong Up Trend" , WriteIf (TL<=-0.3 AND TM<=-0.3 AND TS<=-0.3, "Strong Down Trend" , WriteIf (TLL== True AND TMM== True AND TSS== True , "Up Trend" , WriteIf (TLL== False AND TMM== False AND TSS== False , "Down Trend" , "No Trend" )))); AddTextColumn ( message, "Overall Trend" , 1 , colorDefault , IIf (TLL== True AND TMM== True AND TSS== True , colorGreen , IIf (TLL== False AND TMM== False AND TSS== False , colorRed , colorYellow )),-1 ); ////////////////////////////////////////////////////////////// x = IIf ( Cross ( LinRegSlope ( MA ( C , DTL),2),0) OR Cross (0, LinRegSlope ( MA ( C , DTL),2) ), True , False ); y = BarIndex ()- ValueWhen (x== True , BarIndex (),1); Phase= WriteIf (Y>=400, "Mature" , WriteIf (Y>100 AND Y<400, "Progress" , WriteIf (Y<=100, "Initial" , "" ))); AddTextColumn ( Phase, "Trend Phase" , 1 , colorDefault , IIf (TLL== True AND TMM== True AND TSS== True , colorGreen , IIf (TLL== False AND TMM== False AND TSS== False , colorRed , colorYellow )),-1 ) ; ////////////////////////////////////////////////////////////// Comments= WriteIf (Y>=400, "Mature trend with risk of bubble" , WriteIf (y<400 AND TLL== True AND TMM== True AND TSS== True , "Keep on coming baby $" , WriteIf (y<15 AND TLL== True AND TMM== True AND TSS== True OR TLL== False AND TMM== False AND TSS== False , "Are you going to grow up and become a big boy?" , WriteIf (y<400 AND TLL== False AND TMM== False AND TSS== False , "Keep on coming baby $$" , WriteIf (TLL== True AND TMM== True AND TSS== False OR TLL== False AND TMM== False AND TSS== True , "Risk for short term reversal" , WriteIf (TLL== True AND TMM== False AND TSS== True OR TLL== False AND TMM== True AND TSS== False , "trading range-avoid" , "live to trade another day" )))))); AddTextColumn ( Comments, "Comments" , 1, colorDefault , IIf (TLL== True AND TMM== True AND TSS== True , colorGreen , IIf (TLL== False AND TMM== False AND TSS== False , colorRed , colorYellow )),-1 ) ; ////////////////////////////////////////////////////////////// |
3 comments
Leave Comment
Please login here to leave a comment.
Back
error : missing buy/sell variable assignment
is there any changes to made
If you want buy and sell signal they need to be added.