Script Title: Midnight Range Deviations
Overview
This Pine Script (written in version 6) is designed to plot a “midnight range” on a chart based on price action from midnight to 00:30 (local exchange time in America/New_York by default). After determining the High, Low, and Midpoint during that half-hour window, the script extends those levels to a specified future time (by default, up to 6:00 AM). Additionally, the script can draw optional Fibonacci deviation lines above and below the range. Users can customize a variety of visual and functional parameters, including the number of historical ranges shown, colors for each line, the presence of labels, Fibonacci levels, and more.