Earth AFL for Amibroker

Earth AFL for Amibroker

Earth AFL contains 3 Panels i.e. Charts, Trend and Support-Resistence Channel. Charts Panel gives Buy Sell Arrow Signals with Trend Channel. Middle Panel gives Buy Sell Confirmation and by following wave mirrors early entry or exit can be taken. Bottom Panel provides visual Support & Resistence with colored trend bars.

Use Earth AFL for Intraday Trading in MCX Commodity, NCDEX Agriculture Commodity, NSE Equity Cash Stocks, Nifty Future, Bank Nifty Future, Nifty Options, Most Active Stock Futures, Currency Futures & Options, Etc.

Download Earth AFL for Amibroker

Password : techarticles.in

AmiTrader

COPY & PASTE CODE :

PANEL-1

_SECTION_BEGIN(“ValueTechnicals”);
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;

SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat(“{{NAME}} – {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}”, O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, “Close”, ParamColor(“Color”, colorDefault ), styleNoTitle | ParamStyle(“Style”) | GetPriceStyle() );
_SECTION_END();

PANEL-2

VAR2=(High+Low+(Close)*(2))/(4);
B = ((EMA((VAR2-LLV(VAR2,15))/(HHV(Low,15)-LLV(VAR2,15)),2))*(38));
Plot(b, “”, 4, 1);
bot1 = ((((-1))*(EMA((VAR2-LLV(VAR2,15))/(HHV(Low,15)-LLV(VAR2,15)),2))+0.01)*(38));
Plot(bot1, “”, 4, 1);
VAR22=((Close-LLV(Low,10))/(HHV(High,10)-LLV(Low,10)))*(100);
VAR33=EMA(VAR22,10);
VAR44=EMA(VAR33,10);
VAR55=(3)*(VAR33)-(2)*(VAR44);
VAR66=EMA(VAR55,5);
BridgeT = (EMA(VAR66,1));
Plot(bridget, “”, 7, 1+4);
Plot(-bridget, “”, 7, 1+4);
trend = (5)*(EMA(((Close-LLV(Low,27))/(HHV(High,27)-LLV(Low,27)))*(100),5))-
(3)*(EMA(EMA(((Close-LLV(Low,27))/(HHV(High,27)-LLV(Low,27)))*(100),5),3))-
EMA(EMA(EMA(((Close-LLV(Low,27))/(HHV(High,27)-LLV(Low,27)))*(100),5),3),2);
Buy1 = Cross(trend,5);
PlotShapes( IIf( Buy1, shapeSmallSquare, shapeNone ), 8, layer = 0, yposition = 0, offset = 3  );
PlotShapes( IIf( Buy1, shapeSmallSquare, shapeNone ), 8, layer = 0, yposition = 0, offset = -4  );

VARA1=((Close>=Ref(Close,-1)) AND (Ref(Close,-1)>=Ref(Close,-2)) AND (Ref(Close,-1)<=Ref(Close,-3))
AND (Ref(Close,-2)<=Ref(Close,-3)) AND ((Ref(Close,-4)>Ref(Close,-2)) OR (Ref(Close,-4)<=Ref(Close,-2))
AND (Ref(Close,-5)>=Ref(Close,-3))) OR (Close>=Ref(Close,-1)) AND (Ref(Close,-1)<=Ref(Close,-2))
AND (Close>=Ref(Close,-2)) AND ((Ref(Close,-3)>Ref(Close,-1)) OR (Ref(Close,-3)<=Ref(Close,-1))
AND (Ref(Close,-4)>=Ref(Close,-2))));
VARA2=LLV(Low,5);
VARA3=HHV(High,5);
VARA4=EMA(((Close-VARA2)/(VARA3-VARA2))*(100),4);
VARA5=EMA((0.66699999)*(Ref(VARA4,-1))+(0.333)*(VARA4),2);
VARA6=(VARA5<24) AND (Open<MA(Close,20));

Buy2 =IIf(VARA1 AND (VARA6),30,0);
Plot(Buy2, “BUY”, 8,2+4);
Plot(-Buy2, “”, 8,2+4);

_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 );

Buy = Buy1 OR Buy2;
Filter = Buy AND C>pfrom AND C<pto AND V>1000*Minv;
Color = IIf(Close>Open, colorGreen, colorRed);
bcolor = IIf(Buy1 OR Buy2, colorGreen, 1);

AddColumn(Buy, “Buy” , 1.1, bcolor);
AddColumn(O, “Open”, dd, textColor = Color);
AddColumn(C, “Close”, dd, textColor = Color);
AddColumn(V, “Volume”, 1, textColor = Color);
AddTextColumn(FullName(),”Name”);
_SECTION_END();

PANEL-3

//Earth-3

n = Param(“Periods”, 14, 5, 25, 1 );

var6=(2*Close+High+Low)/4;
var7=LLV(L,n);
var8=HHV(H,n);
var9=EMA((var6-var7)/(var8-var7)*100,5);
varA=EMA(0.333*Ref(var9,-1)+0.667*var9,3);
UP=Var9;
DOWN=Vara;
Oo=IIf(up<down,up,down);
Hh=Oo;
Ll=IIf(up<down,down,up);
Cc=Ll;
barcolor2=
IIf( (Ref(up,-1)>Ref(down,-1) AND Ref(up,-1)>up AND up>down )
OR (Ref(up,-1)<Ref(down,-1) AND Ref(up,-1)<up AND up<down )
, colorBlue,
IIf(up>down,5,4));
PlotOHLC( Oo,hh,ll,Cc, “”, barcolor2, styleCandle );

n=3;
var3=(C-LLV(L,14))/(HHV(H,14)-LLV(L,14))*100;
var4=WMA(var3,9);
var5=WMA(var4,3);
j=3*var4-2*var5;
a2=EMA(var4,n);
a3=EMA(a2,n);
a4=EMA(a3,n);
a5=EMA(a4,n);
aa=EMA(a5,n);
Midbot=LLV(j,aa);
Plot(midbot,”Support”,colorBlue,1);

res=HHV(j,45);
Plot(res,”Resistance”,colorRed,1);
b1=(H+L+C)/3;
b2=HHV(b1,15);
b3=LLV(b1,15);
b4=b2-b3;
b5=MA((b1-b3)/b4,3)*100;
Plot(b5,”Position”,7,4);

//Code Ends Here.

NOTE : Most formulas, oscillators, indicators and systems have been downloaded from internet being freely available and edited for convenience or submitted by anonymous users. Therefore www.TechArticles.in does not take any responsibility for it’s quality. If you use any of this information, use it at your own risk. You are responsible for your own trading decisions. Be sure to verify that any information you see on these pages is correct, and is applicable to your particular trade. In no case will TechArticles.in be responsible for your trading gains or losses.