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 ....
VWMA WITH CLOSE for Amibroker (AFL)
Copy & Paste Friendly
Back
// VWMA WITH CLOSE function VWMAFUNC(N) { VWMA=0; AvgVWMA=0; VWMA1=0; VWMA2=0; for(i=1; i <= 5; i++) { Vwma1 += Ref(V,-i)*Ref(C,-i); Vwma2 += Ref(V, -i); } VWMA = VWMA1 / VWMA2; AvgVWMA = MA(VWMA, N); return AvgVWMA; }; SumAVGVWMA=(VWMAFUNC(2)+VWMAFUNC(3) +VWMAFUNC(5)+VWMAFUNC(9)+VWMAFUNC(16)+VWMAFUNC(25)+VWMAFUNC(36)+VWMAFUNC(50)+VWMAFUNC(65)+ VWMAFUNC(81)+VWMAFUNC(101)+VWMAFUNC(121)+VWMAFUNC(144)+VWMAFUNC(169)+VWMAFUNC(197)+VWMAFUNC(225)+VWMAFUNC(257)+VWMAFUNC(289)+ VWMAFUNC(325)+VWMAFUNC(361)+VWMAFUNC(401)+VWMAFUNC(441)+VWMAFUNC(485)+VWMAFUNC(529)+VWMAFUNC(577)+VWMAFUNC(625)+VWMAFUNC(677)+ VWMAFUNC(729)+VWMAFUNC(785)+VWMAFUNC(841)+VWMAFUNC(901)+VWMAFUNC(961)+VWMAFUNC(1025)+VWMAFUNC(1089))/34; Plot(EMA(SumAVGVWMA,2),"VWMA WITH CLOSE",ParamColor( "Color", colorCycle ), styleLine,styleNoLabel, Null, Null ); Plot(EMA(SumAVGVWMA,3),"VWMA WITH CLOSE",ParamColor( "Color", colorCycle ), styleLine,styleNoLabel, Null, Null ); Plot(EMA(SumAVGVWMA,5),"VWMA WITH CLOSE",/*ParamColor( "Color", colorCycle )*/colorBlue, styleLine,styleNoLabel, Null, Null ); for(i=3;i<=200;i++) { Plot(EMA(SumAVGVWMA,(i*i)),"VWMA WITH CLOSE",ParamColor( "Color", colorCycle ), styleLine,styleNoLabel, Null, Null ); } Plot(BBandTop(SumAVGVWMA,2,2),"BBAND TOP",ParamColor( "Color", colorCycle ), styleLine,styleNoLabel, Null, Null ); Plot(BBandBot(SumAVGVWMA,2,2),"BBAND BOT",ParamColor( "Color", colorCycle ), styleLine,styleNoLabel, Null, Null ); t1= IIf((EMA(SumAVGVWMA,2)>EMA(SumAVGVWMA,3)),1,0); t2= IIf((EMA(SumAVGVWMA,4)>EMA(SumAVGVWMA,5)),1,0); t3= IIf((EMA(SumAVGVWMA,9)>EMA(SumAVGVWMA,16)),1,0); t4= IIf((EMA(SumAVGVWMA,16)>EMA(SumAVGVWMA,25)),1,0); //t4= IIf(Ref(Cross(EMA(SumAVGVWMA,16), EMA(SumAVGVWMA,25)),-1),1,0); t5= IIf((EMA(SumAVGVWMA,25)>EMA(SumAVGVWMA,36)),1,0); //t5= IIf(Ref(Cross(EMA(SumAVGVWMA,25), EMA(SumAVGVWMA,36)),-1),1,0); t6= IIf((EMA(SumAVGVWMA,36)>EMA(SumAVGVWMA,49)),1,0); //t7= IIf((EMA(SumAVGVWMA,49)>EMA(SumAVGVWMA,64)),1,0); t7= IIf(Ref(Cross(EMA(SumAVGVWMA,49), EMA(SumAVGVWMA,64)),-1),1,0); t8= IIf((EMA(SumAVGVWMA,64)>EMA(SumAVGVWMA,81)),1,0); t9= IIf(Ref(Cross(EMA(SumAVGVWMA,81), EMA(SumAVGVWMA,100)),-1),1,0); Buy = t1 + t2 + t3 + t4 + t5 + t6 + t7;// + t8 + t9; PlotShapes(IIf((Buy==7),shapeUpArrow,0),colorGreen,0); s1= IIf((EMA(SumAVGVWMA,2)<EMA(SumAVGVWMA,3)),1,0); s2= IIf((EMA(SumAVGVWMA,4)<EMA(SumAVGVWMA,5)),1,0); s3= IIf((EMA(SumAVGVWMA,9)<EMA(SumAVGVWMA,16)),1,0); s4= IIf((EMA(SumAVGVWMA,16)<EMA(SumAVGVWMA,25)),1,0); //s4= IIf(Ref(Cross(EMA(SumAVGVWMA,16), EMA(SumAVGVWMA,25)),-1),1,0); s5= IIf((EMA(SumAVGVWMA,25)<EMA(SumAVGVWMA,36)),1,0); //s5= IIf(Ref(Cross(EMA(SumAVGVWMA,25), EMA(SumAVGVWMA,36)),-1),1,0); s6= IIf((EMA(SumAVGVWMA,36)<EMA(SumAVGVWMA,49)),1,0); //s7= IIf((EMA(SumAVGVWMA,49)>EMA(SumAVGVWMA,64)),1,0); s7= IIf(Ref(Cross(EMA(SumAVGVWMA,64), EMA(SumAVGVWMA,49)),-1),1,0); s8= IIf((EMA(SumAVGVWMA,64)<EMA(SumAVGVWMA,81)),1,0); s9= IIf(Ref(Cross(EMA(SumAVGVWMA,100), EMA(SumAVGVWMA,81)),-1),1,0); Sell = s1 + s2 + s3 + s4 + s5 + s6 + s7;// + s8 + s9; PlotShapes(IIf((Sell==7),shapeDownArrow,0),colorRed,0);