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

Bill Wiliams (Alligator) for Amibroker (AFL) for Amibroker (AFL)

Rating:
4 / 5 (Votes 4)
Tags:
trading system, amibroker

This is the same by " TimOn76", but the Russian text translated to English, to save time translating.

→ http://wisestocktrader.com/indicators/2846-bill-wiliams-alligator

Similar Indicators / Formulas

All in One
Submitted by Nahid about 14 years ago
Kase Peak Osc. V2 batu
Submitted by batu1453 over 10 years ago
Kase CD V2batu
Submitted by batu1453 over 10 years ago
Ichimoku
Submitted by prashantrdx over 10 years ago
Arvind' System
Submitted by akdabc over 14 years ago
Miftha remix for dse
Submitted by coolpace over 14 years ago

Indicator / Formula

Copy & Paste Friendly
/* Bill Wiliams (Alligator).afl
Submitted by TimOn76, Russian comments translated to English.

Strategy buggy, but a good map (Chart) of Bill (Williams Alligator) ....

My trading strategy is "TREND"

Editor: I wanted to keep the Russian text side by side, but my ASCII editor did not work. Sorry.
*/

Title="";
GraphXSpace =10;

_SECTION_BEGIN("Price");

_N(Title = StrFormat("{{INTERVAL}} {{DATE}}  (%.2f%%)  O = %g, H = %g, L = %g, C = %g  V = " +WriteVal( V, 1.0 ) +" {{VALUES}}",SelectedValue( ROC( C, 1 )), O, H, L, C  ));

_SECTION_END();

/* ------------------------------------------- Data optimization and constant --------------------*/
//The new data


/* -------------------------------------------- Indicators by Bill Williams ----------------------*/
A=(H+L)/2;
var1=Wilders(A,34);
var2=Wilders(A,5);
var3=var2-var1;
var4=var3-Wilders(var3,5);
Var5=(H-L)/V;
AO=Var3;
AC=Var4;
AlligatorBlue=Ref(Wilders(A,13),-8);
AlligatorRed=Ref(Wilders(A,8),-5);
AlligatorGreen=Ref(Wilders(A,5),-3);

/* ------------------------------------------ Graphs ---------------------------------------------*/

/* Coloring bars */
barcolor=IIf(AO>Ref(AO,-1) AND AC>Ref(AC,-1),colorGreen,IIf(AO<Ref(AO,-1) AND AC<Ref(AC,-1),colorRed,IIf(V>0 AND Var5<Ref(Var5,-1) AND V>Ref(V,-1),colorBlue,colorBlack)));

Plot(C,"Close",barcolor,64+styleNoTitle );
Plot(AlligatorBlue,"Jaw",colorBlue,1+4+styleNoTitle );
Plot(AlligatorRed,"Language (Teeth)",colorRed,1+4+styleNoTitle );
Plot(AlligatorGreen,"Lips",colorLime ,1+4+styleNoTitle );

/*  -------------------------------------------- fractals ----------------------------------------*/
// Fractal "UP"

FrUp1=
(Ref(H,-3)>Ref(H, -2) AND Ref(H,-3)>Ref(H,-1) AND Ref(H,-3)>Ref(H, -4) AND Ref(H,-3)>Ref(H,-5));
FrUp2=
(Ref(H,-4)>Ref(H,-5) AND Ref(H,-4)>Ref(H,-6) AND Ref(H,-4)==Ref(H,-3) AND Ref(H,-4)>Ref(H,-2) AND Ref(H,-4)>Ref(H,-1)) OR
(Ref(H,-4)>Ref(H,-5) AND Ref(H,-4)>Ref(H,-6) AND Ref(H,-4)>Ref(H,-3) AND Ref(H,-4)==Ref(H,-2) AND Ref(H,-3)>Ref(H,-1));
FrUp3=
(Ref(H,-5)>Ref(H,-6) AND Ref(H,-5)>Ref(H,-7) AND Ref(H,-5)==Ref(H,-4) AND Ref(H,-5)==Ref(H,-3) AND Ref(H,-5)>Ref(H,-2) AND Ref(H,-5)>Ref(H,-1)) OR
(Ref(H,-5)>Ref(H,-6) AND Ref(H,-5)>Ref(H,-7) AND Ref(H,-5)==Ref(H,-4) AND Ref(H,-5)>Ref(H,-3) AND Ref(H,-5)==Ref(H,-2) AND Ref(H,-5)>Ref(H,-1)) OR
(Ref(H,-5)>Ref(H,-6) AND Ref(H,-5)>Ref(H,-7) AND Ref(H,-5)>Ref(H,-4) AND Ref(H,-5)==Ref(H,-3) AND Ref(H,-5)==Ref(H,-2) AND Ref(H,-5)>Ref(H,-1));
ttt=IIf(FrUp1,3,IIf(FrUp2,4,5));
FrUp_Val=ValueWhen(FrUp1 OR FrUp2 OR FrUp3,Ref(H,-ttt),1);

Plot(FrUp_Val,"FrUp",colorDarkGreen,512+8);

// Fractal "DOWN"
FrDw1=
(Ref(L,-3)<Ref(L, -2) AND Ref(L,-3)<Ref(L, -1) AND Ref(L,-3)<Ref(L,-4) AND Ref(L,-3)<Ref(L,-5));
FrDw2=
(Ref(L,-4)<Ref(L,-5) AND Ref(L,-4)<Ref(L,-6) AND Ref(L,-4)==Ref(L,-3) AND Ref(L,-4)<Ref(L,-2) AND Ref(L,-4)<Ref(L,-1)) OR
(Ref(L,-4)<Ref(L,-5) AND Ref(L,-4)<Ref(L,-6) AND Ref(L,-4)<Ref(L,-3) AND Ref(L,-4)==Ref(L,-2) AND Ref(L,-4)<Ref(L,-1));
FrDw3=
(Ref(L,-5)<Ref(L,-6) AND Ref(L,-5)<Ref(L,-7) AND Ref(L,-5)==Ref(L,-4) AND Ref(L,-5)==Ref(L,-3) AND Ref(L,-5)<Ref(L,-2) AND Ref(L,-5)<Ref(L,-1)) OR
(Ref(L,-5)<Ref(L,-6) AND Ref(L,-5)<Ref(L,-7) AND Ref(L,-5)==Ref(L,-4) AND Ref(L,-5)<Ref(L,-3) AND Ref(L,-5)==Ref(L,-2) AND Ref(L,-5)<Ref(L,-1)) OR
(Ref(L,-5)<Ref(L,-6) AND Ref(L,-5)<Ref(L,-7) AND Ref(L,-5)<Ref(L,-4) AND Ref(L,-5)==Ref(L,-3) AND Ref(L,-5)==Ref(L,-2) AND Ref(L,-5)<Ref(L,-1));
ggg=IIf(FrDw1,3,IIf(FrDw2,4,5));
FrDw_Val=ValueWhen(FrDw1 OR FrDw2 OR FrDw3,Ref(L,-ggg),1);

Plot(FrDw_Val,"FrDw",colorDarkRed,512+8);

/* --------------------------------------- Trading Strategy --------------------------------------*/

// Define the play area
green_zone=(C>AlligatorBlue AND C>AlligatorRed AND C>AlligatorGreen);
red_zone=(C<AlligatorBlue AND C<AlligatorRed AND C<AlligatorGreen);
gray_zone=(green_zone==False) AND (red_zone==False);
TWR_GREEN=AO>Ref(AO,-1) AND AC>Ref(AC,-1) AND Ref(AC,-1)>Ref(AC,-2);
TWR_RED=AO<Ref(AO,-1) AND AC<Ref(AC,-1) AND Ref(AC,-1)<Ref(AC,-2);
TWR_GRAY_BUY=AO>0 AND AO<Ref(AO,-1) AND AC>Ref(AC,-1);
TWR_GRAY_SELL=AO<0 AND AO>Ref(AO,-1) AND AC<Ref(AC,-1);

// Determine the area of the entrance to the LONG

GOOD_LONG_ZONE=((green_zone OR gray_zone) AND (TWR_GREEN OR TWR_GRAY_BUY));
GOOD_SHORT_ZONE=((red_zone OR gray_zone) AND (TWR_RED OR TWR_GRAY_SELL));

// Signals for entry in LONG
Sg_Buy_Cross_FrUp=Ref(H,-1)<=FrUp_Val AND H>FrUp_Val AND FrUp_Val>Ref(AlligatorRed,-ttt);
Sg_Buy=Sg_Buy_Cross_FrUp AND GOOD_LONG_ZONE;

Buy=(C>FrUp_Val AND C>AlligatorRed) AND AC>0;
Sell=C<FrDw_Val OR C<AlligatorRed;
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Short=(C<FrDw_Val AND C<AlligatorRed) AND AC<0;
Cover=C>FrUp_Val OR C>AlligatorRed;
Short=ExRem(Short,Cover);
Cover=ExRem(Cover,Short);

PlotShapes( shapeUpArrow * Buy + shapeHollowDownArrow *Short, IIf( Buy, colorGreen, colorRed ),0,IIf(Buy,Low,High));
PlotShapes( shapeDownArrow*Sell + shapeHollowUpArrow*Cover, IIf( Cover, colorGreen, colorRed ),0,IIf(Cover,Low-C/2000,High+C/2000));

/*  End of Exploration Code. */
/* My trading strategy is "TREND" */

1 comments

1. bishwajit

plz show the screen shot

Leave Comment

Please login here to leave a comment.

Back