Skip to content
All library documents

A Four-Bar Price Comparison Count for TD-Style Signals

Article Strategy library · Author: btccccrazy

Summary

This document presents a rule-based count built from recent Bitcoin futures prices. On hourly records, it compares each close with the close four bars earlier. Consecutive higher comparisons increment a positive count, while lower comparisons build a negative count; the code then uses the latest count to trigger orders. It opens short positions at selected positive counts and long positions at selected negative counts, and closes an existing position when the count moves back toward the opposite side.

The source includes a backtest configuration for BTC/USD quarterly futures over a 15-minute period, but the program requests hourly records and pauses for 15 minutes between loops. That mismatch makes the published settings difficult to interpret. The code also scans a recent window and bases the signal on the final consecutive run, without presenting performance statistics or a clear position-sizing or stop-loss framework. Although the title invokes the TD Sequential indicator, the implementation shown is a simplified price-comparison count, and its commented threshold warnings are inactive. The document therefore offers a coding example rather than evidence that the signals are profitable.

Key ideas

  • The count increments when a close is above the close four bars earlier and resets otherwise.
  • A negative count accumulates when a close is below the close four bars earlier.
  • Selected positive counts trigger short entries, while selected negative counts trigger long entries.
  • Existing positions close when the count reaches a small threshold in the opposite direction.
  • The code requests hourly data despite published 15-minute backtest settings, and no performance results are provided.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.