Day Trading Levels
Table of Contents
Day Trading Key Levels Script

What it is
This script automatically plots the most important day trading levels:
Previous Day High (PDH)
Previous Day Low (PDL)
Pre-Market High (PMH)
Pre-Market Low (PML)
Opening Gap Cloud
The levels are only shown on intraday charts so they do not cluster your 1D or 1W charts. You know longer have to plot these levels everyday.
How To Use
Use this script to day trade key level supports, resistances, and breakouts. An A+ trade setup for me is a green trend day where the VIX is falling and the ticker I’m trading is breaking above PDH & PMH. I consider these levels equivalent to ATHs on a daily chart. Breaks of PDH & PMH have chance to gain serious momentum and become runaways on a day trading timeframe.
See the Day Trading Playbook to see examples of how price reacts to these key levels.
The Script
declare hide_on_daily;
input PlotPreMarketLevels = yes;
input DisplayLabels = yes;
input PlotPreviousDayLevels = yes;
input PlotOpeningGap = yes;
def o = open;
def h = high;
def l = low;
def c = close;
def v = volume;
def bar = BarNumber();
def GlobeX = GetTime() < RegularTradingStart(GetYYYYMMDD());
def vol = if GlobeX and !GlobeX[1]
then v
else if GlobeX
then vol[1] + v
else Double.NaN;
def GlobeX_Volume = vol;
def ONhigh = if GlobeX and !GlobeX[1]
then h
else if GlobeX and
h > ONhigh[1]
then h
else ONhigh[1];
def ONhighBar = if GlobeX and h == ONhigh
then bar
else Double.NaN;
def ONlow = if GlobeX and !GlobeX[1]
then l
else if GlobeX and
l < ONlow[1]
then l
else ONlow[1];
def ONlowBar = if GlobeX and l == ONlow
then bar
else Double.NaN;
def OverNightHigh = if BarNumber() == HighestAll(ONhighBar)
then ONhigh
else OverNightHigh[1];
def OverNightLow = if BarNumber() == HighestAll(ONlowBar)
then ONlow
else OverNightLow[1];
plot PMH = if OverNightHigh > 0
then OverNightHigh
else Double.NaN;
plot PML = if OverNightLow > 0
then OverNightLow
else Double.NaN;
#Plot yesterday’s high / low
input ShowTodayOnly = {“No”, default “Yes”};
def s = ShowTodayOnly;
def today = if s == 0 or GetDay() == GetLastDay() and SecondsFromTime(0) >= 0 then 1 else 0;
plot PDH = if ShowTodayOnly and !today then Double.NaN else high(period = “day”)[1];
plot PDL = if ShowTodayOnly and !today then Double.NaN else low(period = “day” )[1];
PDH.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
PDH.SetDefaultColor(Color.green);
PDL.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
PDL.SetDefaultColor(Color.Red);
PMH.SetHiding(!PlotPreMarketLevels);
PMH.SetDefaultColor(Color.Green);
PMH.SetPaintingStrategy(PaintingStrategy.Dashes);
PML.SetHiding(!PlotPreMarketLevels);
PML.SetDefaultColor(Color.RED);
PML.SetPaintingStrategy(PaintingStrategy.Dashes);
#Opening gap plots
def pdc = if ShowTodayOnly and !today then Double.NaN else close(period = “day” )[1];
def open = if ShowTodayOnly and !today then Double.NaN else open(period = “day” );
addcloud((if plotopeninggap then open else double.nan),pdc,color.green, color.red);