<?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 &#187; close</title>
	<atom:link href="http://www.thinkscripter.com/tag/close/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thinkscripter.com</link>
	<description>thinkScript Indicators for thinkorswim</description>
	<lastBuildDate>Sun, 29 Jan 2012 16:11:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Previous Day&#8217;s Regular Hours High/Low/Close +</title>
		<link>http://www.thinkscripter.com/indicator/previous-days-regular-hours-highlowclose/</link>
		<comments>http://www.thinkscripter.com/indicator/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[Displays the previous day'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. <a href="http://www.thinkscripter.com/indicator/previous-days-regular-hours-highlowclose/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></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: 640px"><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"  class="size-full wp-image-497" /></a><p class="wp-caption-text">Previous Day's Regular Hours H/L/C</p></div></p>
<pre class="brush: thinkscript; title: ; notranslate">
# PREVDAYHLC
# (c) 2009 http://www.thinkscripter.com
# thinkscripter@gmail.com
# Last Update 08 Mar 2009

input showOnlyToday = YES;
input Market_Open_Time = 0930;
input Market_Close_Time = 1600;

def day = getDay();
def lastDay = getLastDay();
def isToday = if(day == lastDay, 1, 0);
def shouldPlot = if(showOnlyToday and isToday, 1, if(!showOnlyToday, 1, 0));

def pastOpen = if((secondsTillTime(Market_Open_Time) &gt; 0), 0, 1);
def pastClose = if((secondsTillTime(Market_Close_Time) &gt; 0), 0, 1);
def marketOpen = if(pastOpen and !pastClose, 1, 0);
def firstBar = if (day[1] != day, 1, 0);

def closingBell = if secondsTillTime(Market_Close_Time)[1] &gt; 0 and
secondsTillTime(Market_Close_Time)&lt;=0 or
(secondsTillTime(Market_Close_Time)[1]&lt;secondsTillTime(Market_Close_Time)
and secondsTillTime(Market_Close_Time)[1]&gt;0)  then 1 else 0;

rec regHoursHigh = if(high &gt; regHoursHigh[1] and marketOpen, high,
if(marketOpen and !firstBar, regHoursHigh[1], high));
rec regHoursLow = if(low &lt; regHoursLow[1] and marketOpen, low,
if(marketOpen and regHoursLow[1] &gt; 0 and !firstBar, regHoursLow[1], low));

rec runningClose = compoundValue(1, if closingbell then close[1] else runningClose[1], close);
rec prevClose = compoundValue(1, if closingBell  then runningClose else prevClose[1], close);
rec prevHigh = compoundValue(1, if closingBell then regHoursHigh[1] else prevHigh[1], high);
rec prevLow = compoundValue(1, if closingBell then regHourslow[1] else prevlow[1], low);
rec prevHigh2 = compoundValue(1, if closingBell then prevHigh[1] else prevHigh2[1], high);
rec prevLow2 = compoundValue(1, if closingBell then prevLow[1] else prevlow2[1], low);

plot pc = if shouldPlot then prevClose else double.nan;
pc.SetStyle(curve.SHORT_DASH);
pc.setDefaultColor(color.white);

plot pl = if shouldPlot then prevLow else double.nan;
pl.SetDefaultColor(color.dark_red);
plot ph = if shouldPlot then prevHigh else double.nan;
ph.SetDefaultColor(color.dark_green);

plot pl2 = if shouldPlot then pl+(pl-prevLow2) else double.nan;
pl2.SetDefaultColor(color.darK_red);
pl2.SetStyle(curve.LONG_DASH);
plot ph2 =if shouldPlot then ph+(ph-prevHigh2) else double.nan;
ph2.SetStyle(curve.LONG_DASH);
ph2.SetDefaultColor(color.dark_green);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.thinkscripter.com/indicator/previous-days-regular-hours-highlowclose/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

