title: Pine script time and plotting
body: <p>alright so im trying to make a script that plots the high, low, midpoint and 25 percentiles. I want it to plot the same day but I end up with this:
  <a href="https://i.stack.imgur.com/HNcDU.png" rel="nofollow noreferrer">what i have</a>
  It also starts counting the day at 5pm new york time, i want it to start at midnight new york time.
  Ive read the entire pine script documentation but apparently its a pain in the butt.</p>
  <p>For reference this is what i want:<a href="https://i.stack.imgur.com/IbMs5.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>this is my current code:</p>
  <pre><code>&gt; study(title=&quot;Previous Day Range&quot;, shorttitle=&quot;Previous Day Range&quot;,
  &gt; overlay=true) res = input(title=&quot;Resolution&quot;, type=resolution,
  &gt; defval=&quot;D&quot;)
  &gt; 
  &gt; dailyH = security(tickerid, res, high[1])  dailyL = security(tickerid,
  &gt; res, low[1])  dailyC =  security(tickerid, res, close[1])  dailyO = 
  &gt; security(tickerid, res, open[1]) 
  &gt; 
  &gt; midrange = (dailyH+dailyL)/2 midrangeup = (dailyH + midrange)/2
  &gt; midrangedown = (dailyL + midrange)/2
  &gt; 
  &gt; // Daily line breaks sopen = security(tickerid, res, open [1]) shigh =
  &gt; security(tickerid, res, high [1]) slow = security(tickerid, res, low
  &gt; [1]) sclose = security(tickerid, res, close [1])
  &gt; 
  &gt; // Color dcolor=sopen != sopen[1] ? na : black dcolor1=sopen !=
  &gt; sopen[1] ? na : blue dcolor2=sopen != sopen[1] ? na : black
  &gt; 
  &gt; 
  &gt; plot(dailyH ? dailyH : na, title=&quot;Daily High&quot;,
  &gt; color=dcolor,linewidth=3)  plot(dailyL ? dailyL : na, title=&quot;Daily
  &gt; Low&quot;, color=dcolor, linewidth=3)  plot(midrange ? midrange : na,
  &gt; title=&quot;midrange&quot;, color=dcolor1, linewidth=2) plot(midrangedown ?
  &gt; midrangedown : na, title=&quot;25%&quot;, color=dcolor2,linewidth=1)
  &gt; plot(midrangeup ? midrangeup : na, title=&quot;75%&quot;,
  &gt; color=dcolor2,linewidth=1)
  &gt; 
  &gt; 
  &gt; 
  &gt; crossing_dailyH = close &gt;= dailyH crossing_dailyL = close &lt;= dailyL
  &gt; crossing_midrange = cross(close,midrange) crossing_75 =
  &gt; cross(close,midrangeup) crossing_25 = cross(close,midrangedown) alert1
  &gt; = crossing_dailyH or crossing_dailyL alert2 = crossing_midrange alert3 = crossing_75 alert4 = crossing_25 alertcondition(alert1, title='Range break', message='Price Breaking Range') alertcondition(alert2,
  &gt; title='Midrange breaking', message= 'Price breeaking Mid Range')
  &gt; alertcondition(alert3, title='75% Break', message= 'Price breaking 75%
  &gt; Range') alertcondition(alert3, title='25% Break', message= 'Price
  &gt; breaking 25% Range')
  </code></pre>