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 ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

MA Plurality for Amibroker (AFL)

Copy & Paste Friendly
_SECTION_BEGIN("a new Moving_Average_Plurality 3");
/* Moving Average Plurality
When red line touches bottom green line, that’s a buy signal.
When red line touches upper red line, that’s a sell or short signal.
Use with T3 to verify T3 moves use an oscillator such as IFT of RSI
or Slow Stochastic alongside
*/


varPeriod1 = Param("per1",10,1,100,1);
varPeriod2 = Param("per2",50,1,100,1);
varPeriod3 = Param("per3",100,1,500,5);
varPeriod4 = Param("per4",200,1,500,5);
varPeriod5 = Param("per5",5,1,100,1);
varClose = (H+L+O+C)/4;
varMA1 = MA(varClose,varPeriod1);
varMA2 = MA(varClose,varPeriod2);
varMA3 = MA(varClose,varPeriod3);
varMA4 = MA(varClose,varPeriod4);
varMA5 = MA(varClose,varPeriod5);

varContract1 = IIf((varMA2-varMA1)<(Ref(varMA2,-1)-Ref(varMA1,-
1)),8,0);
varExpand1 = IIf((varMA2-varMA1)>(Ref(varMA2,-1)-Ref(varMA1,-1)),-
8,0);

varContract2 = IIf((varMA4-varMA2)<(Ref(varMA4,-1)-Ref(varMA2,-
1)),10,0);
varExpand2 = IIf((varMA4-varMA2)>(Ref(varMA4,-1)-Ref(varMA2,-1)),-
10,0);

varContract3 = IIf((varMA2-C)<(Ref(varMA2,-1)-Ref(C,-1)),1,0);
varExpand3 = IIf((varMA2-C)>(Ref(varMA2,-1)-Ref(C,-1)),-1,0);

varContract4 = IIf((varMA4-C)<(Ref(varMA4,-1)-Ref(C,-1)),5,0);
varExpand4 = IIf((varMA4-C)>(Ref(varMA4,-1)-Ref(C,-1)),-5,0);

varContract5 = IIf((varMA1-C)<(Ref(varMA1,-1)-Ref(C,-1)),1,0);
varExpand5 = IIf((varMA1-C)>(Ref(varMA1,-1)-Ref(C,-1)),-1,0);

varContract6 = IIf((varMA5-C)<(Ref(varMA5,-1)-Ref(C,-1)),1,0);
varExpand6 = IIf((varMA5-C)>(Ref(varMA5,-1)-Ref(C,-1)),-1,0);

varUptrend1 = IIf(varMA1>varMA2,1,0);
varDowntrend1 = IIf(varMA1<varMA2,-1,0);

varUptrend2 = IIf(varMA2>varMA4,1,0);
varDowntrend2 = IIf(varMA2<varMA4,-1,0);
varUptrend3 = IIf(C>varMA2,5,0);
varDowntrend3 = IIf(C<varMA2,-5,0);

varUptrend4 = IIf(C>varMA4,7,0);
varDowntrend4 = IIf(C<varMA4,-7,0);

varUptrend5 = IIf(C>varMA1,1,0);
varDowntrend5 = IIf(C<varMA1,-1,0);

varUptrend6 = IIf(C>varMA5,1,0);
varDowntrend6 = IIf(C<varMA5,-1,0);

//VarPriceSum = IIf(C>Ref(C,-1),20,IIf(C<Ref(C,-1),-20,0));
VarHLSum = IIf(H>Ref(H,-1),20,IIf(L<Ref(L,-1),-20,0));
VarExtremeMove = IIf(C>1.02*Ref(C,-1),20,IIf(C<0.98*Ref(C,-1),-20,0));

// Summation
varPlot =
varContract1 +
varExpand1 +
varUptrend1 +
varDowntrend1 +
varContract2 +
varExpand2 +
varUptrend2 +
varDowntrend2 +
varContract3 +
varExpand3 +
varUptrend3 +
varDowntrend3 +
varContract4 +
varExpand4 +
varUptrend4 +
varDowntrend4 +
varContract5 +
varExpand5 +
varUptrend5 +
varDowntrend5 +
varContract6 +
varExpand6 +
varUptrend6 +
varDowntrend6;

VarPlot1 = Wilders(varPlot,3);
VarPlot1 = Wilders(VarPlot1,4);

VarPlot2 = WMA(varPlot,5);
VarPlot2 = WMA(VarPlot2,20);

//Plot(VarPlot1,"",colorBlue,styleThick);

// Plot Colored Line
Plot(VarPlot2,"",colorPink,styleDots);
Graph0BarColor=IIf(VarPlot2>Ref(VarPlot2,-2),colorYellow,colorBlue);

VarPlot3 = VarPlot + VarHLSum + VarExtremeMove;
VarPlot3 = WMA(varPlot3,2);
//Plot(VarPlot3,"",colorWhite,styleLine);
VarPlot3 = Wilders(VarPlot3,2);

Plot(VarPlot3,"",colorRed,styleThick);

//Plot((VarPlot3+VarPlot1)/2,"",colorWhite,styleThick);

GraphXSpace=8;

Title = "MA Plurality";
VarLowExtreme = LLV(VarPlot3,20);
Plot(VarLowExtreme,"",colorDarkGreen,styleLine);

VarLowExtreme2 = LLV(VarPlot3,100);
Plot(VarLowExtreme2,"",colorDarkGreen,styleDots);

VarHighExtreme = HHV(VarPlot3,20);
Plot(VarHighExtreme,"",colorDarkRed,styleLine);

VarHighExtreme2 = HHV(VarPlot3,100);
Plot(VarHighExtreme2,"",colorDarkRed,styleDots);

Buy= VarPlot3 < (VarLowExtreme AND VarLowExtreme2);
Sell= VarPlot3 >( VarHighExtreme AND VarHighExtreme2);
_SECTION_END();
Back