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
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
_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