<?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; MACD</title>
	<atom:link href="http://www.thinkscripter.com/tag/macd/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>MACD Trading System</title>
		<link>http://www.thinkscripter.com/indicator/macd-trading-system/</link>
		<comments>http://www.thinkscripter.com/indicator/macd-trading-system/#comments</comments>
		<pubDate>Sun, 13 Nov 2011 19:38:27 +0000</pubDate>
		<dc:creator>ThinkScripter</dc:creator>
				<category><![CDATA[Indicator]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[MACD]]></category>
		<category><![CDATA[Stops]]></category>
		<category><![CDATA[thinkscript]]></category>
		<category><![CDATA[trading system]]></category>

		<guid isPermaLink="false">http://www.thinkscripter.com/?p=3462</guid>
		<description><![CDATA[An automated trading strategy based on the MACD. <a href="http://www.thinkscripter.com/indicator/macd-trading-system/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Building on the basic infrastructure I developed in the <a href="http://www.thinkscripter.com/indicator/turtle-trading-system/">Turtle Trading System</a>, I&#8217;m developing a series of signals-based mechanical trading systems (MACD, CCI, RSI, etc). The first is a basic MACD trading system. The signals are based on either the MACD and its signal line crossing or the MACD line itself transiting the zero line. The signal is taken at the close of the bar so as to be a &#8220;worst-case&#8221; entry. I&#8217;ve also added in the ability to use an ATR trailing stop after a signal is taken or just let the system be &#8220;Always-In.&#8221; As with the <a href="http://www.thinkscripter.com/indicator/turtle-trading-system/">Turtle Trading System</a>, I&#8217;ve coded some backtesting information into the study so the user can get a feel for the performance over time (number of trades, total profit/loss, wins, losses, biggest winner, biggest loser, average winner, average loser, peak profit, max drawdown, profit ratio, slippage). The automated position sizing algorithm for futures trading from the Turtle Rules is also included as is the equity curve of the system to graphically represent the profit/loss. <strong><a href="http://www.thinkscripter.com/pro-membership/">Pro Members</a> can expect an update some time this week with several new systems included.</strong></p>
<p class="alert"><strong>! ! !  IMPORTANT  ! ! !</strong><br />
It goes without saying, but I&#8217;m going to say it up front here with emphasis: &#8211; You should not trade this system unless you fully understand the basic concepts. You must do your own due diligence. A trading system does not relieve you of your responsibility for the trades. Just because a system shows a historical profit on your chart does not mean it will continue to do so in the future. Over-optimization of the MACD parameters to make the current chart as profitable as possible is a likely path to future destruction and is referred to as &#8220;Curve-Fitting.&#8221; </p>
<div id="pro" class="wp-caption aligncenter" style="width: 640px"><a href="http://www.thinkscripter.com/wp-content/uploads/2011/11/MACDTS.png"><img src="http://www.thinkscripter.com/wp-content/uploads/2011/11/MACDTS.png" alt="" title="MACDTS" class="size-full wp-image-3467" /></a><p class="wp-caption-text">MACD Trading System</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.thinkscripter.com/indicator/macd-trading-system/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>MACD with Bollinger Bands</title>
		<link>http://www.thinkscripter.com/indicator/macd-with-bollinger-bands/</link>
		<comments>http://www.thinkscripter.com/indicator/macd-with-bollinger-bands/#comments</comments>
		<pubDate>Sat, 19 Feb 2011 21:06:51 +0000</pubDate>
		<dc:creator>ThinkScripter</dc:creator>
				<category><![CDATA[Indicator]]></category>
		<category><![CDATA[Bollinger Bands]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[MACD]]></category>
		<category><![CDATA[thinkscript]]></category>

		<guid isPermaLink="false">http://www.thinkscripter.com/?p=3229</guid>
		<description><![CDATA[A standard MACD with its own set of Bollinger Bands. <a href="http://www.thinkscripter.com/indicator/macd-with-bollinger-bands/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We had a request in the <a href="http://www.thinkscripter.com/forum/">forum</a> to duplicate an indicator found on other platforms that plots a standard MACD with a set of its own Bollinger Bands. Here it is in case you missed it in the <a href="http://www.thinkscripter.com/forum/">forum</a>.<br />
-Eric<br />
<div id="attachment_3228" class="wp-caption aligncenter" style="width: 640px"><a href="http://www.thinkscripter.com/wp-content/uploads/2011/02/MACDBB.png"><img src="http://www.thinkscripter.com/wp-content/uploads/2011/02/MACDBB.png" alt="" title="MACDBB"  class="size-full wp-image-3228" /></a><p class="wp-caption-text">MACD with Bollinger Bands</p></div></p>
<pre class="brush: thinkscript; title: ; notranslate">
# TS_MACD_BB
# By Eric Purdy, ThinkScripter LLC
# http://www.thinkscripter.com
# thinkscripter@gmail.com
# Last Update 07 Feb 2011

declare lower;

input price = close;
input BBlength = 10;
input BBNum_Dev = 1.0;
input MACDfastLength = 12;
input MACDslowLength = 26;
input MACDLength = 5;

def MACD_Data = MACD(fastLength=MACDfastLength, slowLength=MACDslowLength, MACDLength = MACDLength);

plot MACD_Dots = MACD_Data;
plot MACD_Line= MACD_Data;

plot BB_Upper = BollingerBandsSMA(price = MACD_Line, length=BBlength, Num_Dev_Dn=-BBNum_Dev, Num_Dev_Up=BBNum_Dev).UpperBand;
plot BB_Lower = BollingerBandsSMA(price = MACD_Line, length=BBlength, Num_Dev_Dn=-BBNum_Dev, Num_Dev_Up=BBNum_Dev).Lowerband;
plot BB_Midline = BollingerBandsSMA(price = MACD_Line, length=BBlength, Num_Dev_Dn=-BBNum_Dev, Num_Dev_Up=BBNum_Dev).MidLine;

BB_Upper.SetDefaultColor(color.gray);
BB_Lower.SetDefaultColor(color.gray);
BB_MidLine.SetDefaultColor(color.gray);
BB_MidLine.setStyle(curve.SHORT_DASH);

MACD_Line.setDefaultColor(color.white);

MACD_Dots.setStyle(curve.POINTS);
MACD_Dots.setLineWeight(2);
MACD_Dots.assignValueColor(if MACD_Line&gt;MACD_line[1] then color.green else color.red);

plot zero = 0;
zero.assignValueColor(if MACD_line&lt;0 then color.red else color.green);
zero.setLineWeight(2);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.thinkscripter.com/indicator/macd-with-bollinger-bands/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>HLC MACD</title>
		<link>http://www.thinkscripter.com/indicator/hlc-macd/</link>
		<comments>http://www.thinkscripter.com/indicator/hlc-macd/#comments</comments>
		<pubDate>Sun, 18 Jan 2009 03:00:33 +0000</pubDate>
		<dc:creator>ThinkScripter</dc:creator>
				<category><![CDATA[Indicator]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[MACD]]></category>
		<category><![CDATA[thinkscript]]></category>

		<guid isPermaLink="false">http://thinkscripter.wordpress.com/?p=50</guid>
		<description><![CDATA[MACD based on the HLC/3 datapoint better at showing divergences. <a href="http://www.thinkscripter.com/indicator/hlc-macd/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a MACD with a few subtle changes:</p>
<p>1) The price data used is (H+L+C)/3 rather than the close. I find this makes a subtle improvement in the display of divergences.</p>
<p>2) You can plot a second long time frame MACD line on the same chart (hidden by default).</p>
<p>3) The histogram bars are colored based on the relationship to the previous bar vice the standard above/below zero line coloring.</p>
<p>4) The color of the main MACD line is white when the slope is positive and purple when negative.</p>
<div id="attachment_2444" class="wp-caption aligncenter" style="width: 640px"><a href="http://www.thinkscripter.com/wp-content/uploads/2009/01/macdhlc.png"><img src="http://www.thinkscripter.com/wp-content/uploads/2009/01/macdhlc.png" alt="" title="macdhlc"  class="size-full wp-image-2444" /></a><p class="wp-caption-text">MACD HLC/3</p></div>
<pre class="brush: thinkscript; title: ; notranslate"># MACDHLC
# http://thinkscripter.wordpress.com
# thinkscripter@gmail.com
# Last Update 17 Jan 2009

declare lower;

input ShortTimeFrameFastLength = 7;
input ShortTimeFrameSlowLength = 28;
input STFMACDLength = 7;
input LongTimeFrameFastLength = 28;
input LongTimeFrameSlowLength = 112;
input LTFMACDLength = 5;

def fastAvg = ExpAverage(data = hlc3, length = ShortTimeFrameFastLength);
def slowAvg = ExpAverage(data = hlc3, length = ShortTimeFrameSlowLength);

plot STFValue = fastAvg - slowAvg;
STFValue.setLineWeight(2);
DEF STFslope = (STFValue-STFValue[1]);
DEF STFslopeColor = if(STFslope &gt; 0.0,9,0);
STFValue.AssignValueColor(getColor(STFSlopeColor));
 
plot STFAvg = ExpAverage(data = STFValue, length = STFMACDLength);
STFAvg.SetDefaultColor(GetColor(8));

def LfastAvg = ExpAverage(data = hlc3, length = LongTimeFrameFastLength);
def LslowAvg = ExpAverage(data = hlc3, length = LongTimeFrameSlowLength);
 
plot LTFValue = LfastAvg - LslowAvg;
LTFValue.setDefaultColor(color.green);
LTFValue.hide();

plot Diff = STFvalue - STFavg;
diff.AssignValueColor(if diff &gt;= diff[1] then Color.UPTICK else Color.DOWNTICK);
Diff.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Diff.SetDefaultColor(GetColor(5));
 
plot ZeroLine = 0;
ZeroLine.SetDefaultColor(GetColor(0));</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.thinkscripter.com/indicator/hlc-macd/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

