VALYNOXSTRATEGY RESEARCH TECHNOLOGY
AlphaPrimeAlphaPrime
ACADEMY / Indicators and signals

Granville's eight rules: moving average settings and how to test them

Granville's eight rules are four buy and four sell situations read from one moving average and its direction. Each becomes a testable condition once the distance from the average, the slope of the average and the order bar are written as numbers; the test then decides which average length holds up.

By · Published · updated · Editorial policy

Contents
  1. What are Granville's eight rules?
  2. Are Granville's eight rules accurate?
  3. Which moving average should you use: 20, 60 or 200 days?
  4. How do you turn each rule into objective conditions?
  5. Can Granville's rules be backtested, and what does an ES test show?
  6. How do you test parameter stability?
  7. Frequently asked questions
  8. References

What are Granville's eight rules?

Granville's eight rules are four buy signals and four sell signals that read a single moving average: where price sits relative to the average and which way the average is pointing. Each rule can be written as a testable condition with a distance, a slope and an order bar, then checked on your own bar data before you trade it.

A moving average is the average closing price of the last N bars, recalculated on every new bar, so it draws a smoothed line that follows price with some delay. The rules are named after Joseph Granville, an American market analyst who published them in the 1960s for stocks; traders now apply them to index futures as well. The idea is plain: when the average points up, buy dips toward it; when it points down, sell rallies toward it; and when price runs very far from the average, expect a move back. The moving averages indicator page covers the simple and exponential versions and their formulas, so this article spends its words on the rules and on testing them.

RuleAveragePriceType
B1 BuyFlattens after falling, or turns upCrosses above the averageWith the trend
B2 BuyRisingPulls back toward the average, stays above it, turns upWith the trend
B3 BuyRisingDips below the average briefly, recovers above itWith the trend
B4 BuyFallingFalls far below the average, then rebounds toward itAgainst the trend
S1 SellFlattens after rising, or turns downCrosses below the averageWith the trend
S2 SellFallingRallies toward the average, stays below it, turns downWith the trend
S3 SellFallingPops above the average briefly, falls back below itWith the trend
S4 SellRisingRises far above the average, then falls back toward itAgainst the trend
Granville's eight signals on one stylised price path around a moving average that first turns up and later turns down: buy points B4, B1, B2 and B3 while the average bottoms and rises, sell points S4, S1, S2 and S3 around the top and while it falls Eight signals, one average B = buy · S = sell · dashed = average B4 B1 B2 B3 S4 S1 S2 S3 Six follow the trend, two fade it. So: test the two groups apart.
All eight signals on one price path: four buy points while the average rises, four sell points while it falls.

Six of the eight rules follow the trend: they buy with a rising average and sell with a falling one. Two of them, B4 and S4, do the opposite: they bet that a price far from its average will come back. This matters for testing. A rule that trades with the trend and a rule that trades against it fail in different market states, and putting all eight into one backtest hides which part is doing the work. Test the six trend rules and the two snap-back rules as separate strategies.

Are Granville's eight rules accurate?

The rules describe real trend behaviour in trending stretches and produce a string of false signals in sideways stretches, so their accuracy depends on the market state and on how precisely each rule is written, not on the rules themselves. Ask "accurate under which definition, on which market, after which costs" and the question becomes testable.

The research record on moving average rules is mixed in a specific way. Brock, Lakonishok and LeBaron (1992) tested simple moving average rules on about ninety years of Dow Jones index data and found that returns after buy signals were higher than returns after sell signals, before trading costs. Sullivan, Timmermann and White (1999) then asked how much of that result came from trying many rules on the same data and keeping the best, and found that the strongest rule did not keep its edge in the ten years that followed the original sample. Park and Irwin (2007) surveyed decades of such studies and found that positive results were common but often weakened by costs and by the number of rules tried. The honest summary: there is something real in trend-following with an average, and most of what looks like accuracy in a chart is the trending stretches you remember.

A whipsaw is a signal that reverses before the trade has moved in your favour, so that the strategy pays a loss and a round-trip cost for nothing. In a sideways market, price crosses the average many times in a row and every cross is a whipsaw. No single average can tell a trend from a range in advance, because the average is built only from past prices.

The same 60-bar moving average in two market states: in a trend, two signals both run with the trend and win; in a sideways range, price crosses the average six times in a row and each cross is a small losing whipsaw Ranges breed whipsaws Same 60-bar average, two markets Trend Range 2 clean wins 6 whipsaws No average sees a range coming. So: test in trends and ranges.
The same 60-bar average, two market states: two good signals in a trend, six small losses in a range.

Four limits are worth writing down before you test anything:

  1. Lag. The average turns after price has already turned, so B1 and S1 fire late. A longer average fires later.
  2. Whipsaws. In a range, the rules lose a little many times. Costs make each loss larger.
  3. "Far from the average" is undefined. B4 and S4 have no distance in the original wording, so two traders reading the same chart will mark different signals.
  4. "Pulls back toward" is undefined. B2, B3, S2 and S3 need a distance and a bar count before they can be tested.

Where these rules sit next to other chart tools, and which tools can be written as conditions at all, is covered in the guide to technical analysis tools and indicators you can test.

Which moving average should you use: 20, 60 or 200 days?

The average length sets the trade-off between lag and whipsaws: a 20-day average gives many early signals, a 200-day average gives few late ones, and the right choice is the length whose neighbours behave alike in your own test, not the length that scored best. There is no correct number for all markets, which is why the last section of this article is about testing a range of them.

Taiwanese traders often call the 20-day average the monthly line and the 60-day average the quarterly line, because a month holds roughly 20 trading days and a quarter roughly 60. The 200-day (or 240-day) average stands for about a year. Each length fits a different holding time and a different number of trades.

Average lengthReacts to a turnCrosses per yearTypical useMain weakness
20-daySoonManySwing trades of days to weeksWhipsaws in a range; costs add up
60-dayAfter a few weeksFewerPosition trades of weeks to monthsMisses the first part of a move
200-dayAfter monthsFewLong-term direction filterVery late entries and exits; few trades to judge
Comparison of 20-day, 60-day and 200-day moving averages: the 20-day has short lag but many crosses and suffers whipsaws, the 60-day sits in between and misses the start of moves, the 200-day has long lag, few crosses and very late entries Less lag, more crosses Relative sizes, not exact counts Lag Crosses Weakness 20-day 60-day 200-day Whipsaws Misses start Very late You cannot have early and few. So: test a range of lengths.
Shorter averages react sooner and cross more often; longer averages react later and cross less. You cannot have both.

A common practical setup is two averages with two jobs: the 200-day average decides direction and the 20-day or 60-day average supplies the entry. That is a legitimate design, but it adds a second length to test, so the grid in the last section grows from one dimension to two. If lag is the problem you most want to reduce, the DEMA double exponential moving average and what a crossover test shows explains how a less lagging average changes the signal count; the trade-off does not go away, it only moves.

How do you turn each rule into objective conditions?

Words like "pulls back toward the average" become numbers by stating three things: the distance from the average in ATR or percent, the slope of the average over a set number of bars, and the bar on which the order is placed. Once those three are written, two traders will mark the same signals on the same chart, and a computer can mark them too.

ATR, the average true range, is the average size of a bar's full price range over the last N bars, including any gap from the previous close, so it measures how far the market usually moves in one bar. Stating distance in ATR makes a rule work on a quiet year and a volatile year with one setting, where a fixed number of points would not. A band drawn a fixed number of ATR away from an average is exactly what a Keltner channel strategy trades, so the distance part of Granville's pullback rules is the same idea under another name.

Slope is the direction of the average, and the only formula you need is:

slope = average today − average N bars ago

Here average today is the moving average value on the current bar, average N bars ago is its value N bars back, and N is a bar count you choose, often 5 to 20. A positive slope means the average is rising. "Flattens" in B1 and S1 means the slope is close to zero, which you also state as a number, for example less than 0.1 ATR.

Rule B2 turned into numbers: "rising average" becomes average today above the average 5 bars ago, "pulls back" becomes the low within 0.5 ATR of the average, "bounces" becomes a close above the average with a buy at the next bar's open One phrase, one number Rule B2: words left, test right Avg rising Pulls back Bounces Avg > avg 5 bars ago Low within 0.5 ATR of avg Close above, buy next open Now anyone marks the same signals. So: write all three before testing.
One sentence becomes three measurable lines: slope, distance and order bar. Each phrase maps to exactly one number.

The order bar is the part most chart readers skip. A rule that is evaluated on the close of a bar cannot fill at that same close, because the close is only known when the bar is finished. State that the order goes in at the open of the next bar. For B2 written out in full:

  1. Slope: the 60-day average today is higher than it was 5 bars ago.
  2. Distance: the bar's low came within 0.5 ATR of the average without closing below it.
  3. Trigger: the bar closes above the average.
  4. Order: buy at the open of the next bar.
  5. Exit: written the same way, for example a close below the average, or the S1 condition.

Hypothetical example

ES daily bars. The 60-day average stands at 4,970 points and stood at 4,955 five bars ago, so the slope is +15 points: rising. The 14-day ATR is 60 points, so 0.5 ATR is 30 points. Today's low was 4,985, which is 15 points above the average, inside the 30-point distance, and the close is 5,010, above the average. All three parts are met, so a buy order goes in at tomorrow's open. If the low had been 5,040, the distance part would fail and there would be no signal, however much the chart "looked like" a pullback.

Can Granville's rules be backtested, and what does an ES test show?

Yes, once every rule is a written condition, Granville's rules can be backtested like any other trend rule; the report that comes back will have the shape of a trend-following report, with long flat or falling stretches between a few large wins, and that shape is what you need to learn to read. To show what a realistic report with costs looks like, we use a stand-in run below rather than a Granville rule itself.

The run tested a trend-following rule on ES daily bars from 2019-01-02 to 2025-06-30, long and short, one contract, with $20 commission and $25 slippage charged on every trade. The rule was a Parabolic SAR stop-and-reverse used as the only entry and exit, with no stop, target or filter; it is a stand-in built from a standard indicator, not Granville's rules, chosen because it is always in the market in the trend's direction, which is the same behaviour B1 and S1 produce when traded as a pair. AlphaPrime (Valynox) evaluated each candidate with commission, slippage and next-bar execution, and this one is the single candidate the search kept out of the 1,024 it tried, chosen for its return against its drawdown.

Source: AlphaPrime product engine (CPU), run 2026-10-31. ES daily bars, 2019-01-02 to 2025-06-30, long and short, 1 contract, $20 commission and $25 slippage per trade.

NumberResult
Net profit (closed trades)$111,530
Max drawdown$70,335
Trades51
Win rate64.71%
Profit factor1.771
Average trade$2,186.86
Time in market95.01%
Look at three things: where the out-of-sample stretch begins and whether the curve's slope changes there, how long the deepest drawdown lasted in bars, and how much of the climb comes from a few steep steps rather than many small ones.
Look at three things: where the out-of-sample stretch begins and whether the curve's slope changes there, how long the deepest drawdown lasted in bars, and how much of the climb comes from a few steep steps rather than many small ones. ES · daily · 2019-01-02 to 2025-06-30 · CPU engine backtest

Read the table the way you would read your own. The kept candidate is the best of many, so picking it after the fact flatters it; the next-best candidates on the same data would have looked worse, and a rule chosen this way is expected to do less well on new prices than its own report shows. The 51 trades over six and a half years is a small sample, and an average trade built from 51 results can move a long way if a handful of trades change. Set the max drawdown of $70,335 next to the net profit of $111,530 and ask whether you would have kept trading through a loss of that size without knowing the recovery was coming. Time in market of 95.01% confirms what the rule is: always long or short, so every sideways stretch is paid for in whipsaws. None of this says the indicator earned that money or that a reader should expect it; it says what a report with costs looks like when a trend rule is traded on daily index bars. A Donchian channel breakout with its settings and tests is another one-length trend rule that produces reports of the same shape, and the same reading applies to it.

How do you test parameter stability?

Run the same rule across a grid of average lengths and distance thresholds and keep only settings that sit on a plateau of similar results, because a single spike is a lucky fit to one stretch of history. A plateau is a region of neighbouring settings that all produce roughly the same result; a spike is one setting that scores well while its neighbours score poorly. Pardo (2008) makes this the central test of an optimization: the shape of the result surface, not the height of its best point.

The reason is how markets change. If a 50-day average with a 0.75 ATR pullback works and a 60-day average with a 1.0 ATR pullback also works, the rule is picking up something broad about how this market trends, and a small change in behaviour next year will move you to a neighbour, not off a cliff. If only 20 days and 0.25 ATR work, the setting has matched the exact rhythm of the past, and that rhythm is the first thing to change.

Illustrative grid of moving average length from 20 to 100 against pullback distance from 0.25 to 1.5 ATR: a broad plateau of good results around lengths 50 to 80 and 0.5 to 1.0 ATR is kept, while one isolated best cell at length 20 and 0.25 ATR is a spike to discard Keep the plateau Illustration Rows: MA length · Columns: ATR distance 0.25 0.5 0.75 1.0 1.5 20 30 40 50 60 80 100 Plateau: keep Spike: discard Others: weaker The best cell is the luckiest fit. So: trade the plateau's centre.
A broad region of similar results is worth keeping; the single best cell, surrounded by poor ones, is not.
  1. Choose the grid before you run. For B2, average lengths 20 to 100 in steps of 10 and pullback distances 0.25 to 1.5 ATR in steps of 0.25 is a reasonable start. Write the grid down.
  2. Run every cell with the same costs, sessions and next-bar execution. A grid where some cells were run without slippage is not comparable.
  3. Shade the grid by average trade after costs, not by net profit. Net profit rewards settings that simply trade more.
  4. Look for the largest region of similar shading. Pick the centre of that region, not its best cell.
  5. Repeat on the out-of-sample stretch. If the plateau moves to a different region, the rule is not stable on this market.

In AlphaPrime the average length and the pullback distance are entered as ranges in strategy generation, so the whole grid is covered in one search instead of one guessed setting at a time, and the result surface is there to be read. The full method for telling a plateau from a spike, including what to do when the plateau is narrow, is in parameter stability: plateau or lucky spike.

Your next step: take one rule, B2 or S2, write its three numbers as in the example above, and run the 8-by-6 grid on your own daily bars with costs in. Before you look at the best result, mark the plateau. Then check whether the length you have been using sits inside it.

Frequently asked questions

What are the buy points and sell points in Granville's eight rules?

The four buy points are: price crosses above an average that has flattened or turned up; price pulls back toward a rising average and holds above it; price dips briefly below a rising average and recovers; and price falls far below a falling average and rebounds. The four sell points are the mirror image: a cross below a flattening or falling average, a failed rally toward a falling average, a brief pop above a falling average, and a run far above a rising average. Six of the eight trade with the trend and two trade against it.

Do Granville's rules work on futures as well as stocks?

The rules were written for stocks but describe trend behaviour that any price series can show, so they can be tested on index futures with the same conditions. Futures add two things a stock test does not have: a continuous contract built from rolled months, and a session definition that decides what a daily bar is. Set both before you test, and charge commission and slippage on every trade, because a trend rule on futures trades often in sideways years.

Should I use a simple or an exponential moving average for Granville's rules?

Either works, and the choice matters less than the length and the distance threshold. An exponential average weights recent prices more, so it turns a little sooner and crosses a little more often than a simple average of the same length. Treat the average type as one more setting in the grid: if the plateau is in the same place for both types, the rule is not depending on the choice.

Which of the eight rules is the most reliable?

There is no fixed answer, because each rule's result depends on how its distance and slope are defined and on which market and period it is tested on. In general the pullback rules (B2, B3, S2, S3) produce fewer whipsaws than the crossover rules (B1, S1), because they require a trend to exist first, and the two snap-back rules (B4, S4) behave like a separate mean-reversion strategy. Test them as separate strategies on your own data and compare average trade after costs.

References

  • Brock, W., Lakonishok, J., & LeBaron, B. (1992). Simple Technical Trading Rules and the Stochastic Properties of Stock Returns. The Journal of Finance, 47(5), 1731–1764.
  • Sullivan, R., Timmermann, A., & White, H. (1999). Data-Snooping, Technical Trading Rule Performance, and the Bootstrap. The Journal of Finance, 54(5), 1647–1691.
  • Park, C.-H., & Irwin, S. H. (2007). What Do We Know About the Profitability of Technical Analysis? Journal of Economic Surveys, 21(4), 786–826.
  • Pardo, R. (2008). The Evaluation and Optimization of Trading Strategies (2nd ed.). John Wiley & Sons.