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 ....
Trend Short Term Indicator 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 | SetBarsRequired (100000,0); GraphXSpace = 3; k = Param ( "K" , 0.01, 0, 0.2, 0.001); Trend[0] = 1; Revers[0] = C [0] - C [0]*k; PE[0] = C [0]; for (i = 1; i < BarCount ; i++) { if (Trend[i-1] == 1) { if ( C [i] > PE[i-1]) { Trend[i] = 1; PE[i] = C [i]; Revers[i] = C [i] - C [i]*k; } else { if ( C [i] < Revers[i-1]) { Trend[i] = -1; PE[i] = C [i]; Revers[i] = C [i] + C [i]*k; } else { Trend[i] = 1; PE[i] = PE[i-1]; Revers[i] = Revers[i-1]; } } } //====================================== else { if ( C [i] < PE[i-1]) { Trend[i] = -1; PE[i] = C [i]; Revers[i] = C [i] + C [i]*k; } else { if ( C [i] > Revers[i-1]) { Trend[i] = 1; PE[i] = C [i]; Revers[i] = C [i] - C [i]*k; } else { Trend[i] = -1; PE[i] = PE[i-1]; Revers[i] = Revers[i-1]; } } Plot (Revers, "Trend Short Term" , IIf (Trend == 1, 27, 4), 4); _SECTION_BEGIN ( "Trend Short Term" ); SetChartOptions (0, chartShowArrows | chartShowDates ); _N (Title = StrFormat ( "{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " + WriteVal ( V , 1.0 ) + " {{VALUES}}" , O , H , L , C , SelectedValue ( ROC ( C , 1 )) )); Plot ( C , "" , ParamColor ( "Color" , colorBlack ), styleNoTitle | ParamStyle ( "Style" ) | GetPriceStyle () ); _SECTION_END (); Buy = Cross ( Close ,Revers); Sell = Cross (revers, Close ); PlotShapes ( Buy * shapeUpArrow , colorGreen , 0, Low ); PlotShapes ( Sell * shapeDownArrow , colorRed , 0, High ); |