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

2004issue C121-2

Constructing a fifteen-bar trend trigger as a next-open system

A 15-bar buy-power and sell-power contrast is scaled into a trend-trigger-factor, then mapped to a stance-code that changes only at extreme readings and is filled at the next session open.

  • Buy-power and sell-power compare the latest 15-bar highs and lows with the immediately preceding 15-bar window, rather than treating the contrast as a chart overlay.
  • The trend-trigger-factor scales that contrast by 100 so a reading above 100 or below -100 can change the stance-code, while every other reading keeps the prior long, short, or flat state.
  • When the stance-code changes, the next-open-fill is the following session open. When it does not change, the entry-price field stays blank and the existing stance-code is held.
  • The worked euro continuous-contract sheet stores date as an eight-digit year-month-day integer and pairs the first long stance-code with a next-open-fill of 99.29.
Entries in this reading2 entries

What is being constructed

The archive constructs buy-power, sell-power, and a scaled trend-trigger-factor from two adjacent 15-bar windows, then maps extreme readings to a stance-code. The stance-code is a next-session instruction, and a change is filled only at the next session open.

Buy-power and sell-power

A 15-bar buy-power reading equals the highest high in the latest 15 bars minus the lowest low in the prior 15 bars. The latest window supplies the high. The immediately preceding window supplies the low.

A 15-bar sell-power reading reverses those windows. It equals the highest high in the prior 15 bars minus the lowest low in the latest 15 bars.

The trend-trigger-factor

The 15-bar trend-trigger-factor is buy-power minus sell-power, divided by half the sum of those two powers, then multiplied by 100. The scaling is there so extreme readings can trip a stance-code change.

Stance-code rules

A trend-trigger-factor above 100 sets the next stance-code to 1, which means long. A reading below -100 sets it to -1, which means short. Otherwise the prior stance-code is kept, including a 0 that means no position.

The stance-code is a discrete next-session instruction. It is held until an opposite extreme is reached.

The next-open-fill

If the stance-code changes, the intended fill is the next session open. If the stance-code does not change, no new entry price is recorded and the existing stance-code is held.

Inputs on the worked sheet

Input series are date, open, high, low, and close. The date is stored as an eight-digit year-month-day integer.

The worked construction uses continuous-contract euro prices from 20021001 through 20030115. In the worked sheet the first long stance-code appears when the trend-trigger-factor rises above 100, and that flip is paired with a next-open-fill of 99.29.

Euro 15-day trend trigger factor versus the +100 long trigger

On the euro continuous contract the 15-day TTF first clears +100 on 19 November 2002 and the stance flips long, then stays long even while TTF slumps to about 18 in mid-December, because the code only reverses below −100. Numbers are the exact column-H readings from the worked Excel sheet for 13 November 2002 through 15 January 2003.
On the euro continuous contract the 15-day TTF first clears +100 on 19 November 2002 and the stance flips long, then stays long even while TTF slumps to about 18 in mid-December, because the code only reverses below −100. Numbers are the exact column-H readings from the worked Excel sheet for 13 November 2002 through 15 January 2003.Euro continuous futures · Daily bars, 15-day window · 2002-11-13T00:00:00.000Z to 2003-01-15T00:00:00.000Z

Fifteen daily bars in each window. Stance becomes 1 only when TTF is strictly above 100, −1 only when TTF is strictly below −100; otherwise the prior stance is held. Fills are at the next session open. The first 29 rows are warm-up and carry no TTF.

Educational research material, not investment advice. Historical source context does not establish present-day performance.
7 of 14 in the Rule-based entry track
20051-4 pp.Next on Rule-based entryState-locked rules for mechanical tradingA finite state machine occupies only one current state at a time, and only that state’s rules are checked on each new observation.
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