Financial software / Python

Opening Range Scanner

An intraday scanner that identifies opening-range breakouts and reversals from a configurable Excel watchlist.

Offline acceptance

  • Python
  • Excel
  • FYERS adapter
Opening Range Scanner demonstration poster
Actual Python CLI output · paced playback of an offline simulation
Open media
  1. The scanner reads its example workbook to establish the simulated opening range.

  2. The CLI displays a simulated entry, stop-loss and target calculated at 2R.

  3. The accepted offline run covers reversal and repeat suppression. Eleven automated tests passed.

Problem statement

Scanning a watchlist for a threshold crossing requires consistent handling of session time, duplicate signals and reversals.

Engineering objectives

Define the first 15-minute opening range, apply strict buffered thresholds and support a deterministic offline run.

Architecture

The Excel reader validates and deduplicates symbols. Provider adapters supply opening bars and quotes. A per-symbol state machine emits events that the CLI formats.

Technical diagram
  1. Read-only Excel watchlist
  2. Range and quote provider
  3. Per-symbol state
  4. CLI signals and risk levels

Implementation

The scanner uses the 09:15 IST opening candle. A strict cross beyond the buffer can produce a signal with a stop at the opposite range boundary and a default 2R target. Reentry clears active state and an opposite cross can emit a reversal.

Technical decisions

The strategy is independent of broker calls. The workbook is read-only. Public simulation uses a separate fictional fixture.

Challenges and solutions

Time-zone handling on Windows required IANA timezone data. Mocked candle selection and explicit threshold tests cover the session boundary and equality case.

Automated testing

11 automated tests passed, including normalization, missing opening data, exact risk levels, duplicates and reversals. The fictional CLI simulation exited successfully.

Verified results

  • Offline breakout and reversal behavior verified.
  • Private workbook exclusion verified and both original workbook hashes preserved.

Limitations

Live broker mapping, quote freshness, quotas and session calendar checks remain deferred. The scanner reports theoretical levels and does not track fills.

Future development

Verify live-read behavior with documented permissions and an approved read-only session.

Repository information

Repository
opening-range-scanner
Validated commit
7269c30
License
MIT
Source
GitHub
All projects