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

Simple Buy Sell for Amibroker (AFL)
ajeet
about 13 years ago
Amibroker (AFL)

Rating:
5 / 5 (Votes 1)
Tags:
trading system, amibroker, exploration, optimize

This system is very simple that rides the trend
Can be used to book early profits on sudden fall or rise

Similar Indicators / Formulas

COMBO TRADE AFL
Submitted by SREENAN about 14 years ago
Bear Fear
Submitted by gera almost 14 years ago
RAJASWAMY INVESTING PURPOSE
Submitted by rajaswamy about 14 years ago
Alligator without Pivots
Submitted by deepak49 almost 15 years ago
Reaction Trend System
Submitted by ajayjain90 over 14 years ago
ema crossovers
Submitted by rushee.g1100 over 14 years ago

Indicator / Formula

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
// Author: mr.ajeetsingh@yahoo.com
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 )) ));
 
var1=Close>Ref(Close,-1) AND Close>Ref(Close,-2);
var2=Ref(var1,-1) AND Close<=Ref(Close,-1) AND
 
Close>=Ref(Close,-2);
var3=Ref(var2,-1) AND Close>=Ref(Close,-1) AND
 
Close<=Ref(Close,-2);
var4=Ref(var3,-1) AND Close<=Ref(Close,-1) AND
 
Close>=Ref(Close,-2);
var5=Ref(var4,-1) AND Close>=Ref(Close,-1) AND
 
Close<=Ref(Close,-2);
var6=Ref(var5,-1) AND Close<=Ref(Close,-1) AND
 
Close>=Ref(Close,-2);
var7=Ref(var6,-1) AND Close>=Ref(Close,-1) AND
 
Close<=Ref(Close,-2);
var8=Ref(var7,-1) AND Close<=Ref(Close,-1) AND
 
Close>=Ref(Close,-2);
var9=Ref(var8,-1) AND Close>=Ref(Close,-1) AND
 
Close<=Ref(Close,-2);
varA=Ref(var9,-1) AND Close<=Ref(Close,-1) AND
 
Close>=Ref(Close,-2);
varB=Ref(varA,-1) AND Close>=Ref(Close,-1) AND
 
Close<=Ref(Close,-2);
varC=Ref(varB,-1) AND Close<=Ref(Close,-1) AND
 
Close>=Ref(Close,-2);
varD=Close<Ref(Close,-1) AND Close<Ref(Close,-2);
varE= Ref(varD,-1)  AND Close>=Ref(Close,-1) AND
 
Close<=Ref(Close,-2);
varF= Ref(varE,-1)  AND Close<=Ref(Close,-1) AND
 
Close>=Ref(Close,-2);
var10=Ref(varF,-1)  AND Close>=Ref(Close,-1) AND
 
Close<=Ref(Close,-2);
var11=Ref(var10,-1) AND Close<=Ref(Close,-1) AND
 
Close>=Ref(Close,-2);
var12=Ref(var11,-1) AND Close>=Ref(Close,-1) AND
 
Close<=Ref(Close,-2);
var13=Ref(var12,-1) AND Close<=Ref(Close,-1) AND
 
Close>=Ref(Close,-2);
var14=Ref(var13,-1) AND Close>=Ref(Close,-1) AND
 
Close<=Ref(Close,-2);
var15=Ref(var14,-1) AND Close<=Ref(Close,-1) AND
 
Close>=Ref(Close,-2);
var16=Ref(var15,-1) AND Close>=Ref(Close,-1) AND
 
Close<=Ref(Close,-2);
var17=Ref(var16,-1) AND Close<=Ref(Close,-1) AND
 
Close>=Ref(Close,-2);
var18=Ref(var17,-1) AND Close>=Ref(Close,-1) AND
 
Close<=Ref(Close,-2);
down=varD OR varE OR varF OR var10 OR var11 OR var12
 
OR var13 OR var14
     OR var15 OR var16 OR var17 OR var18;
 
var19=Ref(varD OR varE OR varF OR var10 OR var11 OR
 
var12 OR var13 OR
     var14 OR var15 OR var16 OR var17 OR var18,-1) AND
 
var1;
 
var1A=Ref(var1 OR var2 OR var3 OR var4 OR var5 OR var6
 
OR var7 OR
     var8 OR var9 OR varA OR varB OR varC,-1) AND
 
varD;
 
up=IIf(var1 OR var2 OR var3 OR var4 OR var5 OR var6 OR
 
var7 OR var8 OR var9 OR varA OR varB OR varC,1,0);
top=Max(Close,Ref(Close,-1));
bot=Min(Close,Ref(Close,-1));
barcolor =IIf(up, ParamColor("Up candlestick",
 
colorBrightGreen ), ParamColor("Down candlestick",
 
colorOrange ));
PlotOHLC( bot,top,bot,top, "Close", barColor);
 
Buy = Close > Ref(Close, -1) AND Ref(Close, -1) > Ref
 
(Close, -2) AND Ref(Close, -1) < Ref(Close, -3) AND
 
IIf(Ref(Close, -3) < Ref(Close, -4), 1, IIf(Ref(Close,
 
-4) < Ref(Close, -5),Ref(Close, -1) < Ref(Close, -4)
 
OR( Ref(Close, -2) < Ref(Close, -4) AND Ref(Close, -3)
 
>= Ref(Close, -5) ),IIf(Ref(Close, -5) < Ref(Close, -
 
6), 1,Ref(Close, -6) < Ref(Close, -7))));
Sell = Close < Ref(Close, -1) AND Ref(Close, -1) <
 
Ref(Close, -2) AND Ref(Close, -1) > Ref(Close, -3) AND
 
IIf(Ref(Close, -3) > Ref(Close, -4), 1, IIf(Ref(Close,
 
-4) > Ref(Close, -5),Ref(Close, -1) > Ref(Close, -4)
 
OR( Ref(Close, -2) > Ref(Close, -4) AND Ref(Close, -3)
 
<= Ref(Close, -5) ),IIf(Ref(Close, -5) > Ref(Close, -
 
6), 1,Ref(Close, -6) > Ref(Close, -7))));
PlotShapes( IIf( Buy, shapeHollowUpArrow, shapeNone ),
 
10, layer = 0, yposition = bot, offset = -15  );
PlotShapes( IIf( Sell, shapeHollowDownArrow, shapeNone
 
), 13, layer = 0, yposition = top, offset = -15  );
 
 
MaxGraph = 12;
 
BuyOffSet = 18;//Optimize("BuyOffSet",-18,-15,-20,-1);
SellOffset = BuyOffSet;//Optimize("SellOffset",-2,-
 
2,-14,-2);
RegLength = 5;//Optimize("RegLength",5, 2,-11,-2);
BuyATRPeriod = 2;//Optimize("BuyATRPeriod",-2,-2,5,-
 
1);
SellATRPeriod = BuyATRPeriod;//Optimize
 
("SellATRPeriod",4,-2,-11,-2);
ATRMultiplier = 0.5;//Optimize("ATRMultiplier",-
 
1,0.7,-1.25,.05);
 
Graph8 = HHV(H-ATRMultiplier*ATR
 
(BuyATRPeriod),BuyOffset);
Graph9 = LLV(L+ATRMultiplier*ATR
 
(SellATRPeriod),SellOffset);
ave=(Graph8+Graph9)/2;
 
Graph8Style=Graph9Style = 1;
Graph9Color=  7;
Graph8Color = 6;
 
 
_SECTION_BEGIN("Volume");
Plot( Volume, "Volume", ParamColor("Color",
 
colorLightGrey ), 2 | 32768 );
_SECTION_END();
 
 
_SECTION_BEGIN("Exploration");
pfrom = Param("Price From", 0, 0, 1000, 0.5 );
pto = Param("Price To", 1000, 0, 1000, 0.5 );
Minv = Param("Minimum Volume (K)", 500, 0, 1000, 50);
dd = Param("Decimal Digits", 1.2, 1, 1.7, 0.1 );
 
Filter = (Buy OR Sell) AND C>pfrom AND C<pto AND
 
V>1000*Minv;
Color = IIf(Close>Open, colorGreen, colorRed);
bcolor = IIf(Buy, colorGreen, 1);
scolor = IIf(Sell, colorRed, 1);
 
AddColumn(Buy , "Buy" , 1.1, bcolor);
AddColumn(Sell , "Sell", 1.1, scolor);
AddColumn(O, "Open", dd, textColor = Color);
AddColumn(C, "Close", dd, textColor = Color);
AddColumn(Graph9, "Support", dd, textColor = Color);
AddColumn(Graph8, "Resistance", dd, textColor =
 
Color);
AddColumn(V, "Volume", 1, textColor = Color);
AddTextColumn(FullName(),"Name");
_SECTION_END();

10 comments

1. cute_marwarichora200

sir i just want to say i use amibroker 5.00 version but a error shown dere
ln;148,col;2;error 30.syntex error
ln:152,col:4:error 30.syntex error
ln:155,col:17:error 30.syntex error
ln:158,col:2:error 30.syntex error
plz try to solve my problm sir
thank you,

2. Kabir

i am using 5.20

still showing syntax error

3. prakash2009

ami 5.3.syntax error. admin pls correct.

4. joeoil

Try to replace line 145-158 with this code. Then I guess it should be without syntax error.

BuyOffSet = 18;//Optimize(“BuyOffSet”,-18,-15,-20,-1);
SellOffset = BuyOffSet;//Optimize(“SellOffset”,-2,-2,-14,-2);
RegLength = 5;//Optimize(“RegLength”,5, 2,-11,-2);
BuyATRPeriod = 2;//Optimize(“BuyATRPeriod”,-2,-2,5,-1);
SellATRPeriod = BuyATRPeriod;//Optimize(“SellATRPeriod”,4,-2,-11,-2);
ATRMultiplier = 0.5;//Optimize(“ATRMultiplier”,-1,0.7,-1.25,.05);

5. cute_marwarichora200

sir still showing error

6. ajeet

i will check again today

7. Kabir

Can u plz provide us the correct afl

it will be easier and helpful to us if u provide the correct afl

8. ajeet

Don,t know how to edit the above formulae
somebody help
I want to paste it again

9. joeoil

The AFL code works fine for me. Amibroker v. 5.40

Be sure the 6 statement’s after the equal (=) sign in line 145-158 is in one line.

10. gajananprofits@yahoo.co.in

not working

Leave Comment

Please login here to leave a comment.

Back