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

Against all odds with chart n buy_sell arrow 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
//------------------------------------------------------------------------------
//
//  Against all odds. Written by Thierry HUITEL. Based on Jim Varney's work--
//  CANDLESTOCHASTICS-- , and all the amibroker group :-).This Exploration is a
//  scan for 24 different buy or sell signals that selects days when several
//  bullish or bearish indicators are triggered at the same time.
//
//------------------------------------------------------------------------------
 
/*Against all odds (draft). Written by Thierry HUITEL o-l---} */
/* based on Jim Varney's work-- CANDLESTOCHASTICS-- */
/*and all the amibroker group :-) */
 
/*
This Exploration is a scan for 24 different buy or sell signals.
The odds are 1 of 6 to get a TWO with a dice. If you try 1000 times, the odds are more than 99%.
The aim of the exploration is to find days when many bullish or bearish signs are triggered at the same time. If 5 indicators give a buy advice, it is more reliable than one.
I invite everybody to add your own systems to these ones, to improve the reliability. And experimented technical analysts could give advices to avoid the trap of using several different indicators all working off the same input data.
 
Vol Index: this column is the ratio of today's volume to the 14-day average volume.
This column should be sorted Descending. The best signals are occur when VolIndex is at least 2 or higher.
 
PCL[up]: Piercing Line, "up" signifies Bullish.
MDS[up]: Morning Doji Star
BLE[up]: Bullish Engulfing
HAM[up]: Hammer
BRE[dn]: Bearish Engulfing, "dn" signifies Bearish.
DCC[dn]: Dark Cloud Cover
EDS[dn]: Evening Doji Star
TDREI[up] & [dn]: Tom DeMark's Range Expansion Index
KUP[up] & [dn]: Keltner Bands -DIMITRIS TSOKAKIS
RSI[up] & [dn]: Relative Strength Index 14 periods
MFI[up] & [dn]: Money Flow Index
ST2[up] & [dn]: Stochastic Slow - Donald Dalley
DIV[up] & [dn]: % R divergence  -DIMITRIS TSOKAKIS
KST[up] & [dn]: MARTIN PRING'S KST MOMENTUM SYSTEM -TJ
COP[up]: Coppock Curve TJ
SMH[up] & [dn]: smash day pattern. DIMA
CHK[up] & [dn]: Chaikin Money Flow. Thierry Huitel
 
A "1" in the column signifies TRUE, a "0" indicates no signal.
------------------------------------------------------------------*/
 
_SECTION_BEGIN("Price");
 
GraphXSpace=5;
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, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
up=4969;
dn=4952;
//Plot(up,"UP Break",5,8);
//Plot(dn,"DN Break",4,8);
 
 
_SECTION_END();
 
"Commentaires sur  " + Name() +" pour le  "+Date();
 
/* Minimum Price and 14 day Avg Volume Values for Filter */
minPrice = 3;     //change as needed
minVol = 50000;   //change as needed
 
VolAvg = MA( V, 14 );
VolumeIdx = V / VolAvg;
AvgRange = Sum( abs(O-C),15 )/15;
 
/* Candle Codes */
White = IIf((C>O) AND ((C-O)>=0.8*(H-L)),1,0) AND (C-O)>AvgRange;
Black = IIf((C<O) AND ((O-C)>=0.8*(H-L)),1,0) AND (O-C)>AvgRange;
Doji  = IIf(abs(O-C)<=0.1*(H-L),1,0);
 
/* Dark Cloud Cover [Bear] */
DCC = IIf(Ref(White, -1) AND Black AND C<=Ref(((H+L)/2),-1)
    AND O>Ref(C,-1), 1,0);
 
/* Piercing Line [Bull] */
PL = IIf(Ref(Black, -1) AND White AND C>=Ref(((H+L)/2),-1)
    AND O<Ref(C,-1), 1,0);
 
/* Evening Doji Star [Bear] */
EDS = IIf(Ref(White, -2) AND Ref(Doji, -1) AND Black AND
    C<=Ref(((H+L)/2),-2), 1,0);
 
/* Morning Doji Star [Bull] */
MDS = IIf(Ref(Black, -2) AND Ref(Doji, -1) AND White AND
    C>=Ref(((H+L)/2),-2), 1,0);
 
/* Hammer [Bull] */
HAM = IIf( (H-L > 1.5*AvgRange) AND (C > (H+L)/2)  AND (O > C) AND
    (VolumeIdx > 2), 1, 0);
 
/* Bearish Engulfing */
BRE = IIf(Black AND Ref(White, -1) AND (C < Ref(O, -1))  AND (O > Ref(C, -1)), 1,0);
 
/* Bullish Engulfing */
BLE = IIf(White AND Ref(Black, -1) AND (C > Ref(O,-1))  AND (O < Ref(C,-1)), 1,0);
 
 
/* Stochastics 14-4 */
 
ss = MA(StochK(14),4);
StochBuy = IIf(ss<=20, 1, 0);
StochSell = IIf(ss>=80, 1, 0);
 
/* TDREI */
HighMom = H - Ref( H, -2 );
LowMom = L - Ref( L, -2 );
Cond1 = ( H >= Ref( L,-5) OR H >= Ref( L, -6 ) );
Cond2 = ( Ref( H, -2 ) >= Ref( C, -7 ) OR Ref( H, -2 ) >= Ref( C, -8 ) );
Cond3 = ( L <= Ref( H, -5 ) OR L <= Ref( H, -6) );   
Cond4 = ( Ref( L, -2 ) <= Ref( C, -7 ) OR Ref( L, -2 ) <= Ref( C, -8 ) );
Cond = ( Cond1 OR Cond2 ) AND ( Cond3 OR Cond4 );
Num = IIf( Cond, HighMom + LowMom, 0 );
Den = abs(  HighMom ) + abs( LowMom );
TDREI = 100 * Sum( Num, 5 )/Sum( Den, 5 ) ;
tdreiBuy = IIf(TDREI<=-95, 1, 0);
tdreiSell = IIf(TDREI>=95, 1, 0);
 
/* KUP */
KUP=EMA((H+L+C)/3,10)+EMA(H-L,10);
KDOWN=EMA((H+L+C)/3,10)-EMA(H-L,10);
kupBuy = IIf(Cross(C,KDOWN), 1, 0);
kupSell = IIf(Cross(KUP,C), 1, 0);
 
/*RSI*/
vrsi= RSI(14);
rsiBuy = IIf(Cross(vrsi,30), 1, 0);
rsiSell = IIf(Cross(70,vrsi), 1, 0);
 
/*MFI*/
mfiBuy = IIf(Cross(MFI(),30), 1, 0);
mfiSell = IIf(Cross(70,MFI()), 1, 0);
 
/*STO2*/
lookback = 14;
buyrange = 30;
sellrange = 70;
stochKworkaround = StochK(14);
stochDworkaround = EMA( StochK(14), 5);
sto2Buy = IIf(StochK(14) < buyrange AND Cross(stochKworkaround, stochDworkaround), 1, 0);
sto2Sell = IIf(StochK(14) > sellrange AND Cross(stochDworkaround, stochKworkaround), 1, 0);
 
/* %R, ema 9 and divergences */
 
R=-100*((HHV(High,14)-Close))/(HHV(High,14)-LLV(Low,14));
DIVR=(R-Ref(R,-1))*(C-Ref(C,-1));
DIVB=IIf((DIVR<0) AND (R-Ref(R,-1))>0 AND (Ref(R,-1)<-90),-100,0);
DIVB1=IIf((DIVR<0) AND (R-Ref(R,-1))>0 AND (Ref(R,-1)<-90),-80,0);
DIVS=IIf((DIVR<0) AND (R-Ref(R,-1))<0 AND (Ref(R,-1)>-10),-20,0);
divBuy = IIf(DIVB==-100, 1, 0);
divSell = IIf(DIVS==-20, 1, 0);
 
/*KST*/
 
KST =  (MA(ROC(Close,10),10) * 1) +
            (MA(ROC(Close,15),10) * 2) +
            (MA(ROC(Close,20),10) * 3) +
            (MA(ROC(Close,30),15) * 4);
kstBuy = IIf(Cross(KST ,  MA(KST, 109)), 1, 0);
kstSell = IIf(Cross(MA(KST , 120), KST), 1, 0);
 
/*COP*/
copBuy = IIf((EMA( ROC( MA( C, 22 ), 250 ), 150 ) / 100) < 0, 1, 0);
 
/*SMASH*/
numDays = 3; // Consider smash Day if closed above/below previous numDays highs/lows
closeInDayRangePct = 0.25; // Smash day close should be in the high/low %% of the day range
smashDayDown = Close < LLV (Ref (Low, -1), numDays) AND Close < Open AND Close < (Low + closeInDayRangePct * (High - Low));
smashDayUp = Close > HHV (Ref (High, -1), numDays) AND Close > Open AND Close > (High - closeInDayRangePct * (High - Low));
// Enter in the direction opposite to the smash day if the very next day price moves opposite the smash day.
smashBuy = IIf(Ref (smashDayDown, -1) AND High > Ref (High, -1), 1, 0);
smashSell = IIf(Ref (smashDayUp, -1) AND Low < Ref (Low, -1), 1, 0);
 
/*CHAIKIN MONEY FLOW*/
ICH = Sum(((( C-L )-( H-C )) / ( H-L ))*V, 21 ) / Sum(V,21);
LCH = LLV( ICH, 255 );
top = (LCH/2);
chkBuy = Cross (ICH, top);
chkSell = Cross (0, ICH);
 
/*number of buy signals --- give weight to your favorite ones with a coefficient. */
somme= PL + MDS + HAM + BLE + tdreiBuy + kupBuy + rsiBuy + (2*mfibuy) + sto2Buy + (2*divBuy) + kstBuy + copBuy + (2*smashBuy) + chkBuy;
 
/*number of sell signals. */
somme2 = BRE + DCC + EDS + tdreiSell + kupSell + rsiSell + mfiSell + sto2Sell + divSell + divSell + kstSell + smashSell + chkSell;
 
/*Guru comment*/
"number of buy indicators triggered: " + WriteVal (somme) ;
"Aujourd'hui, les signaux haussiers suivants ont été déclenchés: ";
 
/* Exploration Columns for Sorting */
 
NumColumns = 29;
 
Column0 = V;
Column1 = VolumeIdx;
Column2 = somme;
Column3 = PL;
Column4 = MDS;
Column5 = BLE;
Column6 = HAM;
Column7 = BRE;
Column8 = DCC;
Column9 = EDS;
Column10 = tdreiBuy;
Column11 = tdreiSell;
Column12 = kupBuy;
Column13 = kupSell;
Column14 = rsiBuy;
Column15 = rsiSell;
Column16 = mfiBuy;
Column17 = mfiSell;
Column18 = sto2Buy;
Column19 = sto2Sell;
Column20 = divBuy;
Column21 = divSell;
Column22 = kstBuy;
Column23 = kstSell;
Column24 = copBuy;
Column25 = smashBuy;
Column26 = smashSell;
Column27 = chkBuy;
Column28 = chkSell;
 
Column0Name = "Volume";
Column1Name = "Vol Idx";
Column2Name = "triggers";
Column3Name = "PCL[up]";
Column4Name = "MDS[up]";
Column5Name = "BLE[up]";
Column6Name = "HAM[up]";
Column7Name = "BRE[dn]";
Column8Name = "DCC[dn]";
Column9Name = "EDS[dn]";
Column10Name = "TDREI[up]";
Column11Name = "TDREI[dn]";
Column12Name = "KUP[up]";
Column13Name = "KUP[dn]";
Column14Name = "RSI[up]";
Column15Name = "RSI[dn]";
Column16Name = "MFI[up]";
Column17Name = "MFI[dn]";
Column18Name = "ST2[up]";
Column19Name = "ST2[dn]";
Column20Name = "DIV[up]";
Column21Name = "DIV[dn]";
Column22Name = "KST[up]";
Column23Name = "KST[dn]";
Column24Name = "COP[up]";
Column25Name = "SMH[up]";
Column26Name = "SMH[dn]";
Column27Name = "CHK[up]";
Column28Name = "CHK[dn]";
 
Column0Format = 1.0;
Column1Format = 1.1;
Column2Format = 1.1;
Column3Format = 1.2;
Column4Format = 1.0;
Column5Format = 1.0;
Column6Format = 1.0;
Column7Format = 1.0;
Column8Format = 1.0;
Column9Format = 1.0;
Column10Format = 1.0;
Column11Format = 1.0;
Column12Format = 1.0;
Column13Format = 1.0;
Column14Format = 1.0;
Column15Format = 1.0;
Column16Format = 1.0;
Column17Format = 1.0;
Column18Format = 1.0;
Column19Format = 1.0;
Column20Format = 1.0;
Column21Format = 1.0;
Column22Format = 1.0;
Column23Format = 1.0;
Column24Format = 1.0;
Column25Format = 1.0;
Column26Format = 1.0;
Column27Format = 1.0;
Column28Format = 1.0;
 
/* Filter */
/*the highest % for somme gives the most reliable buy signal*/
Filter = somme>=6 AND VolumeIdx>=2;
/*Filter = ((C > minPrice) AND (VolAvg >= minVol)) AND (StochBuy AND (PL or MDS or BLE or HAM)) OR (StochSell AND (BRE or DCC or EDS));*/
 
 
/* Buy and Sell */
/* set your own requirements: how many indicators triggered at the same time */
Buy = somme>=6;
Sell = somme2>=3;
PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorBlue,0,L,Offset=-10);
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed,0,H,Offset=-10);
WriteVal (somme);
Back