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

William's Alligator System II for Amibroker (AFL)
kaiji
over 14 years ago
Amibroker (AFL)

Rating:
3 / 5 (Votes 5)
Tags:
trading system, amibroker, exploration, alligator

To get a real picture of this go to the web site www.profitunity.com and download the demo software Investors Dream and see how this code compares.

You really need to read the book to get a picture of what is going on. This is a good read. You can get the Williams books on his web site as will. You only need the latest one.

Similar Indicators / Formulas

Reaction Trend System
Submitted by ajayjain90 almost 14 years ago
OPTIMIZED ICHIMOKU
Submitted by ritesh.bafna88 over 11 years ago
KPL with RSI
Submitted by pdkg_gal almost 14 years ago
Intraday Trend Break System
Submitted by nishantndk almost 14 years ago
ema crossovers
Submitted by rushee.g1100 almost 14 years ago
mutlitime frame with trendline
Submitted by nsetraderonline over 13 years ago

Indicator / Formula

Copy & Paste Friendly
/*
   Bill William's Alligator System II

   Reference Website:
   ==================
  
	http://www.alpari-idc.com/en/market-analysis-guide/chaos-theory/alligator-and-gator.html
   Modified from original formula by Steve Wiser - slwiserr@erols.com
   Modified by TohMz  on June 9th, 2008
*/
SetChartOptions( 0, chartShowArrows|chartShowDates );

_SECTION_BEGIN("Price Chart");
_N(Title = StrFormat("{{NAME}}- {{INTERVAL}} {{DATE}} O= %g, H= %g, L= %g, C= %g (%.1f%%) V= " +WriteVal( V, 1.0 ) +"\n{{VALUES}}", O, H, L, C, SelectedValue(ROC( C, 1 )) ));
PriceStyle = GetPriceStyle();
PriceStyleOpt = ParamStyle("Price Style")|PriceStyle;

if (PriceStyle==styleCandle)
   Plot( C, "", colorBlack,  PriceStyleOpt); 
else
   Plot( C, "", IIf( Close >= Ref(C, -1), colorBlue, colorRed ), PriceStyleOpt);
_SECTION_END();

_SECTION_BEGIN("BW Alligator");
/*** The trend indicators ***/

P= ParamList("Price", "Close|(H+L)/2|(H+C+L)/3",1);

if (P=="Close")
   A = C;
   
else
if (P=="(H+C+L)/3")
   A = (H+C+L)/3;
else
  A = (H+L)/2;

AlligatorJaw   = Ref(Wilders(A,13),-8);
AlligatorTeeth = Ref(Wilders(A,8), -5);
AlligatorLips  = Ref(Wilders(A,5), -3);

Plot(AlligatorJaw,  "Jaw", ParamColor("Jaw's Color",colorBlue),
ParamStyle("Jaw's Style", styleThick));
Plot(AlligatorTeeth,"Teeth", ParamColor("Teeth's Color",colorRed),
ParamStyle("Teeth's Style", styleThick));
Plot(AlligatorLips, "Lips", ParamColor("Lips's Color",colorGreen),
ParamStyle("Lips's Style", styleThick));

_SECTION_END();


_SECTION_BEGIN("BW Fractal");

UpFractal= ValueWhen(
  (Ref(H,-2) > Ref(H, -4)) AND
  (Ref(H,-2) > Ref(H, -3)) AND
  (Ref(H,-2) > Ref(H, -1)) AND
  (Ref(H,-2) > H), Ref(H,-2));

DownFractal= ValueWhen(
  (Ref(L,-2) <= Ref(L, -4)) AND
  (Ref(L,-2) <=  Ref(L, -3)) AND
  (Ref(L,-2) <=  Ref(L, -1)) AND
  (Ref(L,-2) <=  L), Ref(L,-2));



//== Added Crash  crashandburn59 [at] hotmail.com solution
Plot(Ref(UpFractal,2), "Up Fractal", ParamColor("Up Fractal Color",colorRed),ParamStyle("Up Fractal Style", styleDashed));
Plot(Ref(DownFractal,2), "Down Fractal",ParamColor("Down Fractal Color",colorBlue), ParamStyle("Down Fractal Style", styleDashed));

//Plot(Max(HHV(H,3),Ref(UpFractal,2)), "Up Fractal", ParamColor("Up Fractal Color",colorRed), ParamStyle("Up Fractal Style", styleDashed));
//Plot(Max(HHV(H,3),Ref(UpFractal,2)), "Down Fractal",ParamColor("Down Fractal Color",colorBlue), ParamStyle("Down Fractal Style", styleDashed));

_SECTION_END();



_SECTION_BEGIN("Exploration");

Inc = 0.1;  

//== Set the Price Range for stock to scan
PriceFrom = Param("Price From:", 5,   0.1, 200, Inc); 
PriceTo   = Param("Price To:",   100, 0.1, 200, Inc); 
MaxBreakOut = Param("Max Breakout (%)", 5, 1, 30);  
MaxBreakOut = MaxBreakOut/100;

Buy  = C>UpFractal AND C<=(1+MaxBreakOut)*UpFractal AND
AlligatorTeeth>AlligatorJaw;
Sell = C<DownFractal AND C>=(1-MaxBreakOut)*DownFractal AND
AlligatorTeeth<AlligatorJaw;

Filter = (Buy OR Sell) AND (C>=PriceFrom AND C<=PriceTo) AND V>0;
 
AddTextColumn(FullName(), "Security", 1.0, colorDefault, colorDefault, 200); 
AddTextColumn( WriteIf(Buy,"Buy", WriteIf(Sell, "Sell", "")), "Trade", 1.0);
AddColumn( UpFractal, "Up Fratal");
AddColumn( DownFractal, "Down Fratal");
//AddColumn( MA(V,3)/EMA(V,17), "MAV(3/17)");
AddColumn( C, "Today's Close");


_SECTION_END(); 

1 comments

1. tyfvip

ok ok ok

Leave Comment

Please login here to leave a comment.

Back