<?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; range</title>
	<atom:link href="http://www.thinkscripter.com/tag/range/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>Three Day Pivot Range</title>
		<link>http://www.thinkscripter.com/indicator/three-day-pivot-range/</link>
		<comments>http://www.thinkscripter.com/indicator/three-day-pivot-range/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 02:10:36 +0000</pubDate>
		<dc:creator>ThinkScripter</dc:creator>
				<category><![CDATA[Indicator]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[pivot]]></category>
		<category><![CDATA[range]]></category>
		<category><![CDATA[thinkscript]]></category>

		<guid isPermaLink="false">http://thinkscripter.wordpress.com/?p=334</guid>
		<description><![CDATA[The three day rolling pivot range. The pivots are calculated using 24 hour data (vice normal hours) which appears to be a limitation of ThinkScript's high() and low() functions. <a href="http://www.thinkscripter.com/indicator/three-day-pivot-range/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s another reader request. The three day rolling pivot range. The pivots are calculated using 24 hour data (vice normal hours) which appears to be a limitation of ThinkScript&#8217;s high() and low() functions. If anyone knows a workaround, I&#8217;d love to hear it.</p>
<p>The formulas for the high and low pivot range are as follows:</p>
<p>The Pivot= (3day High + 3day Low + Close)/3<br />
The Midpoint= (3day High + 3 day Low)/2<br />
Pivot Range= Absolute Value (Pivot &#8211; Midpoint)<br />
Pivot High= Pivot + Range<br />
Pivot Low= Pivot &#8211; Range</p>
<div id="attachment_337" class="wp-caption aligncenter" style="width: 640px"><a href="http://www.thinkscripter.com/wp-content/uploads/2009/02/threedaypivotrange.png"><img src="http://www.thinkscripter.com/wp-content/uploads/2009/02/threedaypivotrange.png" alt="Three Day Pivot Range" title="threedaypivotrange" class="size-full wp-image-337" /></a><p class="wp-caption-text">Three Day Pivot Range</p></div>
<pre class="brush: thinkscript; title: ; notranslate"># THREEDAYPIVOTRANGE
# http://www.thinkscripter.com
# thinkscripter@gmail.com
# Last Update 22 Feb 2009

input timeFrame = {default DAY};
input showOnlyToday = no;

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

def HA = high(period = timeFrame)[1];
def HB = high(period = timeFrame)[2];
def HC = high(period = timeFrame)[3];
def LA = low(period = timeFrame)[1];
def LB = low(period = timeFrame)[2];
def LC = low(period = timeFrame)[3];
def C = close(period = timeFrame)[1];

def H3 = Max(Max(HA, HB), HC);
def L3 = Min(Min(LA, LB), LC);

def calc_PP = (H3 + L3 + C) / 3;
def calc_MP = (H3 + L3) / 2;
def calc_PR = AbsValue(calc_PP - calc_mp);
def calc_PH = Calc_PP + calc_PR;
def calc_PL = Calc_PP - calc_PR;

plot PH =if (shouldPlot , calc_PH, double.nan);
plot PL = if (shouldPlot , calc_PL, double.nan);

PH.setStyle(curve.POINTS);
PL.setStyle(curve.POINTS);

PH.SetDefaultColor(color.cyan);
PL.SetDefaultColor(color.yellow);

PH.SetStyle(Curve.POINTS);
PL.SetStyle(Curve.POINTS);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.thinkscripter.com/indicator/three-day-pivot-range/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Day Range and Midpoint Pivot</title>
		<link>http://www.thinkscripter.com/indicator/day-range-and-midpoint-pivot/</link>
		<comments>http://www.thinkscripter.com/indicator/day-range-and-midpoint-pivot/#comments</comments>
		<pubDate>Sun, 18 Jan 2009 19:04:52 +0000</pubDate>
		<dc:creator>ThinkScripter</dc:creator>
				<category><![CDATA[Indicator]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[high]]></category>
		<category><![CDATA[low]]></category>
		<category><![CDATA[pivot]]></category>
		<category><![CDATA[range]]></category>
		<category><![CDATA[thinkscript]]></category>

		<guid isPermaLink="false">http://thinkscripter.wordpress.com/?p=112</guid>
		<description><![CDATA[This script plots the highest regular-hours high, lowest regular-hours low, and midpoint pivot at each bar. <a href="http://www.thinkscripter.com/indicator/day-range-and-midpoint-pivot/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This script plots the highest regular-hours high, lowest regular-hours low, and midpoint pivot at each bar.</p>
<div id="attachment_113" class="wp-caption aligncenter" style="width: 640px"><a href="http://www.thinkscripter.com/wp-content/uploads/2009/01/dayrange.png"><img class="size-full wp-image-113" title="dayrange" src="http://www.thinkscripter.com/wp-content/uploads/2009/01/dayrange.png" alt="Day Range and Midpoint Pivot"  /></a><p class="wp-caption-text">Day Range and Midpoint Pivot</p></div>
<pre class="brush: thinkscript; title: ; notranslate"># DAYRANGE
# http://www.thinkscripter.com
# thinkscripter@gmail.com
# Last Update 14 Feb 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, day-1, 0);

rec regHoursHigh = if(high&gt; regHoursHigh[1] and marketOpen, high, if(marketOpen and !firstBar, regHoursHigh[1], high));
plot Regular_Hours_High = if(marketOpen and shouldPlot, regHoursHigh, Double.nan);
Regular_Hours_High.SetStyle(curve.points);
Regular_Hours_High.SetDefaultColor(color.green);
Regular_Hours_High.SetLineWeight(2);

rec regHoursLow = if(low &lt; regHoursLow[1] and marketOpen, low, if(marketOpen and regHoursLow[1] &gt; 0 and !firstBar, regHoursLow[1],low));
plot Regular_Hours_Low = if(marketOpen and shouldPlot, regHoursLow, double.nan);
Regular_Hours_Low.SetLineWeight(2);
Regular_Hours_Low.SetStyle(curve.points);
Regular_Hours_Low.SetDefaultColor(color.red);

plot Midpoint_Pivot = if(marketOpen and shouldPlot, (Regular_Hours_High + Regular_Hours_Low) / 2, double.nan);
Midpoint_Pivot.SetLineWeight(2);
Midpoint_Pivot.SetDefaultColor(color.white);
Midpoint_Pivot.SetPaintingStrategy(PaintingStrategy.POINTS);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.thinkscripter.com/indicator/day-range-and-midpoint-pivot/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

