DOpen
DOpen returns the opening price of a daily bar in ProBuilder. Use DOpen(N) to read the open from N days ago on any timeframe, without switching the chart to daily bars.
Syntax
DOpen(N)N is a non-negative value giving the number of days back. DOpen(0) is the current day, DOpen(1) is the previous trading day, and so on.
How it works
DOpen reads the opening price of a daily bar even when the chart runs on an intraday timeframe. On a five-minute chart, DOpen(1) still returns yesterday's daily open rather than the open of a five-minute bar.
The argument uses parentheses, not square brackets, and counts in trading days. Because it steps through daily data, N must stay within the loaded daily history, otherwise the call errors.
Daily open levels are common anchors for intraday logic, such as measuring how far price has moved from the session open or comparing today's open with prior days. DOpen pairs with DHigh, DLow, and DClose to reconstruct a full daily bar from within any timeframe.
Examples
Example 1, Distance from today's open (Indicator)
// Move of the current price relative to today's daily open
todayOpen = DOpen(0)
move = Close - todayOpen
RETURN move AS "From day open"The indicator shows how far the current price has travelled from the day's opening level.
Example 2, Screening for a gap versus prior close (ProScreener)
// Today's open above yesterday's daily close
gapUp = DOpen(0) > DClose(1)
SCREENER[gapUp] (DOpen(0) AS "Day open")The screener returns instruments that opened the session above the previous day's close.
Example 3, Intraday bias from the day open (ProOrder)
DEFPARAM CumulateOrders = false
// Long bias only while price holds above today's open
IF Close > DOpen(0) AND Close CROSSES OVER Average[20](Close) THEN
BUY 1 CONTRACT AT MARKET
ENDIF
SET STOP %LOSS 1The entry requires price to sit above DOpen(0), using the daily open as an intraday trend filter.
Common errors and gotchas
- Parentheses, not brackets.
DOpentakes its argument in parentheses likeDOpen(1). Using square brackets is a syntax error. - Counts days, not bars. N is a day offset, so
DOpen(1)is yesterday's open regardless of how many intraday bars sit between now and then. - Needs daily history. A large N requires enough loaded daily data. Referencing a day beyond the available history raises an error.
Related instructions
DClose, the closing price of a past daily bar.DHigh, the highest price of a past daily bar.DLow, the lowest price of a past daily bar.Open, the opening price of the current timeframe's bar.Close, the closing price of a bar.High, the highest price of a bar.Low, the lowest price of a bar.CustomClose, the user-selectable price source.
