OPEN-SOURCE SCRIPT

Midnight Open Retracement [LuxAlgo]

32 819
The Midnight Open Retracement [LuxAlgo] indicator highlights the 12:00 AM ET opening price and provides real-time probability statistics for price retracing to this level during the New York session.

Designed specifically with NQ (Nasdaq 100) futures data in mind, the tool helps traders identify high-probability "magnet" levels for New York open scalps based on historical performance.

🔶 USAGE

The Midnight Open is a cornerstone of ICT concepts, acting as a "true" daily open that often serves as a point of institutional re-accumulation or distribution. This script automates the identification of this level and provides a dashboard to help traders decide when to expect a retracement.

🔹 Identifying the Bias

The script compares the New York opening price (9:30 AM ET) to the Midnight opening price:

  • If NY opens above the Midnight Open, the indicator identifies a potential bearish retracement bias toward the level.
  • If NY opens below the Midnight Open, the indicator identifies a potential bullish retracement bias toward the level.


🔹 Using as a Profit Target

Because the Midnight Open is retraced to frequently, it serves as an ideal Take Profit (TP) target for opening range scalps. The indicator marks the exact moment a retracement occurs with a visual marker, confirming the level has been tested.

🔶 DETAILS

The statistics integrated into this tool are based on extensive backtesting of NQ futures over 6-month periods. Understanding these probabilities allows traders to filter out low-conviction setups and focus on high-probability days.

🔹 The Core Probabilities

  • When price opens above the midnight level, it retraces to touch it 74% of the time.
  • When price opens below the midnight level, it retraces to touch it 63% of the time.


🔹 Weekday Variance

Not all trading days are equal. The script accounts for "By Weekday" statistics:

  • High Probability (Wednesdays): On Wednesdays, retracement probabilities can jump as high as 89% for opens above the midnight level.
  • Low Probability (Mondays): Mondays often exhibit "Avoid" criteria, with retracement probabilities frequently falling below 60%.


The dashboard dynamically updates the "Probability of Retracement" based on the current day of the week, helping you stay aligned with historical data.

🔶 SETTINGS

🔹 Session Settings

  • Timezone Mode: Choose between Exchange time or "America/New_York" (recommended for ICT concepts).
  • Midnight Open Time: The specific time used to set the daily baseline.
  • NY Open Time: The time used to determine the session opening bias.
  • NY Session Range: Defines the boundary for the New York session box.


🔹 Visual Settings

  • Show Midnight Level: Toggles the horizontal line representing the midnight price.
  • Show Retrace Circle: Displays markers on the chart when the retracement goal is met.
  • Show NY Session Box: Draws a dynamic box for the NY session that changes color based on the current price relative to the open.


🔹 Dashboard Settings

  • Show Insights Report: Toggles the statistics dashboard on the chart.
  • Position/Size: Controls the UI placement and scale of the data table.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.