Skip to content
All library documents

Dual Thrust Daily Range Calculation and Entry Levels

Article vn.py community

Summary

This code walkthrough explains how a Dual Thrust strategy tracks each day’s opening price, high, and low. When a bar’s date differs from the prior bar’s date, it uses the accumulated previous-day range to set long and short entry levels around the new day’s opening price. The thresholds are adjusted by separate strategy parameters, and the entry flags are reset for the new session. During the day, incoming bars update the running high and low.

The document mainly describes state updates and the transition between trading days; it does not show the complete order-entry logic or provide backtest results. Its explanation assumes daily bars arrive in chronological order and that prior-day values are available at the date change. The shown initialization of the daily low to zero followed by taking the minimum with bar lows may fail to record a positive-price market’s actual low, so that implementation detail merits review before use. Instrument, session, and bar-data handling are not discussed.

Key ideas

  • The strategy calculates a daily range from the prior day’s tracked high and low.
  • At a new date, it places long and short threshold levels around the new bar’s opening price.
  • The daily high and low are updated from each bar during the session.
  • Entry flags reset when the strategy detects a new trading day.
  • Initializing the low to zero can produce an incorrect low for markets with positive prices.

Tags

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