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 ....
VDV_Auto_Stoch_Oscillator_V_1_0 for Amibroker (AFL)
Copy & Paste Friendly
Back
k = Param("k", 0.3, 0.1, 2, 0.1); function IIR2( input, f0, f1, f2 ) { IIR[ 0 ] = input[ 0 ]; IIR[ 1 ] = input[ 1 ]; for( i = 2; i < BarCount; i++ ) { IIR[ i ] = f0 * input[ i ] + f1 * IIR[ i - 1 ] + f2 * IIR[ i - 2 ]; } return IIR; } y=IIR2( Close, 0.3, 1.2+K, -0.5-K); Convex = (y - Ref(y, -1)) >= (y-Ref(y, -2))/2; Concave = NOT(Convex);Up = y>=Ref(y, -1); Down= NOT(Up); StartU = Convex AND Up; FinishU = Concave AND Up; StartD = Concave AND Down; FinishD = Convex AND Down; U = IIf(StartU == 1 AND Ref(FinishD == 1,-1), 1, 0); D = IIf(StartD == 1 AND Ref(FinishU == 1,-1), 1, 0); bar = BarIndex(); dot[0] = 0; rep[0] = 0; for(i = 1; i < BarCount; i++) { dot[i] = dot[i-1]; rep[i] = rep[i-1]; if(D[i] == 1) { dot[i] = i; } if(dot[i] > dot[i-1]) { rep[i] = i - dot[i-1]; } } f1 = WMA(rep/2, rep); // можно подбирать разные виды осреднения FF = WMA((C-L)/(H-L), f1); // неплохо MA((C - Ref(C,-1)) / (H - L), f1); WMA((C - Ref(C,-1)) / (H - L), f1); и др. Plot(FF,"VDV_Auto_Stoch_Oscillator" , colorPink, styleLine); WriteVal(FF,1.4);