Alligator
Author: ayc868
Creation Date: 10/11/2009 9:09 PM
profile picture

ayc868

#1

do you have Bill Williams's alligator and AO indicators etc..

profile picture

Eugene

#2
Sure:
QUOTE:
Alligator's Jaw (the blue line) - 13-period moving average at the mid price (High+Low)/2, which is offset 8 bars into the future;

Alligator's Teeth (the red line) - 8-period moving average at the mid price (High+Low)/2, which is offset 5 bars into the future;

Alligator's Lips (the green line) - 5-period moving average at the mid price (High+Low)/2, which is offset 2 bars into the future.

Although some sources quote the usage of "smoothed moving average", you can get a pretty close approximation of the Alligator with tools already available in Community.Indicators:

Shifted Moving Average

CODE:
Please log in to see this code.


Tip: You could also skip the coding step and make this in a rule-based strategy or chart by:

1) Dragging and dropping the "AveragePrice" indicator on the chart
2) Double-clicking "ShiftedMA" from Community.Indicators
3) Selecting "AveragePrice()" in the dropdown list of data series
profile picture

ayc868

#3

what about AO and AC indicators? this is the core part
profile picture

ayc868

#4
compiling error on ShiftedMA ?
profile picture

Eugene

#5
Have I overlooked your unambiguous and clear descriptions and formulas of "AO" and "AC"?

Re: compiling error on ShiftedMA - carefully re-read my reply, paying attention to the mention of "Community.Indicators".
profile picture

ayc868

#6

1. Community.Indicators - Not sure what you are referring to
I code the code and compile, and it show the errors.

2. AO - Awesome Oscillator
AC - Acceleration / Deceleration

They are together with Alligator
profile picture

Eugene

#7
1. Click on "Extensions", read how to use them, find Community.Indicators there.
profile picture

Eugene

#8
If Community.Indicators is already installed, you probably need to update it to make use of Shifted Moving Average - a later addition.

QUOTE:
2. AO - Awesome Oscillator

CODE:
Please log in to see this code.

Nothing new under the sun, still pretty hard to reinvent the wheel. This "awesome" oscillator is nothing but rebranded MACD, with different periods and average price vs. close price.

Add this to your Execute() method for AO / AC:
CODE:
Please log in to see this code.
profile picture

ayc868

#9


Community.Indicators do not have ShiftedMA,
Do I need install any library?
profile picture

Eugene

#10
Carefully re-read my message from 10/12/2009 6:45 AM.
profile picture

ayc868

#11

I have read your 10/12/2009 1:36 AM
regardless, ShiftedMA.Series is not a legal statement in WL, at least in my environment.

QUOTE:
Tip: You could also skip the coding step and make this in a rule-based strategy or chart by:

1) Dragging and dropping the "AveragePrice" indicator on the chart
2) Double-clicking "ShiftedMA" from Community.Indicators
3) Selecting "AveragePrice()" in the dropdown list of data series


I only do coding. no drag & drop
profile picture

Eugene

#12
You mention my message from "10/12/2009 1:36 AM" while I said "10/12/2009 6:45 AM". The answer is there.

Which web browser are you using? Could the fonts on your monitor be too small and therefore uncomfortable to read the text on the forum? I suggest doing a google search for "increase browser font size".
profile picture

ayc868

#13


QUOTE:
If Community.Indicators is already installed, you probably need to update it to make use of Shifted Moving Average - a later addition.


How do I swap my Community.Indicators to have Shifted Moving Average as you have?
The software show my WL is current when I clicked the software upgrade(under help)

profile picture

Eugene

#14
Normally, I would ask for the exact error message phrase and exact version the library. But now it's clear...

Your WL may be current but Community.Indicators is an extension. Neither the User Guide nor the site promotes version checking the way you did it. If you have already installed a 3rd party Community.Indicators extension through the Extension Manager tool (under Tools), why would you be checking its version in a different place (under Help)?..

Review the Extension Manager chapter in the User Guide and the Extensions section of the site, both contain illustrated tutorials on working with extensions and the Extension Manager.

Community.Indicators is one of the so-called "Other extensions" - you'll need this information...
profile picture

ayc868

#15

I get it to work now. simply I have older version of Community.Indicators.
for AO/AC, how to show it as histogram(vertical)bar chart? Green above 0 line, and
red below 0 line. After this, I think I can tune up myself. Thanks.
profile picture

Eugene

#16
QUOTE:
for AO/AC, how to show it as histogram(vertical)bar chart? Green above 0 line,

Just replace LineStyle.Solid in my code with LineStyle.Histogram and then see the QuickRef example for SetSeriesBarColor.
profile picture

ayc868

#17
I mean the histogram bar color but not the price bar.
If too difficult, i can live with it.
profile picture

Eugene

#18
Yes, I understood that when pointing you to the correct example.
profile picture

ayc868

#19
QUOTE:

MEDIAN PRICE = (HIGH + LOW)/2


your definition is different from bill's book.

MEDIAN PRICE = (HIGH - LOW)/2
profile picture

Eugene

#20
That's a typo. Check out the internet, it's full of descriptions of his indicators, and you'll notice that everyone out there uses AveragePrice i.e. (High+Low)/2 as "median price".

Even better, change AveragePrice.Series(Bars) in my code with your erroneous "median price":
CODE:
Please log in to see this code.

Then run the strategy, and see how funny does the chart look :)
profile picture

ayc868

#21
CODE:
Please log in to see this code.


above copy from http://wl4.wealth-lab.com/cgi-bin/WealthLab.DLL/editsystem?id=27909
the chart result look different? please advice
profile picture

Eugene

#22
AO and AC look absolutely identical in WL4 and WL5.
profile picture

ayc868

#23
AO & AC is confirmed
The chart of Jaw Teech Lips are very different, yours will cross over
profile picture

Eugene

#24
My mistake was the desire to help you w/o first having obtained all the formulas and clear requirements - the prerequisite to programming.

Considering that your postings were not helpful and haven't contained any formulas or descriptions at all, no wonder the results will certainly look different.

This script uses WilderMA and the internet sites where I searched all suggested the usage of SMA.

If you prefer WilderMA, shift the MA like this:
CODE:
Please log in to see this code.
profile picture

ayc868

#25

Can not pass compiler

CODE:
Please log in to see this code.
profile picture

Eugene

#26
Why are you breaking my working code?
profile picture

Migel

#27
Hi! Can I get Bill Williams fractals code for WealthLab Dev 5.6 ?
profile picture

beckerben

#28
Nice job adding this, has anyone created the strategies to go along with these?
profile picture

Eugene

#29
Note: Alligator Jaws, Teeth and Lips have been incorrectly using a simple moving average (SMA) while they actually should use a smoothed MA (SMMA). This bug will be fixed in the upcoming release.
profile picture

Eugene

#30
Important!

Alligator Jaws, Teeth and Lips were incorrectly using a simple moving average (SMA) while they actually should use a smoothed MA (SMMA).

Bug fixed in Community Indicators 2010.10 - if you're using the Alligator, you should update using Extension Manager.

This misconception is still very popular on the various financial internet resources, but the source ("Trading Chaos" book by Bill Williams) makes it clear that SMMA should be used (not SMA).
profile picture

grtrader

#31
For the Alligator Lips, Teeth, and Jaws, how can I create empty spaces to the right of the chart and also have these indicators show up in the empty spaces since they are shifted to the right?
profile picture

Eugene

#32
Empty space can be added with PadBars(). However, it's not possible to make the Alligator show up there as Wealth-Lab does not allow plotting indicators in this area.
profile picture

Cone

#33
I backtested the 'Profitunity system' for Trading System Lab in the November 2013 issue of Active Trader magazine. It's a fairly complex undertaking if you go both short and long with pyramiding using the fractals, angulation, and the "wise men" rules. There are a lot of variables you can play with, but for the 17 stocks in the Active Trader watchlist (AAPL, BA, C, CAT, CSCO, DIS, FITB, HPQ, IBM, INTC, IP, JPM, KO, MSFT, SBUX, T, WMT), the backtest showed the system to be a colossal waste of time (and a money loser if including trading costs).
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).