<?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>Poli Bou &#187; Web Development</title>
	<atom:link href="http://www.polibou.com/category/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.polibou.com</link>
	<description>People. Places. Things.</description>
	<lastBuildDate>Tue, 22 Jun 2010 18:40:03 +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>Simple and Clean Memcached</title>
		<link>http://www.polibou.com/2010/02/26/simple-and-clean-memcached/</link>
		<comments>http://www.polibou.com/2010/02/26/simple-and-clean-memcached/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 22:54:27 +0000</pubDate>
		<dc:creator>Poli</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[Memcached]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.polibou.com/?p=375</guid>
		<description><![CDATA[I just recently moved my company&#8217;s web infrastructure out from our colo facility and onto Amazon Web Services (mainly EC2). Hopefully I&#8217;ll have a writeup on the whole process soon. We started running a couple of heavy ad campaigns and it severely loaded the servers. At the time I had our Memcached setup disabled while [...]]]></description>
			<content:encoded><![CDATA[<p>I just recently moved my company&#8217;s web infrastructure out from our colo facility and onto Amazon Web Services (mainly EC2).  Hopefully I&#8217;ll have a writeup on the whole process soon.  We started running a couple of heavy ad campaigns and it severely loaded the servers.  At the time I had our Memcached setup disabled while debugging the kinks out from the migration.</p>
<p>With the large influx of traffic it was time to setup Memcached again.  This gave me a chance to re-examine how it was done.  Previously, we would cache various blocks of a given page.  Depending on the situation, this can be a good solution if you needed a combination of cached content and dynamic output.  However, this method is a little dirty since you have to modify your existing source code.</p>
<p>Here&#8217;s a solution that I&#8217;ve come up with.  Basically, you scrape the entire HTML output and store that in Memcache.  I think its very clean and non-invasive.  You don&#8217;t have to modify the existing code at all.</p>
<div class="codecolorer-container php blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?</span><br />
<span style="color: #666666; font-style: italic;">////////////////////////////////////////////////////////////////</span><br />
<span style="color: #666666; font-style: italic;">// index.php</span><br />
<span style="color: #666666; font-style: italic;">//</span><br />
<span style="color: #666666; font-style: italic;">// This is an example of memcaching a full static page</span><br />
<span style="color: #666666; font-style: italic;">////////////////////////////////////////////////////////////////</span><br />
<br />
<span style="color: #666666; font-style: italic;">// This is the page you want to cache</span><br />
<span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://www.mysite/mydynamicpage&quot;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// This function grabs the HTML of the page</span><br />
<span style="color: #000000; font-weight: bold;">function</span> ScrapePage <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$url</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000088;">$ch</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp;<span style="color: #666666; font-style: italic;">// initialize curl handle</span><br />
&nbsp; &nbsp; <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_URL<span style="color: #339933;">,</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// set url to post to</span><br />
&nbsp; &nbsp; <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_FAILONERROR<span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_FOLLOWLOCATION<span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">// allow redirects</span><br />
&nbsp; &nbsp; <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_RETURNTRANSFER<span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// return into a variable</span><br />
&nbsp; &nbsp; <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_TIMEOUT<span style="color: #339933;">,</span> <span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// times out after 4s</span><br />
&nbsp; &nbsp; <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_POST<span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// set POST method</span><br />
&nbsp; &nbsp; <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_POSTFIELDS<span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// add POST fields</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// run the whole process</span><br />
&nbsp; &nbsp; <span style="color: #990000;">curl_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$result</span><span style="color: #339933;">;</span> <br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// This function stores the HTML into memcache and update if its older than 3 mins</span><br />
<span style="color: #000000; font-weight: bold;">function</span> MemCacheFunction<span style="color: #009900;">&#40;</span><span style="color: #000088;">$function_name</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$memcache</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Memcache<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$memcache</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">connect</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'localhost'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">11211</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Could not connect&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000088;">$memcache_key</span> <span style="color: #339933;">=</span> <span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'sometextkey'</span><span style="color: #339933;">.</span><span style="color: #000088;">$function_name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$memcache_result</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$memcache</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$memcache_key</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//echo &quot;It Worked!&quot;;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$memcache_result</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> &nbsp; <br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//echo &quot;Couldn't Find Key: &quot;.$memcache_key;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$ret</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$ret</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$function_name</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$memcache</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$memcache_key</span><span style="color: #339933;">,</span> <span style="color: #000088;">$ret</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">180</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$ret</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// A simple condition determines whether to load page from Memcache or process the dynamic page </span><br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_COOKIE</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;loggedin&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;yes&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">include</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;index_dynamic.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">echo</span> MemCacheFunction<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ScrapePage&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<p>Typically usage would be for heavy traffic pages such as the homepage of a website.  You simply rename your index.php page to something like index_dynamic.php and then use the code below as your original index page.  In the code you will have to specify the dynamic page you want to cache and at the bottom a condition to whether load from memcache or the actual page.  This part is important.  For example, you would only want to show the cache for general traffic such as spiders and visitors who are not logged in.</p>
<p>If you need a good breakdown on installing and configuring Memcached, <a href="http://jungleg.com/2009/04/15/installing-and-configuring-memcached-for-php-in-fedora/">check this out</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.polibou.com/2010/02/26/simple-and-clean-memcached/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ntsysv &#8211; Linux Service Manager</title>
		<link>http://www.polibou.com/2010/02/02/ntsysv-linux-service-manager/</link>
		<comments>http://www.polibou.com/2010/02/02/ntsysv-linux-service-manager/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 22:43:22 +0000</pubDate>
		<dc:creator>Poli</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ntsysv]]></category>
		<category><![CDATA[Runtime]]></category>
		<category><![CDATA[Service]]></category>

		<guid isPermaLink="false">http://www.polibou.com/?p=359</guid>
		<description><![CDATA[I was configuring some linux boxes today and discovered the ntsysv command. This is a great command to see what services are loaded during startup. It pops up a simple GUI where you can enable and and disable services. Just run it at the terminal.]]></description>
			<content:encoded><![CDATA[<p>I was configuring some linux boxes today and discovered the ntsysv command.  This is a great command to see what services are loaded during startup.  It pops up a simple GUI where you can enable and and disable services.  Just run it at the terminal.</p>
<p><a href="http://www.polibou.com/wp-content/uploads/2010/02/ntsysv.gif" rel="lightbox[359]"><img src="http://www.polibou.com/wp-content/uploads/2010/02/ntsysv-300x212.gif" alt="" title="ntsysv" width="300" height="212" class="aligncenter size-medium wp-image-361" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.polibou.com/2010/02/02/ntsysv-linux-service-manager/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Symbolic Links</title>
		<link>http://www.polibou.com/2009/06/11/using-symbolic-links/</link>
		<comments>http://www.polibou.com/2009/06/11/using-symbolic-links/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 18:26:20 +0000</pubDate>
		<dc:creator>Poli</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[paths]]></category>
		<category><![CDATA[symbolic link]]></category>

		<guid isPermaLink="false">http://www.polibou.com/?p=288</guid>
		<description><![CDATA[I can never seem to remember all these Linux commands. I just had to look up how to create a symbolic link. Here it is for reference: ln -s /path/of/original/file /path/of/linked/file This will point a file or directory to another file or directory. Why would you want to do this? Well, on our web server [...]]]></description>
			<content:encoded><![CDATA[<p>I can never seem to remember all these Linux commands.  I just had to look up how to create a symbolic link.  Here it is for reference:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ln -s /path/of/original/file /path/of/linked/file</div></div>
<p>This will point a file or directory to another file or directory.  Why would you want to do this?  Well, on our web server we have multiple websites and they share a directory of common include files.  So instead of using the server path to get the files, we can just link the local include directory to the global include directory and access the files relatively.  It just makes things cleaner.</p>
<p>Here&#8217;s how to unlink a symbolic link.  Remember not to use a trailing slash.  rm will also work.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">unlink /path/of/symbolic/link<br />
rm /path/of/symbolic/link</div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.polibou.com/2009/06/11/using-symbolic-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kill A Running MySQL Query</title>
		<link>http://www.polibou.com/2009/06/01/kill-a-running-mysql-query/</link>
		<comments>http://www.polibou.com/2009/06/01/kill-a-running-mysql-query/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 22:40:26 +0000</pubDate>
		<dc:creator>Poli</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Kill]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Query]]></category>
		<category><![CDATA[Runtime]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.polibou.com/?p=183</guid>
		<description><![CDATA[Somehow you ended up with a query that is taking too long to execute and you need to kill it. First, I&#8217;d advise against using this in an UPDATE or INSERT command as I don&#8217;t know what will happen. Most likely it&#8217;ll will just roll back the DB. For a complex SELECT that just got [...]]]></description>
			<content:encoded><![CDATA[<p>Somehow you ended up with a query that is taking too long to execute and you need to kill it.  First, I&#8217;d advise against using this in an UPDATE or INSERT command as I don&#8217;t know what will happen.  Most likely it&#8217;ll will just roll back the DB.   For a complex SELECT that just got out of hand, this should be safe.</p>
<ol>
<li>Log into MySQL from your Linux console.</li>
<li>Show your running queries and find the ID with a long run time.  I prefer to check this first in mytop to get a real time view and to see the actual query.</li>
<li>Identify the transaction ID.</li>
<li>Kill it.</li>
<li>Exit and you&#8217;re done.</li>
</ol>
<p> <strong> </strong></p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[root@server /]# mysql -u root -p<br />
Enter password: &quot;your password&quot;<br />
<br />
mysql&gt; <br />
mysql&gt; &nbsp;show processlist;<br />
+---------+---------+-------------------+-----------+---------+------+-------+------------------+<br />
| Id &nbsp; &nbsp; &nbsp;| User &nbsp; &nbsp;| Host &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| db &nbsp; &nbsp; &nbsp; &nbsp;| Command | Time | State | Info &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br />
+---------+---------+-------------------+-----------+---------+------+-------+------------------+<br />
| 7614534 | root &nbsp; &nbsp;| localhost &nbsp; &nbsp; &nbsp; &nbsp; | NULL &nbsp; &nbsp; &nbsp;| Query &nbsp; | &nbsp; &nbsp;0 | NULL &nbsp;| SHOW Processlist |<br />
| 7614557 | root &nbsp; &nbsp;| 10.10.0.111:53626 | myDB &nbsp; &nbsp; &nbsp;| Query &nbsp; | &nbsp;9999| &nbsp; &nbsp; &nbsp; | NULL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br />
| 7614641 | root &nbsp; &nbsp;| 10.10.0.111:53721 | myDB &nbsp; &nbsp; &nbsp;| Sleep &nbsp; | &nbsp; &nbsp;5 | &nbsp; &nbsp; &nbsp; | NULL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br />
+---------+---------+-------------------+-----------+---------+------+-------+------------------+<br />
3 rows in set (0.02 sec)<br />
<br />
mysql&gt; kill 7614557;<br />
Query OK, 0 rows affected (0.00 sec)<br />
<br />
mysql&gt; exit<br />
Bye<br />
[root@server /]#</div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.polibou.com/2009/06/01/kill-a-running-mysql-query/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating High Quality Stock Chart With Flash</title>
		<link>http://www.polibou.com/2009/03/20/creating-high-quality-historical-stock-chart-with-flash/</link>
		<comments>http://www.polibou.com/2009/03/20/creating-high-quality-historical-stock-chart-with-flash/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 11:10:27 +0000</pubDate>
		<dc:creator>Poli</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[amCharts]]></category>
		<category><![CDATA[Charts]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Stocks]]></category>
		<category><![CDATA[Yahoo]]></category>

		<guid isPermaLink="false">http://polibou.com/?p=48</guid>
		<description><![CDATA[Working at WallSt I&#8217;ve delt with numerous data providers for our financial information. Data feeds are not cheap especially when you have to deal with individual exchange fees. Often times when selecting a provider you are limited by their charts and graphs. You can usually get ticker information in XML, but graphical data is usually [...]]]></description>
			<content:encoded><![CDATA[<p><iframe frameborder="0" width="570" height="380" src="http://polibou.com/post-content/flashchart/index.php" ></iframe></p>
<p>Working at WallSt I&#8217;ve delt with numerous data providers for our financial information.  Data feeds are not cheap especially when you have to deal with individual exchange fees.  Often times when selecting a provider you are limited by their charts and graphs.  You can usually get ticker information in XML, but graphical data is usually restricted to modules or API calls for an image.</p>
<p>One solution is to obtain a historical feed and develop a charting system, but this can be expensive and time consuming.  So how can we do this cost effectively and quickly?</p>
<p>Thank you Yahoo.  Yahoo provides historical quotes in spreadsheet (CSV &#8211; comma separated values) format which can be easily parsed.  I have no idea how they can provide this freely.  But I won&#8217;t question it <img src='http://www.polibou.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .  Looking at this service, I see that it has changed many times and there are / has been various methods for obtaining their CSV data.  So that&#8217;s a word for caution should anything change in the future.</p>
<p><strong>Step 1. How to obtain historical quotes:</strong></p>
<p>You can get the data by using the URL below.</p>
<p>http://ichart.finance.yahoo.com/table.csv?s=YHOO</p>
<p>This will provide you with all the EOD price of a company since its IPO.  The method above uses the CSV output on a webpage.  Yahoo has other URLs that output a downloadable files.  Those work also and can be parsed just as easily.</p>
<p>If you want to be able to select a specific date range you can do it in this format:</p>
<p>http://ichart.finance.yahoo.com/table.csv?s=YHOO&#038;a=0&#038;b=1&#038;c=2008&#038;d=11&#038;e=31&#038;f=2008&#038;g=d</p>
<p>Here I&#8217;m selecting data just for the year 2008 from 01/01/08 &#8211; 12/31/08.</p>
<p>Let&#8217;s break down the URL string and take a look at each parameter.</p>
<p>s = The requested ticker symbol.<br />
a = The starting month in two digit format.  (ie: &#8220;00&#8243; = January, &#8220;01&#8243; = February, etc.)<br />
b = The starting day. (ie: 1, 2, &#8230; 30, 31)<br />
c = The starting year in four digit format (ie: &#8220;2000&#8243;)<br />
d = The ending month in two digit format.  (ie: &#8220;00&#8243; = January, &#8220;01&#8243; = February, etc.)<br />
e = The ending day. (ie: 1, 2, &#8230; 30, 31)<br />
f = The ending year in four digit format (ie: &#8220;2000&#8243;)<br />
g = The data interval (ie: &#8220;d&#8221; = daily, &#8220;w&#8221; = weekly, &#8216;m&#8217; = monthly. The default is &#8216;daily&#8217; if you ignore this parameter.)</p>
<p><strong>Step 2.  Retrieving and Parsing the Data</strong></p>
<div class="codecolorer-container php blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?</span><br />
<span style="color: #666666; font-style: italic;">////////////////////////////////////////////////////////////////</span><br />
<span style="color: #666666; font-style: italic;">// data.php</span><br />
<span style="color: #666666; font-style: italic;">//</span><br />
<span style="color: #666666; font-style: italic;">// This file will dynamiclly output the CSV locally on your &nbsp;</span><br />
<span style="color: #666666; font-style: italic;">// server to overcome the security restriction in Flash .</span><br />
<span style="color: #666666; font-style: italic;">////////////////////////////////////////////////////////////////</span><br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> ScrapePage <span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$ch</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_init</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_HEADER<span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_POST<span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_RETURNTRANSFER<span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$fileoutput</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; <span style="color: #990000;">curl_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$fileoutput</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000088;">$symbol</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;symbol&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> ScrapePage<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://ichart.finance.yahoo.com/table.csv?s=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$symbol</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Date,Open,High,Low,Close,Volume,Adj Close<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$output</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$output</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<p>I&#8217;m using a simple curl function to get the page. Fopen, wget or whatever your weapon of choice should work too.  Since we only need the data, I&#8217;m removing the column header with a str_replace.  The graphing method I will use will take the data in this format so there will be no parsing or manipulating invovlved.  That&#8217;s all we need to do for this part.</p>
<p><strong>Step 3.  Graphing the Data</strong></p>
<p>Building a full fledge charting system in Flash is quite a bit of work.  Adobe has simplified this with Flex, which has built in charting support.  It&#8217;s a great way to go if you have the knowledge and resources to build some very customized.  But I&#8217;m gonna take this a few more steps down easy street and use a pre compiled flash suite to do the charting.</p>
<p>I will be using charts from amCharts.com.  Not just because its free and easy, these are some really well made charts and they look really good.  They have a variety of chart types.</p>
<p>Their stock suite can be downloaded here: http://www.amcharts.com/download</p>
<p>I will be using the event chart type in this example.  I picked this one because it is the most familiar layout for stocks.  It has the standard line chart but also includes the ability to add events.  Which for a stock chart, you can labels for news, splits, dividends, etc.</p>
<p>From the download we will need the following files:<br />
   /amstock/amstock.swf &#8211; The flash file that displays the graph.<br />
   /amstock/swfobject.js &#8211; Standard flash embed file.<br />
   /examples/events/amstock/amstock_setting.xml &#8211; The settings file with output parameters</p>
<p>   data.php &#8211; This is the file we created above.</p>
<p>Once you have all the files, place them in the same directory.  Now we&#8217;ll edit the files.</p>
<p>First we&#8217;ll modify the amstock_setting.xml file.</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br />101<br />102<br />103<br />104<br />105<br />106<br />107<br />108<br />109<br />110<br />111<br />112<br />113<br />114<br />115<br />116<br />117<br />118<br />119<br />120<br />121<br />122<br />123<br />124<br />125<br />126<br />127<br />128<br />129<br />130<br />131<br />132<br />133<br />134<br />135<br />136<br />137<br />138<br />139<br />140<br />141<br />142<br />143<br />144<br />145<br />146<br />147<br />148<br />149<br />150<br />151<br />152<br />153<br />154<br />155<br />156<br />157<br />158<br />159<br />160<br />161<br />162<br />163<br />164<br />165<br />166<br />167<br />168<br />169<br />170<br />171<br />172<br />173<br />174<br />175<br />176<br />177<br />178<br />179<br />180<br />181<br />182<br />183<br />184<br />185<br />186<br />187<br />188<br />189<br />190<br />191<br />192<br />193<br />194<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;php</span></span><br />
<span style="color: #009900;">////////////////////////////////////////////////////////////////</span><br />
<span style="color: #009900;">// settings.php</span><br />
<span style="color: #009900;">// </span><br />
<span style="color: #009900;">// This file is based amstock_setting.xml <span style="color: #66cc66;">&#40;</span>event chart type<span style="color: #66cc66;">&#41;</span>.</span><br />
<span style="color: #009900;">// I<span style="color: #ff0000;">'ve done a bit of editing to clean up the number display</span><br />
<span style="color: #009900;">// and added some sample events.</span><br />
<span style="color: #009900;">//</span><br />
<span style="color: #009900;">// I'</span>ve also converted it to php so we can dynamiclly pass </span><br />
<span style="color: #009900;">// the ticker symbol.</span><br />
<span style="color: #009900;">////////////////////////////////////////////////////////////////</span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> echo <span style="color: #ff0000;">'&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span></span>'; ?&gt;<br />
<span style="color: #808080; font-style: italic;">&lt;!-- Only the settings with values not equal to defaults are in this file. If you want to see the</span><br />
<span style="color: #808080; font-style: italic;">full list of available settings, check the amstock_settings.xml file in the amstock folder. --&gt;</span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;settings<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;margins<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/margins<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;redraw<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/redraw<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;number_format<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;separator<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>,<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/separator<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;decimal_separator<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/decimal_separator<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;thousand_separator<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>,<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/thousand_separator<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;letters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;letter</span> <span style="color: #000066;">number</span>=<span style="color: #ff0000;">&quot;1000&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>K<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/letter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;letter</span> <span style="color: #000066;">number</span>=<span style="color: #ff0000;">&quot;1000000&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>M<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/letter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;letter</span> <span style="color: #000066;">number</span>=<span style="color: #ff0000;">&quot;1000000000&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>B<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/letter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/letters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/number_format<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;data_sets<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;data_set</span> <span style="color: #000066;">did</span>=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>East Stock<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;short<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>ES<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/short<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;color<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>7f8da9<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/color<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;file_name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/post-content/flashchart/data.php?symbol=<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> echo $_POST<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;symbol&quot;</span><span style="color: #66cc66;">&#93;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/file_name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;csv<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;reverse<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/reverse<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;date_format<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>YYYY-MM-DD<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/date_format<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;separator<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>,<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/separator<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;decimal_separator<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/decimal_separator<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;columns<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>date<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/column<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>open<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/column<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>high<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/column<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>low<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/column<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>close<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/column<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>volume<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/column<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>adj close<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/column<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/columns<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/csv<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;events<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;event<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2007-12-25<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;letter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>A<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/letter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><span style="color: #339933;">&lt;![CDATA[Christmas Day]]&gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/event<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;event<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2008-01-01<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;letter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>B<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/letter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><span style="color: #339933;">&lt;![CDATA[New Years Day]]&gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/event<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;event<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2008-12-25<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;letter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>C<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/letter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><span style="color: #339933;">&lt;![CDATA[Christmas Day]]&gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/event<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;event<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2009-01-01<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;letter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>D<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/letter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><span style="color: #339933;">&lt;![CDATA[New Years Day]]&gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/event<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;event<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;chart_id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>second<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/chart_id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;graph_id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>volume<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/graph_id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2004-05-12<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bullet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>pin<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bullet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><span style="color: #339933;">&lt;![CDATA[Split 2:1]]&gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;axis<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/axis<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;size<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>12<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/size<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/event<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;event<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;chart_id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>second<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/chart_id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;graph_id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>volume<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/graph_id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2009-03-19<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bullet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>pin<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bullet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><span style="color: #339933;">&lt;![CDATA[Fake Dividends]]&gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;axis<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/axis<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;size<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>12<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/size<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/event<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/events<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/data_set<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/data_sets<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;charts<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;chart</span> <span style="color: #000066;">cid</span>=<span style="color: #ff0000;">&quot;first&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;height<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>60<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/height<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;border_color<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>#CCCCCC<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/border_color<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;border_alpha<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>100<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/border_alpha<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;values<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;x<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bg_color<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>EEEEEE<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bg_color<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/x<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/values<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;legend<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show_date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/show_date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/legend<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column_width<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>100<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/column_width<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;events<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;color<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>fac622<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/color<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/events<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;graphs<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;graph</span> <span style="color: #000066;">gid</span>=<span style="color: #ff0000;">&quot;close&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;data_sources<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;close<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>close<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/close<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;high<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>high<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/high<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;low<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>low<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/low<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/data_sources<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bullet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>round_outline<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bullet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;legend<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;date</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #339933;">&lt;![CDATA[&lt;b&gt;Price:&lt;/b&gt; {close} &nbsp; &nbsp;&lt;b&gt;High: &lt;/b&gt;{high} &nbsp; &lt;b&gt;Low: &lt;/b&gt;{low}]]&gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;period</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #339933;">&lt;![CDATA[&lt;b&gt;Price:&lt;/b&gt; {close} &nbsp; &lt;b&gt;High: &lt;/b&gt;{high} &nbsp; &lt;b&gt;Low: &lt;/b&gt;{low}]]&gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/period<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/legend<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/graph<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/graphs<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/chart<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;chart</span> <span style="color: #000066;">cid</span>=<span style="color: #ff0000;">&quot;second&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;height<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>30<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/height<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;border_color<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>#CCCCCC<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/border_color<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;border_alpha<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>100<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/border_alpha<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;grid<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;y_left<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;approx_count<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>3<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/approx_count<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/y_left<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/grid<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;values<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;x<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>false<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/x<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/values<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;legend<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;show_date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/show_date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/legend<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column_width<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/column_width<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;events<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;color<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>db4c3c<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/color<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/events<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;graphs<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;graph</span> <span style="color: #000066;">gid</span>=<span style="color: #ff0000;">&quot;volume&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>column<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;data_sources<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;close<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>volume<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/close<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/data_sources<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;period_value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>average<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/period_value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;alpha<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>100<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/alpha<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fill_alpha<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fill_alpha<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;legend<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;date</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #339933;">&lt;![CDATA[&lt;b&gt;Volume:&lt;/b&gt; {close}]]&gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;period</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #339933;">&lt;![CDATA[&lt;b&gt;Volume:&lt;/b&gt; {close}]]&gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/period<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/legend<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/graph<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/graphs<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/chart<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> &nbsp; &nbsp;<br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/charts<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;date_formats<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;events<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>DD month YYYY<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/events<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/date_formats<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;data_set_selector<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>false<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/data_set_selector<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;period_selector<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;periods<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;period</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;DD&quot;</span> <span style="color: #000066;">count</span>=<span style="color: #ff0000;">&quot;10&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>10D<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/period<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;period</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;MM&quot;</span> <span style="color: #000066;">count</span>=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>1M<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/period<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;period</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;MM&quot;</span> <span style="color: #000066;">count</span>=<span style="color: #ff0000;">&quot;3&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>3M<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/period<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;period</span> <span style="color: #000066;">selected</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;YYYY&quot;</span> <span style="color: #000066;">count</span>=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>1Y<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/period<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;period</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;YTD&quot;</span> <span style="color: #000066;">count</span>=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>YTD<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/period<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;period</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;MAX&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>MAX<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/period<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/periods<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;periods_title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Zoom:<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/periods_title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;custom_period_title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Custom period:<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/custom_period_title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> <br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/period_selector<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;header<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>false<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/header<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;scroller<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;graph_data_source<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>close<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/graph_data_source<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;resize_button_style<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>dragger<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/resize_button_style<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;playback<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/enabled<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;speed<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>3<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/speed<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/playback<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/scroller<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/settings<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
<p>What I did here was cleaned up some of the XML and added some sample events. I&#8217;ve also changed the extension to php since we will be dynamically passing the ticker symbol to the data.php file.</p>
<p>Next we put everything together to display the graph:</p>
<div class="codecolorer-container html4strict blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;?</span><br />
<span style="color: #009900;"><span style="color: #66cc66;">////////////////////////////////////////////////////////////////</span></span><br />
<span style="color: #009900;"><span style="color: #66cc66;">//</span> index.php</span><br />
<span style="color: #009900;"><span style="color: #66cc66;">//</span></span><br />
<span style="color: #009900;"><span style="color: #66cc66;">//</span> Displays the graph and takes a requested symbol</span><br />
<span style="color: #009900;"><span style="color: #66cc66;">////////////////////////////////////////////////////////////////</span></span><br />
<span style="color: #009900;">?&gt;</span><br />
<br />
<span style="color: #009900;">&lt;?php</span><br />
<span style="color: #009900;">$symbol <span style="color: #66cc66;">=</span> $_REQUEST<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;symbol&quot;</span><span style="color: #66cc66;">&#93;</span>;</span><br />
<span style="color: #009900;">if <span style="color: #66cc66;">&#40;</span>!$symbol<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span><br />
<span style="color: #009900;">&nbsp; &nbsp; <span style="color: #66cc66;">//</span> if no symbol is inputted defaults to yahoo</span><br />
<span style="color: #009900;">&nbsp; &nbsp; $symbol <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;YHOO&quot;</span>;</span><br />
<span style="color: #009900;"><span style="color: #66cc66;">&#125;</span></span><br />
<span style="color: #009900;">?&gt;</span><br />
<br />
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">http-equiv</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Content-Type&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/html; charset=UTF-8&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>Flash Chart<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span> <span style="color: #000066;">bgcolor</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#FFFFFF&quot;</span>&gt;</span><br />
<span style="color: #808080; font-style: italic;">&lt;!-- saved from url=(0013)about:internet --&gt;</span><br />
<span style="color: #808080; font-style: italic;">&lt;!-- amstock script--&gt;</span><br />
&nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;swfobject.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;flashcontent&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">strong</span>&gt;</span>You need to upgrade your Flash Player<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">strong</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; // <span style="color: #009900;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span>&nbsp; &nbsp; &nbsp; &nbsp; </span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; var so <span style="color: #66cc66;">=</span> new SWFObject<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;amstock.swf&quot;</span>, <span style="color: #ff0000;">&quot;amstock&quot;</span>, <span style="color: #ff0000;">&quot;550&quot;</span>, <span style="color: #ff0000;">&quot;300&quot;</span>, <span style="color: #ff0000;">&quot;8&quot;</span>, <span style="color: #ff0000;">&quot;#FFFFFF&quot;</span><span style="color: #66cc66;">&#41;</span>;</span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; so.addVariable<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;path&quot;</span>, <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span>;</span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; so.addVariable<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;settings_file&quot;</span>, encodeURIComponent<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;settings.php?symbol=&lt;?php echo $symbol; ?&gt;</span></span>&quot;));<br />
&nbsp; &nbsp; &nbsp; &nbsp; so.write(&quot;flashcontent&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; // ]]&gt;<br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span><br />
<span style="color: #808080; font-style: italic;">&lt;!-- end of amstock script --&gt;</span><br />
<br />
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span>&gt;</span><br />
<br />
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">form</span> <span style="color: #000066;">method</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;post&quot;</span> <span style="color: #000066;">action</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;</span></span>&quot;&gt;<br />
Enter Symbol: <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;symbol&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;?php echo $symbol; ?&gt;</span></span>&quot; /&gt;<br />
<span style="color: #ddbb00;">&amp;nbsp;</span><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Go&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></div></td></tr></tbody></table></div>
<p>The form passes our ticker symbol to the setting file which will dynamiclly call the data file with the appropriate symbol.  </p>
<p>So there you have it&#8230;a nice looking flash graph with historical data.  I&#8217;ve left out some error checking for the bare minimum to get this done.  You can use this technique for other series data.  There is one hiccup to all this.  It lacks intraday data.  That&#8217;s pretty vital information when dealing with stock price.  However its just a matter of obtaining a feed.  Unfortunately, I haven&#8217;t been able to find a free source for this data.  This would surely seal the deal in creating a no cost flash stock chart that would rival Yahoo and Google.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.polibou.com/2009/03/20/creating-high-quality-historical-stock-chart-with-flash/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Using IP address to Geo-locate</title>
		<link>http://www.polibou.com/2009/03/16/using-ip-address-to-geo-locate/</link>
		<comments>http://www.polibou.com/2009/03/16/using-ip-address-to-geo-locate/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 23:42:56 +0000</pubDate>
		<dc:creator>Poli</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[GeoCode]]></category>
		<category><![CDATA[GeoIP]]></category>
		<category><![CDATA[GeoLocate]]></category>
		<category><![CDATA[GeoTargeting]]></category>
		<category><![CDATA[IP]]></category>

		<guid isPermaLink="false">http://polibou.com/?p=31</guid>
		<description><![CDATA[The topic of geo-targeting content has come up from time to time here at work but I&#8217;ve never taken the time to really implement it. So today I&#8217;ve been searching around for a solution and notice that it usually entails purchasing an IP database and a subscription for updates. The idea of paying for something [...]]]></description>
			<content:encoded><![CDATA[<p>The topic of geo-targeting content has come up from time to time here at work but I&#8217;ve never taken the time to really implement it.  So today I&#8217;ve been searching around for a solution and notice that it usually entails purchasing an IP database and a subscription for updates.</p>
<p>The idea of paying for something before testing out the implementation never sits well for me.  So I was surprise to find <a href="http://www.hostip.info">www.hostip.info</a> Community GeoTarget IP Project.  Much like open source, everyone contributes to keep the database updated.  Best of all, the API queries are free.</p>
<p>Here&#8217;s a sample of the API for a simple GET:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">http://api.hostip.info/country.php<br />
&nbsp; US<br />
<br />
http://api.hostip.info/get_html.php?ip=12.215.42.19<br />
&nbsp; Country: UNITED STATES (US)<br />
&nbsp; City: Sugar Grove, IL<br />
<br />
http://api.hostip.info/get_html.php?ip=12.215.42.19&amp;position=true<br />
&nbsp; Country: UNITED STATES (US)<br />
&nbsp; City: Sugar Grove, IL<br />
&nbsp; Latitude: 41.7696<br />
&nbsp; Longitude: -88.4588<br />
<br />
http://api.hostip.info/?ip=12.215.42.19<br />
&nbsp; [use the URL above for an example - XML too long to paste below]</div></div>
<p>Use the API with a wget or a curl operation and you&#8217;re set.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.polibou.com/2009/03/16/using-ip-address-to-geo-locate/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
