Stock Portfolio Organizer
The ultimate porfolio management solution.
WiseTrader Toolbox
#1 Selling Amibroker Plugin featuring:
Price Chart STO - Basic for Amibroker (AFL)
Using STO indicator to decide buy signal with MA indicator.
Sell signal when SlowMA crosses FastMA.
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 | _SECTION_BEGIN ( "Auto Tread V.1" ); // Parameter Setting // StoLength = Param ( "STOLength" ,14,1,20,1); SmoothK = Param ( "SmoothK" ,3,1,7,1); SmoothD = Param ( "SmoothD" ,3,1,7,1); Overbought = 80 ; Oversold =20 ; Center = 50 ; FastPeriod = Param ( "FastMA" ,12,3,20,1); SlowPeriod = Param ( "SlowMA" ,26,20,40,1); PctChange = 0.1; // Slow Stochastic upper= HHV ( High ,StoLength); lower= LLV ( Low ,StoLength); oscillator=( Close -lower)/(upper-lower)*100; K = MA (oscillator,SmoothK); D = MA (K,SmoothD); //MA FastMA = MA ( Close ,FastPeriod); SlowMA = MA ( Close ,SlowPeriod); // Buy Condition // PrebuyCon1 = K < 50; PrebuyCon2 = Cross (K,D); PrebuyCon3 = FastMA < SlowMA ; buysignal = PrebuyCon1 AND PrebuyCon2 AND PrebuyCon3 ; //BuyPreCond = Trough(C,PctChange,1) > Trough(C,PctChange,2); //BuyTrigger = C > Peak(C,PctChange,1); //buysignal = BuyPreCond AND BuyTrigger; //buysignal = Cross(FastMA,SlowMA); // Sell Condition //sellsignal = ApplyStop(stopTypeLoss,stopModePercent,4); //cutloss = Close < buysignal; //sellsignal = IIf(cutloss,Close,Cross(SlowMA,FastMA)); sellsignal = Cross (SlowMA,FastMA); //SellPreCond = Peak(C,PctChange,1) < Peak(C,PctChange,2); //SellTrigger = C < Trough(C,PctChange,1); //sellsignal = SellPreCond AND SellTrigger; //sellsignal = SellPreCond; /* a = Cross(D,K); b = Cross(ma26,ma12); SellSignal = IIf( K >Overbought,a,IIf(K < Overbought AND K > OverSold,b,IIf(K < OverSold,a,b))); */ //PreSellCon1 = Cross(ema26,ema12); //PreSellCon2 = K < D; //SellSignal = PreSellCon1 AND PreSellCon2; //SellSignal = Cross(D,K); // Buy and Sell Buy = ExRem (buysignal,sellsignal); Sell = ExRem (sellsignal,buysignal); Bullish = BarsSince ( Buy ) < BarsSince ( Sell ); Bearish = BarsSince ( Sell ) < BarsSince ( Buy ); // Plots // Plot (FastMA, "FastPeriod" , colorGreen , styleLine ); Plot (SlowMA, "SlowPeriod" , colorRed , styleLine ); BarColor = IIf (Bullish, colorGreen , IIf (Bearish, colorRed , colorDefault )); PlotShapes ( Buy * shapeUpArrow , colorGreen ,0, Low ,-20); PlotShapes ( Sell * shapeDownArrow , colorRed ,0, High ,-20); Plot ( Close , "Price" ,BarColor, GetPriceStyle ()); ZigZagLine = Zig ( C ,PctChange); Plot (ZigZagLine, "Zig Zag" , colorBlack , styleLine ); //PlotShapes(ExRem(Trough(Low,PctChange,1),buysignal)*shapeHollowUpTriangle,colorBrown,0,Low,-20); //PlotShapes(cutloss*shapeUpTriangle,colorBlueGrey,0,Low,-20); /* Plot(K,"%K",colorBlue,styleLine); Plot(D,"%D",colorRed,styleLine); Plot(Overbought, "",colorRed,styleDashed) ; Plot(Oversold, "",colorGreen,styleDashed) ; Plot(Center, "",colorBlueGrey, styleDashed) ; */ // System Test // MaxPosition = 50; SetPositionSize (100/MaxPosition, spsPercentOfEquity ); SetOption ( "MaxOpenPositions" ,MaxPosition); _SECTION_END (); |
0 comments
Leave Comment
Please login here to leave a comment.
Back