<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ThinkScripter - Custom ThinkScript Indicators for thinkorswim &#187; regular trading hours</title>
	<atom:link href="http://www.thinkscripter.com/tag/regular-trading-hours/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thinkscripter.com</link>
	<description>Custom ThinkScript Indicator Scripts for thinkorswim</description>
	<lastBuildDate>Mon, 28 Jun 2010 02:18:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Previous Day&#8217;s Regular Hours High/Low/Close +</title>
		<link>http://www.thinkscripter.com/2009/03/12/previous-days-regular-hours-highlowclose/</link>
		<comments>http://www.thinkscripter.com/2009/03/12/previous-days-regular-hours-highlowclose/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 02:58:28 +0000</pubDate>
		<dc:creator>ThinkScripter</dc:creator>
				<category><![CDATA[Indicator]]></category>
		<category><![CDATA[close]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[high]]></category>
		<category><![CDATA[low]]></category>
		<category><![CDATA[pivot]]></category>
		<category><![CDATA[regular trading hours]]></category>
		<category><![CDATA[thinkscript]]></category>

		<guid isPermaLink="false">http://thinkscripter.wordpress.com/?p=495</guid>
		<description><![CDATA[Here&#8217;s a custom script a reader commissioned me to build. It displays the previous day&#8217;s regular trading hours high/low/close as well as two custom pivots. The script works on both 24H charts as well as Trading Hours only charts. The custom pivots are defined as follows: 1) yesterday&#8217;s high + (yesterday&#8217;s high-two day&#8217;s ago high) [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a custom script a reader commissioned me to build. It displays the previous day&#8217;s <em>regular trading hours</em> high/low/close as well as two custom pivots. The script works on both 24H charts as well as Trading Hours only charts. The custom pivots are defined as follows:</p>
<p>1) yesterday&#8217;s high + (yesterday&#8217;s high-two day&#8217;s ago high)<br />
2) yesterday&#8217;s low + (yesterday&#8217;s low-two day&#8217;s ago low)<br />
<div id="attachment_497" class="wp-caption aligncenter" style="width: 460px"><a href="http://www.thinkscripter.com/wp-content/uploads/2009/03/prevhlc.png"><img src="http://www.thinkscripter.com/wp-content/uploads/2009/03/prevhlc.png" alt="Previous Day&#39;s Regular Hours H/L/C" title="prevhlc" width="450" height="477" class="size-full wp-image-497" /></a><p class="wp-caption-text">Previous Day's Regular Hours H/L/C</p></div><br />
<code style="text-align:left;"><br />
# PREVDAYHLC<br />
# (c) 2009 http://www.thinkscripter.com<br />
# thinkscripter@gmail.com<br />
# Last Update 08 Mar 2009</p>
<p>input showOnlyToday = YES;<br />
input Market_Open_Time = 0930;<br />
input Market_Close_Time = 1600;</p>
<p>def day = getDay();<br />
def lastDay = getLastDay();<br />
def isToday = if(day == lastDay, 1, 0);<br />
def shouldPlot = if(showOnlyToday and isToday, 1, if(!showOnlyToday, 1, 0));</p>
<p>def pastOpen = if((secondsTillTime(Market_Open_Time) &gt; 0), 0, 1);<br />
def pastClose = if((secondsTillTime(Market_Close_Time) &gt; 0), 0, 1);<br />
def marketOpen = if(pastOpen and !pastClose, 1, 0);<br />
def firstBar = if (day[1] != day, 1, 0);</p>
<p>def closingBell = if secondsTillTime(Market_Close_Time)[1]&gt;0 and<br />
secondsTillTime(Market_Close_Time)&lt;=0 or<br />
(secondsTillTime(Market_Close_Time)[1]&lt;secondsTillTime(Market_Close_Time)<br />
and secondsTillTime(Market_Close_Time)[1]&gt;0)  then 1 else 0;</p>
<p>rec regHoursHigh = if(high &gt; regHoursHigh[1] and marketOpen, high,<br />
if(marketOpen and !firstBar, regHoursHigh[1], high));<br />
rec regHoursLow = if(low &lt; regHoursLow[1] and marketOpen, low,<br />
if(marketOpen and regHoursLow[1] &gt; 0 and !firstBar, regHoursLow[1], low));</p>
<p>rec runningClose = compoundValue(1, if closingbell then close[1] else runningClose[1], close);<br />
rec prevClose = compoundValue(1, if closingBell  then runningClose else prevClose[1], close);<br />
rec prevHigh = compoundValue(1, if closingBell then regHoursHigh[1] else prevHigh[1], high);<br />
rec prevLow = compoundValue(1, if closingBell then regHourslow[1] else prevlow[1], low);<br />
rec prevHigh2 = compoundValue(1, if closingBell then prevHigh[1] else prevHigh2[1], high);<br />
rec prevLow2 = compoundValue(1, if closingBell then prevLow[1] else prevlow2[1], low);</p>
<p>plot pc = if shouldPlot then prevClose else double.nan;<br />
pc.SetStyle(curve.SHORT_DASH);<br />
pc.setDefaultColor(color.white);</p>
<p>plot pl = if shouldPlot then prevLow else double.nan;<br />
pl.SetDefaultColor(color.dark_red);<br />
plot ph = if shouldPlot then prevHigh else double.nan;<br />
ph.SetDefaultColor(color.dark_green);</p>
<p>plot pl2 = if shouldPlot then pl+(pl-prevLow2) else double.nan;<br />
pl2.SetDefaultColor(color.darK_red);<br />
pl2.SetStyle(curve.LONG_DASH);<br />
plot ph2 =if shouldPlot then ph+(ph-prevHigh2) else double.nan;<br />
ph2.SetStyle(curve.LONG_DASH);<br />
ph2.SetDefaultColor(color.dark_green);<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.thinkscripter.com/2009/03/12/previous-days-regular-hours-highlowclose/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
