Williams alligator crossover scan for tos

Darkshak

New member
VIP
Can someone please make a williams alligator crossover scan for tos? I would say one for when the green crosses above the green and another for when it crosses below the red. Thanks in advance!
 

BenTen

Administrative
Staff
VIP
I just added the indicator to my chart and I see 3 different colors: green, red, and blue. Regardless, you can still setup the scanner using a condition like this:

Example: Jaw (blue) crosses above Teeth (red).

mGqEyl4.png
 

Gabrielx77

Active member
Hello, I was wondering if someone could help me right the script for William's Alligator Crossover? Was just looking for a simple crossover that's shown with up/down arrows rather than having to follow the lines.
 

Gabrielx77

Active member
@Gabrielx77 There are 3 lines in the indicator. Can you specify the crossover?
Of course. I wanted a crossover of 3 simple moving averages, each one being the 5 sma with 3 displacement, the 8 sma with 5 displacement, and the 13 sma with 8 displacement. The up arrow would basically come when the 5 sma cross over both the 8 and 13 sma. The down arrow would come when the 5 sma cross under the 8 and 13 sma.

PS If the arrows could appear only when the 5 sma crosses over/under the 13 sma first, before the 8 sma crosses over/under the 13 sma, that would be awesome.
 
Last edited:

scott69

Member
Many years ago I read the Bill Williams book, "Trading Chaos" (1995) which discussed the Alligator Indicator. I keep track of all books that I read, and also rate them. I gave this book an "excellent." So I think it is a good read, if only to glean one or two ideas from it. It should be noted that Bill Williams should not be confused with Larry Williams, who is considerably more famous. I proceeded to code this indicator in MS Excel and in Metastock's language. After considerable testing, I found that it was "average" in its effectiveness, meaning there are many other indicators that are more promising. Granted, I only traded (and still trade) NASDAQ 100 products and its derivatives, so there is that. :) I guess the fact remains that anyone can use any indicator with varying amounts of success as long as they tweak it or employ it within the framework of their own abilities and expectations. I look forward to seeing what results traders here get from using it in scanning and trading.
 
Last edited:

BenTen

Administrative
Staff
VIP
@Gabrielx77 Try this:

Code:
#
# TD Ameritrade IP Company, Inc. (c) 2012-2020
#

input price = hl2;
input jawLength = 13;
input teethLength = 8;
input lipsLength = 5;
input jawDisplace = -8;
input teethDisplace = -5;
input lipsDisplace = -3;
input averageType = AverageType.WILDERS;

plot Jaw = MovingAverage(averageType, price[-jawDisplace], jawLength);
plot Teeth = MovingAverage(averageType, price[-teethDisplace], teethLength);
plot Lips = MovingAverage(averageType, price[-lipsDisplace], lipsLength);

Jaw.SetDefaultColor(Color.BLUE);
Teeth.SetDefaultColor(Color.RED);
Lips.SetDefaultColor(Color.GREEN);

plot UpSignal = if Lips crosses above Jaw then low else Double.NaN;
plot DownSignal = if Lips crosses below Jaw then high else Double.NaN;

UpSignal.SetDefaultColor(Color.MAGENTA);
UpSignal.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
DownSignal.SetDefaultColor(Color.CYAN);
DownSignal.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
 

Gabrielx77

Active member
Very nice, Ben. Looks super clean and professional, I appreciate it. Also, I'd like to share some results that I back tested the other day, I hope it helps anyone who's looking for a new strategy when it comes to trading.

The reason why I was looking for a script for this Alligator Strategy was because I read into someone using it with great success; it seemed very easy to follow and very concise, even when I looked back at the previous entry and exit points from months ago.

Basically, with this strategy, you would wait until the 5 ma crosses under or over both the 8 ma and the 13 ma; but as you can see in my picture, you would've missed most of the move. After reading more into this strategy, I found someone who has found a solution for not having to miss the move.

In the picture you will see:

1. 3 Smooth Moving Averages: 5 with -3 displacement (green) 8 with -5 displacement (red) and the 13 with a -8 displacement (blue)
2. Two Ovals: 1st one being my entry point and the 2nd being my exit point
3, Magenta Down Arrow: Representation for when the 5 ma crosses under both the 8 and 13 ma

As I said before, usually your entry point would be when the 3 moving averages cross, but you would miss most of the move; the exit would be when the candles close back into the moving averages (aka the gator).

To avoid the miss of the move, you would want to enter the trade when the candle crosses and closes above or below the whole gator instead. At the same time, you would need to make sure your MACD is following the trend of the candle. As you can see, the MACD is converging towards the down side, which means it's a strong signal and you can buy.

Traded options the other day on the SPY, and although the trade took up some time, the result was about a $125-$150 gain per contract.

V5J2cvb.jpg


I got this specific strategy from a user on reddit that goes by: rogerdog1 if anyone was wondering.
 
Last edited:

rad14733

Well-known member
VIP
@Gabrielx77 The Alligator indicator is popular with novices for several reasons... First, it is easy to understand... Second, it is fairly safe and reliable... However, the indicator does have some deficits as well... The main negative is that entry signals are somewhat to considerably later than other indicators, as are exits... While a late entry helps reduce false signals it also cuts into potential profits...

If you choose to use the Alligator indicator for trade entries you would be better off using another method to determine your trade exits... This is a common problem with most all moving average crossover indicators... One exit option would be to use a profit target so you can, hopefully, exit while the price is rising rather than trying to catch a falling knife... Another exit option would be something along the lines of a trailing stop to limit potential profit losses...

I have run backtests on the Alligator indicator and other moving average indicators and if you rely on the crossovers for entry and exit you will not end up with a profitable overall trading strategy... Just my two cents...
 

Gabrielx77

Active member
@rad14733 Yes I totally agree with you! That's why I focus on the candles closing above or below the averages to take the trade. If you look at my picture, my entry was when the candle closed below all 3 moving averages (the first oval), which was before the cross over, and then I scaled out of positions until I finally closed all remaining positions when my candles entered back into the alligator (the second oval). I never go solely based on an crossover, because yes, it's definitely too late for entries and exits. Instead, I use it as a zone correlating with MACD.
 
Last edited:

rad14733

Well-known member
VIP
@Gabrielx77

I saw that but I would have closed the trade as soon as the first red bar closed below the top green moving average line, which coincides with the MACD downward crossover... That's why I mentioned the trailing stop idea due to the fact that the trade had definitely weakened in trend... I prefer to base my exits off the high point of the trade but, then again, I scalp and day trade so I'm not going to wait and see if there is a rebound... And if there was a strong rebound I'd open another trade if there appeared to be momentum and the price not near recent highs... I've ridden trades from winner to loser waiting for rebounds that never transpired so now I tend to take the sure things... Just goes to show that traders have different trade criteria and expectations... You'll never go broke taking profits early... ;)(y)
 

Gabrielx77

Active member
@rad14733 100%; I actually did take profits on the close of that candle. I had bought 15 contracts and sold 8. I would've sold the rest if the green candle broke the previous red candles high, nearing my entry point, but it didn't so I held. I also scalp, so I understand what you're saying; when I closed my final position at the 2nd oval in my pic, I was only holding 3 contracts left.
 

Eninerman9

New member
Hello @Gabrielx77

How can I set my chart to look like the one in the above picture when I try to set my charts for 1 or 2 days the candlesticks get really large where I can’t use my indicators how can I chart stocks for a short period of time and the charts looks similar to the chart pictured above

04Ve4JD.jpg
 

rad14733

Well-known member
VIP
@Eninerman9 Have you tried going to the Price Axis Settings icon (the dual squiggle lines) in the top right corner of your chart and toggled Fit Studies to see if that helps...??? Or am I not understanding what it is you are having problems with...
 

Eninerman9

New member
Very nice, Ben. Looks super clean and professional, I appreciate it. Also, I'd like to share some results that I back tested the other day, I hope it helps anyone who's looking for a new strategy when it comes to trading.

The reason why I was looking for a script for this Alligator Strategy was because I read into someone using it with great success; it seemed very easy to follow and very concise, even when I looked back at the previous entry and exit points from months ago.

Basically, with this strategy, you would wait until the 5 ma crosses under or over both the 8 ma and the 13 ma; but as you can see in my picture, you would've missed most of the move. After reading more into this strategy, I found someone who has found a solution for not having to miss the move.

In the picture you will see:

1. 3 Smooth Moving Averages: 5 with -3 displacement (green) 8 with -5 displacement (red) and the 13 with a -8 displacement (blue)
2. Two Ovals: 1st one being my entry point and the 2nd being my exit point
3, Magenta Down Arrow: Representation for when the 5 ma crosses under both the 8 and 13 ma

As I said before, usually your entry point would be when the 3 moving averages cross, but you would miss most of the move; the exit would be when the candles close back into the moving averages (aka the gator).

To avoid the miss of the move, you would want to enter the trade when the candle crosses and closes above or below the whole gator instead. At the same time, you would need to make sure your MACD is following the trend of the candle. As you can see, the MACD is converging towards the down side, which means it's a strong signal and you can buy.

Traded options the other day on the SPY, and although the trade took up some time, the result was about a $125-$150 gain per contract.

V5J2cvb.jpg


I got this specific strategy from a user on reddit that goes by: rogerdog1 if anyone was wondering.
What chart settings are being used to set a chart for trading like chart pictured above the SPY trade?
 

Similar threads

Top