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
over 12 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 over 13 years ago
Bear Fear
Submitted by gera about 13 years ago
RAJASWAMY INVESTING PURPOSE
Submitted by rajaswamy over 13 years ago
Alligator without Pivots
Submitted by deepak49 about 14 years ago
Reaction Trend System
Submitted by ajayjain90 almost 14 years ago
ema crossovers
Submitted by rushee.g1100 over 13 years ago

Indicator / Formula

Copy & Paste Friendly
// 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