Skip to main content
Track Rule-based entry
11 / 14
Library

2012issue C0663-72

Monthly eight-bar average entry and exit rules

Archive implementations compared a monthly close with an eight-bar average, then changed whether the system reversed, stayed long-only, or waited for month-end. TradersWeek editorial: entry, exit, and abstention have to be specified together, because those choices decide which crossings become trades.

  • The archive bought when a monthly close was above an eight-bar average and sold short when it was below, only if the account was not already on that side.
  • The coded version took the price field, an eight-bar lookback, and the average type as inputs, then placed next-bar market orders after a position check on monthly charts only.
  • Other recodings waited for the last day of the month, matched a daily close to that month-end close, or stayed long until the monthly close broke below the average.
  • TradersWeek editorial: those execution choices decide which crossings become trades, so entry, exit, and abstention belong in one written procedure.
Entries in this reading3 entries

What the illustrated procedure did

The illustrated procedure bought when a monthly close was above an eight-bar average and sold short when that close was below the same average, provided the account was not already on that side.

That comparison used a moving average as a lookback average of ordered monthly prices, the explicit quantitative baseline set against the latest close. Rule-based entry went long only when the close was above the chosen average and the account was not already long. It could go short only when the close was below the average and the account was not already short.

How the system was coded

The coded strategy accepted the price field to average, an eight-bar default lookback, and a switch among simple, exponential, and weighted averages as explicit inputs.

Buy and sell-short orders were placed at the next bar's market only after the position check. The implementation raised an error unless the chart used monthly bars. Those constraints made a mechanical trading system: a fully specified procedure that converts a close-versus-average comparison into long, short, reverse, or exit actions, including next-bar execution and a required monthly bar interval.

Other recodings of the same comparison

Another implementation treated the eight-period monthly average as a crossing signal line, hid older markers with a trailing-bar display limit, and recorded clustered reversals after a late-May 2007 sell, then a later stretch in which price oscillated around the average.

A further recoding compared an eight-month average of monthly price to that price and issued buy or sell orders only when a last-day-of-month condition coincided with a cross. It offered additional average types beyond simple, exponential, and weighted.

A daily-bar implementation read the monthly close from a paired monthly series, defaulted to an eight-period average with longs on and shorts optional, and entered only when the daily close matched that month-end close.

Calendar day, lookback, and a long-only hold

One test kept the comparison rules fixed but rebuilt the monthly average on each calendar day from 1 through 28 as well as at standard month-end, and separately varied the lookback from 3 to 21.

A companion write-up described staying long while the monthly close remained above the eight-month average and exiting when it broke below. It plotted equity and drawdowns for 2003-11 and 1990-2002, and it also plotted how a risk-adjusted ratio changed with average length from 1990 through 2011.

FAGIX long-only trades from the monthly eight-bar average

Each bar is one long AmiBroker actually booked when the monthly FAGIX close crossed its eight-bar average, then exited on the opposite cross (or marked at the test end). The two multi-year winners dwarf the 2006–07 whipsaws, which is what a long-only reading of the same comparison produces. Figures are the percent-change column of the visible backtest table, not a traced price path.
Each bar is one long AmiBroker actually booked when the monthly FAGIX close crossed its eight-bar average, then exited on the opposite cross (or marked at the test end). The two multi-year winners dwarf the 2006–07 whipsaws, which is what a long-only reading of the same comparison produces. Figures are the percent-change column of the visible backtest table, not a traced price path.FAGIX · Monthly · 2002-11-01T00:00:00.000Z to 2012-12-31T00:00:00.000Z

Backtest window on the screenshot is 2001-01-01 to 2012-12-31, monthly bars, eight-period simple average of the close, long-only (no short reverse). The footer counts five winners out of nine trades; two rows sit outside the visible table and are omitted rather than filled in. The last listed long is still open at the 2012-12-31 test end.

Educational research material, not investment advice. Historical source context does not establish present-day performance.
11 of 14 in the Rule-based entry track
201278-79 pp.Next on Rule-based entryConstructing a simple moving average filter with fixed crossing rulesA simple moving average on a monthly high-yield series can be paired with crossing rules that mark discrete buy and sell events.
All readings on this track · 14 readings
  1. 1990Moving-average direction, range penetration, and a dollar stop
  2. 1990Rally and reaction day signals as a mechanical stock system
  3. 1991Constructing steppable currency games with stop alerts
  4. 1995Trading as a business: a case study of preparation and rule-based entry
  5. 1997Bond timing rules as one testable procedure
  6. 2000Rule-based moving average commentary as a testable filter
  7. 2004Constructing a fifteen-bar trend trigger as a next-open system
  8. 2005State-locked rules for mechanical trading
  9. 2007Same-session long entry from a moving-average filter
  10. 2012Liquidity, share count, and stop-trigger costs
  11. 2012Monthly eight-bar average entry and exit rules
  12. 2012Constructing a simple moving average filter with fixed crossing rules
  13. 2014A two-average brick crossover is not yet a trading system
  14. 2020Reject long-bar entries driven by volatility fear of missing out
All 292 readings tagged Rule-based entry
Also on Rule-based entry5 readings