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 ....
دعوي للتفاؤل 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 | _SECTION_BEGIN ( "FullStoch" ); /*FastStoch%KFullStoch%K%D Originally Developed by George C. Lane For reference, see; http://stockcharts.com/education/Wha...scillator.html or, http://www.aspenres.com/Website/coms...ochastics.html Values about at OR above the Red line show overbought, AND about at OR below the Green line show oversold. where x is the first parameter, y is the second parameter and (in the case of Full stochastics), z is the third parameter. In the case of Fast and Slow Stochastics, x is typically 14 and y is usually set to 3. The formula could be plotted with three lines, Hence 14-3-3 or 14-5-3 or 14-3-5 %K (fast) %K (full) = y-day SMA of %K (fast) %D (full) = z-day SMA of %K (full) or just the usual 2 lines, %K (full) = y-day SMA of %K (fast) %D (full) = z-day SMA of %K (full) */ pds = 14; /*Periods */ /*pds = Optimize("pds",13,2,20,1); */ slw = 3; /*Slowing for Full Stoch%K*/ /*slw = Optimize("slw",3,1,14,1); */ slwd = 3; /*Slowing for Full Stoch%D*/ /*slwd = Optimize("slwd",3,1,14,1); */ ob = 83; /*Overbought */ /*ob = Optimize("ob",83,65,88,1); */ os = 20; /*Oversold */ /*os = Optimize("os",20,20,50,1); */ FSK = 100*( C - LLV ( L ,pds))/( HHV ( H ,pds)- LLV ( L ,pds)); // FASTSTOCHK FLSK = MA ( FSK, slw ); // FULLSTOCHK FLSD = MA ( FLSK, slwd ); // FULLSTOCHD MaxGraph = 6;Graph0 = FSK;Graph0Color = 7;Graph1 = FLSK;Graph1Color = 6;Graph2 = FLSD;Graph2Color = 23;Graph3 = FLSD;Graph3BarColor = IIf (Graph3 > ob, 13, IIf (Graph3 < os,8,14));Graph4 = ob;Graph4Color = 4;Graph5 = os;Graph5Color = 43;Graph0Style = Graph1Style = Graph2Style = Graph4Style = Graph5Style = 1;Graph3Style = 2;Title = Name ()+ " " + FullName ()+ " FastStoch%K=Yellow FullStoch%K = Blue FullStoch%D = Dark Grey" ; whengoup = FLSD < os AND Cross (FSK,os) AND FLSK >= Ref (FLSK,-1) AND FLSD >= Ref (FLSD,-1) OR Cross (FLSD,os) AND FSK >= Ref (FSK,-1) AND FLSK >= Ref (FLSK,-1) ; whengodown = IIf ( BarsSince ( Cross (os,FSK))==1 AND FLSK < os ,1,0) OR Cross (os,FSK) AND FLSK < Ref (FLSK,-1) OR FLSK < ob AND FLSK > os AND FLSK <= Ref (FLSK,-1) OR FSK > ob AND FLSK > ob AND FLSD > ob AND FSK < Ref (FSK,-1) AND FLSK < Ref (FLSK,-1) AND FLSD <= Ref (FLSD,-1) OR FSK > ob AND FLSK > ob AND FLSD > ob AND Cross (ob,FLSK); Buy = whengoup; Sell = whengodown; _SECTION_END (); //Stochastic //Abo Elias Feb-08-2008 _SECTION_BEGIN ( "Stochastic" ); SetChartOptions (0,0,chartGrid20|chartGrid80); periods = Param ( "Periods" , 14, 1, 200, 1); Ksmooth = Param ( "%K avg" , 3, 1, 200, 1 ); Kstyle = ParamStyle ( "%K Style" , styleLine ); Kcolor = IIf ( StochK (periods , Ksmooth) > Ref ( StochK (periods , Ksmooth),-1), ParamColor ( "Up Color" , colorGreen ), ParamColor ( "Down Color" , colorRed )); k = StochK (periods , Ksmooth); Plot (k, "%K" + _PARAM_VALUES (), Kcolor, Kstyle); Dsmooth = Param ( "%D avg" , 3, 1, 200, 1); Dcolor = ParamStyle ( "%D Color" , colorBlack ); Dstyle = ParamStyle ( "%D Style" , styleDashed ); d = StochD (periods , Ksmooth, DSmooth); Plot (d, "%D" + _PARAM_VALUES (), Dcolor, Dstyle); _SECTION_END (); _SECTION_BEGIN ( "Fill Color" ); Fillswitch = ParamToggle ( "Fill Color" , "On,Off" ,1); FillColor = IIf ( d > k, ParamColor ( "Up Fill Color" , colorPink ), ParamColor ( "Down Fill Color" , colorSeaGreen )); if ( NOT Fillswitch) PlotOHLC ( k,k,d,k, "" , FillColor, styleNoLabel | styleCloud ); _SECTION_END (); _SECTION_BEGIN ( "Buy/Sell Arrows" ); shapesswitch = ParamToggle ( "Arrows" , "On,Off" ,1); UPcolor = ParamColor ( "UP Color" , colorGreen ); DOWNcolor = ParamColor ( "Down Color" , colorRed ); Buy = Cross ( k, 20 ); shape = Buy * shapeUpArrow ; PlotShapes ( IIf (shapesswitch,-1e10,shape), IIf ( Buy , UPcolor, DOWNcolor )); Plot (60, "" , colorCustom11 ); _SECTION_END (); y0= LastValue ( Trough ( StochD ( periods , Ksmooth, DSmooth ),1,2)); y1= LastValue ( Trough ( StochD ( periods , Ksmooth, DSmooth ),1,1)); x0= BarCount - 1 - LastValue ( TroughBars ( StochD ( periods , Ksmooth, DSmooth ),1,2)); price_start= Close [x0] ; x1= BarCount - 1 - LastValue ( TroughBars ( StochD ( periods , Ksmooth, DSmooth ),1,1)); price_end= Close [ x1]; Line = LineArray ( x0, y0, x1, y1, 0 ); Plot ( Line, "Support line" , colorWhite , styleThick ); Buy = y1>y0 AND price_end<price_start; PlotShapes ( shapeUpArrow * Buy , colorGreen ,0, Line); |