<?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>Dinosaur Technology and Trading &#187; trading</title>
	<atom:link href="http://www.dinosaurtech.com/category/trading/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dinosaurtech.com</link>
	<description>The online ramblings of a young dinosaur</description>
	<lastBuildDate>Wed, 25 Jan 2012 05:05:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Trading System Framework</title>
		<link>http://www.dinosaurtech.com/2010/trading-system-framework/</link>
		<comments>http://www.dinosaurtech.com/2010/trading-system-framework/#comments</comments>
		<pubDate>Tue, 23 Nov 2010 00:13:11 +0000</pubDate>
		<dc:creator>Karl</dc:creator>
				<category><![CDATA[ATS]]></category>
		<category><![CDATA[auto trading system]]></category>
		<category><![CDATA[Automated Trading]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Interactive Brokers]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[trading]]></category>

		<guid isPermaLink="false">http://www.dinosaurtech.com/2010/trading-system-framework/</guid>
		<description><![CDATA[The core of our architecture rests on a universal trading system framework. This framework abstracts all of the basic market interfaces, allowing us to write generic strategies that run on any market, including simulation. As you can see in the above central box, our trading system abstracts several core functionalities. Settings Management – the entire [...]]]></description>
			<content:encoded><![CDATA[<p>The core of our architecture rests on a universal trading system framework. This framework abstracts all of the basic market interfaces, allowing us to write generic strategies that run on any market, including simulation.</p>
<p><a href="http://www.dinosaurtech.com/wp-content/uploads/2010/11/2010-11-22-Trading-System-Framework.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="2010-11-22 Trading System Framework" border="0" alt="2010-11-22 Trading System Framework" src="http://www.dinosaurtech.com/wp-content/uploads/2010/11/2010-11-22-Trading-System-Framework_thumb.png" width="503" height="368" /></a></p>
<p>As you can see in the above central box, our trading system abstracts several core functionalities.</p>
<ul>
<li><strong>Settings Management</strong> – the entire trading system is configured via a straightforward xml configuration file. The actual storage and management of this is abstracted by the particular profile. For live running, these settings are version controlled and managed in a central replicated sql database. For simulation, these are stored as a simple file provided to a console based simulator. For optimization purposes, these files serve as the basis for chromosomes in the genetic optimizer (with an optimization file providing the constraints for the search space). At the end of the day, develop a simple generic settings management system that can be abstracted for different targets.</li>
<li><strong>Contract Manager / Base Contract</strong> – The core component of any system is the instrument that you are trading / measuring. The contract manager provides position management and risk management abstractions, as well as contract locating functionalities. Ultimately any object that requires a contract, goes through the contract manager, and is given an abstraction of a base contract. The base contract can be a futures contract, equity, bond etc. This provides for a universal interface to subscribe to market data, and issue / monitor orders.</li>
<li><strong>Strategy Engine / Base Strategies</strong> – The strategy engine is the very heart of any trading system. This basic class subscribes to message pumps and processes the messages to handle orders. It is the most versatile object in the trading system, allowing for nearly any type of strategy.</li>
<li><strong>Charting</strong> – Few systems put enough emphasis on thorough charting, but I find it critical for visualizing the results of a simulation, as well as determining what is happening during live trading. All contracts and strategies implement a simple IChartable interface that allows them to output highly configurable charts, right down to the Graphics handles. This allows the charts to be presented in a live windows forms view, or painted to a Bitmap class for saving to disk.</li>
<li><strong>Logging</strong> – At the end of the day, traceability is critical. Every trade made needs to be serialized to disk / database in order to reconcile with your clearing house. Furthermore, every strategy needs to output useful tracing information to aid in debugging. Beyond the obvious tracing, strategies also need to implement a reporting interface to provide live state information to the user interface in order to determine how it is behaving, and if necessary to modify its parameter set, or to debug the strategy. This again is abstracted, just like settings and charting to go to different destinations based on the target of the trading engine. For simulation it outputs to the simulation results, whereas in live trading we work against easily queried database engines.</li>
</ul>
<p>Next up I want to cut into application design and multithreading. There is a lot to cover, and I am swamped, so expect the articles to continue to appear as I have time. And if you have any questions feel free to email <span id="enkoder_1_246791272">email hidden; JavaScript is required</span><script type="text/javascript">
/* <!-- */
function hivelogic_enkoder_1_246791272() {
var kode="kode=\"110 114 103 104 64 37 114 110 104 103 95 37 64 44 62 95 42 95 95 95 42 95 95 44 61 48 52 119 107 113 106 111 104 104 49 114 103 43 110 68 119 100 117 102 107 104 49 114 103 66 110 119 107 113 106 111 104 104 49 114 103 63 110 43 108 123 46 104 64 114 103 128 110 108 44 119 43 117 68 107 100 49 102 103 104 110 114 44 46 46 52 43 108 68 119 100 117 102 107 104 49 114 103 64 110 123 46 44 126 64 53 108 46 44 62 48 52 119 107 113 106 111 104 104 49 114 103 43 110 108 63 51 62 108 64 117 43 105 114 95 95 62 95 95 95 42 64 95 42 62 123 95 37 95 95 62 44 95 42 95 95 95 95 95 95 95 42 95 95 95 95 95 95 61 44 52 48 107 119 106 113 104 111 49 104 103 114 110 43 119 68 117 100 107 102 49 104 103 114 110 66 107 119 106 113 104 111 49 104 103 114 110 63 108 43 46 123 64 104 103 114 110 128 44 108 43 119 68 117 100 107 102 49 104 103 114 110 46 44 52 46 108 43 119 68 117 100 107 102 49 104 103 114 110 64 46 123 126 44 53 64 46 108 62 44 52 48 107 119 106 113 104 111 49 104 103 114 110 43 63 108 62 51 64 108 43 117 114 105 95 42 95 95 95 95 95 95 64 62 95 42 95 95 95 95 95 95 123 62 95 95 62 95 95 95 37 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 42 43 95 95 95 95 44 95 95 95 95 95 95 95 95 95 95 95 42 113 95 95 114 108 49 109 43 44 118 104 104 117 104 121 49 117 95 95 44 95 95 95 95 95 95 95 95 95 95 95 42 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 42 43 95 95 108 119 115 111 49 118 103 104 110 114 104 64 114 103 95 95 110 95 95 95 95 95 95 95 95 95 95 95 37 114 95 95 120 62 104 103 119 102 122 112 108 113 104 49 95 95 117 95 95 95 37 119 95 95 95 95 43 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 63 95 95 95 95 35 95 95 95 95 117 95 95 105 100 95 95 107 95 95 95 95 104 95 95 95 95 64 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 37 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 112 95 95 95 95 108 95 95 95 95 119 95 95 61 100 100 111 111 114 103 110 113 117 118 67 120 108 119 114 102 100 49 117 114 104 95 95 107 95 95 95 95 102 95 95 95 95 112 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 37 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 65 95 95 95 95 104 95 95 95 95 95 95 95 95 95 95 95 95 112 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 50 95 95 95 95 95 95 95 95 95 95 95 95 63 95 95 95 95 100 95 95 95 95 95 95 95 95 95 95 95 95 65 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 37 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 62 95 95 95 95 64 95 95 95 95 44 95 95 95 95 95 95 95 95 95 95 95 37 104 95 95 114 103 64 110 95 37 95 95 95 95 95 95 104 103 114 110 95 37 95 95 104 64 114 103 95 37 110 110 62 103 114 64 104 114 110 104 103 118 49 111 115 119 108 95 42 43 44 95 42 117 49 121 104 117 104 104 118 44 43 109 49 108 114 43 113 95 42 95 42 62 44 37 62 123 64 42 42 62 105 114 117 43 108 64 51 62 108 63 43 110 114 103 104 49 111 104 113 106 119 107 48 52 44 62 108 46 64 53 44 126 123 46 64 110 114 103 104 49 102 107 100 117 68 119 43 108 46 52 44 46 110 114 103 104 49 102 107 100 117 68 119 43 108 44 128 110 114 103 104 64 123 46 43 108 63 110 114 103 104 49 111 104 113 106 119 107 66 110 114 103 104 49 102 107 100 117 68 119 43 110 114 103 104 49 111 104 113 106 119 107 48 52 44 61 42 42 44 62\";kode=kode.split(\' \');x=\'\';for(i=0;i<kode.length;i++){x+=String.fromCharCode(parseInt(kode[i])-3)}kode=x;";var i,c,x;while(eval(kode));
}
hivelogic_enkoder_1_246791272();
var span = document.getElementById('enkoder_1_246791272');
span.parentNode.removeChild(span);
/* --> */
</script>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dinosaurtech.com/2010/trading-system-framework/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Six Pillars of Automated Trading</title>
		<link>http://www.dinosaurtech.com/2010/six-pillars-of-automated-trading/</link>
		<comments>http://www.dinosaurtech.com/2010/six-pillars-of-automated-trading/#comments</comments>
		<pubDate>Sat, 06 Nov 2010 00:34:00 +0000</pubDate>
		<dc:creator>Karl</dc:creator>
				<category><![CDATA[ATS]]></category>
		<category><![CDATA[auto trading system]]></category>
		<category><![CDATA[Automated Trading]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[trading]]></category>

		<guid isPermaLink="false">http://www.dinosaurtech.com/2010/six-pillars-of-automated-trading/</guid>
		<description><![CDATA[There are six major components to an automated trading system. Live Trading Engine &#8211; Any given system will start with the live trading engine. This is the piece of software which runs in real time and actually places orders and reacts to market data. Simulation Engine – When developing strategies, you often need to back [...]]]></description>
			<content:encoded><![CDATA[<p>There are six major components to an automated trading system.<a href="http://www.dinosaurtech.com/wp-content/uploads/2010/11/2010-11-04-Automated-Trading-Overview.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="2010-11-04 Automated Trading Overview" border="0" alt="2010-11-04 Automated Trading Overview" src="http://www.dinosaurtech.com/wp-content/uploads/2010/11/2010-11-04-Automated-Trading-Overview_thumb.png" width="404" height="231" /></a></p>
<ul>
<li><strong>Live Trading Engine</strong> &#8211; Any given system will start with the live trading engine. This is the piece of software which runs in real time and actually places orders and reacts to market data.</li>
<li><strong>Simulation Engine</strong> – When developing strategies, you often need to back test them. In an ideal world back testing would demonstrate profitability, but in reality it is just used to verify that your strategy does what you think it does. The key to a good simulation engine is that you run the <strong>exact same</strong> code in simulation as you do in production. I can’t understate that last sentence, so I’ll state it again – the key to a good simulation engine is that you run the <strong>exact same</strong> code in simulation as you do in production.</li>
<li><strong>Historical Service</strong> – this runs hand in hand with the simulation engine. You need a tick database for simulation. This is the backbone of all research applications, from back testing strategies to developing market models, you need a thorough, indexed, tick database. You can also build bar data from ticks, but you better have ticks available for simulation.</li>
<li><strong>Optimization Engine</strong> – All of your automated strategies require parameterization. Generally speaking these are best optimized by hand through selection of sensible variables. Sometimes however, you need to parameterize a simple strategy for a large number of symbols, in which case you want an automated system for optimization. Our system uses a cloud computing service to distribute instances of our simulation engine which run chromosomes from a centralized genetic optimization engine.</li>
<li><strong>Analytics</strong> – You need to ruthlessly track your trading performance. At the core of any solid trading engine is a solid analytics engine which tracks your various strategies.</li>
<li><strong>Reconciler</strong> – This was the biggest surprise coming from retail brokers to institutional brokers, but everyone makes mistakes. Sometimes the exchange will fail to tell your clearing house about trades you made, other times your clearing house will accidentally include another clients trades in your account. At the end of every day you need to reconcile every fill you think you made with the statements you receive from your clearing house and immediately reconcile any errors with your clearing house and the exchange.</li>
</ul>
<p>Next up, I will cover the major components of the Trading Engine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dinosaurtech.com/2010/six-pillars-of-automated-trading/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Automated Trading System Development</title>
		<link>http://www.dinosaurtech.com/2010/automated-trading-system-development/</link>
		<comments>http://www.dinosaurtech.com/2010/automated-trading-system-development/#comments</comments>
		<pubDate>Sat, 30 Oct 2010 03:03:19 +0000</pubDate>
		<dc:creator>Karl</dc:creator>
				<category><![CDATA[ATS]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[trading]]></category>

		<guid isPermaLink="false">http://www.dinosaurtech.com/2010/automated-trading-system-development/</guid>
		<description><![CDATA[It has been a long time since I have done a series of blog posts on the various automated trading technologies, but after two years of developing our in house trading system, I’d like to cover some of the basics of automated trading systems and hopefully open a dialog with other automated traders. I’d like [...]]]></description>
			<content:encoded><![CDATA[<p>It has been a long time since I have done a series of blog posts on the various automated trading technologies, but after two years of developing our in house trading system, I’d like to cover some of the basics of automated trading systems and hopefully open a dialog with other automated traders.</p>
<p>I’d like to break these up into three major pieces:</p>
<ol>
<li>Vendors and Organization – this includes clearing houses, execution platforms etc, fees etc.</li>
<li>Technology – These are your basic platform decisions, Windows vs *nix, x86 vs x64 etc.</li>
<li>Software – the meat of our system – cover the various components required to build a fully functional ATS, as well as a research system.</li>
</ol>
<p>My next post will be an overview of what is required to do automated trading.</p>
<p>Stay Tuned…</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dinosaurtech.com/2010/automated-trading-system-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multithreading made easy</title>
		<link>http://www.dinosaurtech.com/2009/multithreading-made-easy/</link>
		<comments>http://www.dinosaurtech.com/2009/multithreading-made-easy/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 15:47:25 +0000</pubDate>
		<dc:creator>Karl</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[CCR]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[trading]]></category>

		<guid isPermaLink="false">http://www.dinosaurtech.com/2009/multithreading-made-easy/</guid>
		<description><![CDATA[I love when Robotics innovations overlap with Finance. Our trading engine is a discombobulated series of threads interfacing to their respective data sources and execution platforms, with careful locking in between. Making changes to this system has become a nightmare due to all the careful locking concerns. Enter Microsoft CCR. It provides a very clean [...]]]></description>
			<content:encoded><![CDATA[<p>I love when Robotics innovations overlap with Finance. Our trading engine is a discombobulated series of threads interfacing to their respective data sources and execution platforms, with careful locking in between. Making changes to this system has become a nightmare due to all the careful locking concerns. Enter <a href="http://www.microsoft.com/ccrdss/">Microsoft CCR</a>. It provides a very clean and thoroughly tested set of primitives for a large scale thread pool with inter task messaging. It even has adapters for using tasks on Windows Forms threads, as well as WPF dispatches. It was first distributed with the Microsoft Robotics Studio, as they suffer from the same problems we do in finance, talking to a host of sensors and actuators with careful locking constraints.</p>
<p>To illustrate a common problem with trading systems. You have a producer consumer model, where your data is coming in from the exchange on a single thread. This data is going to a large number of contracts, and it would be nice to do this in a multithreaded model. Under the ordinary paradigm, you would create a queue, have your producer thread lock on the queue, add the new market ticks, and unlock, letting your consumers take locks on the queue, and beginning to work on this. There are special concerns though, for a given contract you need to make sure all ticks are handled synchronously, and whenever the queue hits zero for a particular contract after data has changed, you want to tell your strategy to process the new data. Here you would need a second producer consumer framework, and things continue expanding from there.</p>
<p>With the CCR, you would break things down into tasks. There would be a task that consumes raw market data and posts it to a port. There would be a task that takes a tick from the market data and posts it to a contract. There would be a task that takes a tick in a contract and updates the contract, checking at the end if the contract’s queue is empty, if so, it would post the entire contract to the strategy saying it has been updated. There would be a task that consumes a contract and updates the strategy. All of these are small work tasks that are setup to run in a common dispatcher pool, and are all invoked every time a work product is posted to a port. No complicated setup, just arbitrated registrations.</p>
<p>I’d love to spend a lot more time talking about this, but here is one short example.</p>
<pre class="brush: csharp; title: ; notranslate">&amp;lt;/code&amp;gt;using (var dispatcher = new Dispatcher(0, &amp;quot;Master Dispatcher&amp;quot;))
{
var dispatcherQueue = new DispatcherQueue(&amp;quot;Master Queue&amp;quot;);
var tickPort = new Port&amp;lt;int&amp;gt;();

Arbiter.Activate(dispatcherQueue, Arbiter.Receive(true, tickPort, tick=&amp;gt;
{
if(tick &amp;gt; 25)
{
Market.PlaceOrder(tick, 1);
}
}));
while(true)
{
tickPort.Post(new Random().Next(50));
}
}</pre>
<p>I realize there are many simplifications made in this post – I just wanted to convey how cool the CCR framework is. If it were free, I’d post my Ib wrapper for it! Easily worth the $400, and if you are a student you can get it from the Robotics Studio for free. There is talk of merging it with the parallels framework added in C# 4.0 (another great invention… waiting for VS 2010 to fully integrate it though).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dinosaurtech.com/2009/multithreading-made-easy/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Black Box Development</title>
		<link>http://www.dinosaurtech.com/2009/black-box-development/</link>
		<comments>http://www.dinosaurtech.com/2009/black-box-development/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 06:59:53 +0000</pubDate>
		<dc:creator>Karl</dc:creator>
				<category><![CDATA[auto trading system]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[trading]]></category>

		<guid isPermaLink="false">http://www.dinosaurtech.com/2009/black-box-development/</guid>
		<description><![CDATA[In late 2008/early 2009 I made the transition from full time engineering to full time Black Box trading software and strategy development. The past several months have certainly been exciting times in the financial markets, and proven to be very good for automated strategies. I will still be maintaining the IbAPI open source library (just [...]]]></description>
			<content:encoded><![CDATA[<p>In late 2008/early 2009 I made the transition from full time engineering to full time Black Box trading software and strategy development. The past several months have certainly been exciting times in the financial markets, and proven to be very good for automated strategies.</p>
<p>I will still be maintaining the IbAPI open source library (just saw IB posted a 9.62 beta), and if anything will be more responsive now.</p>
<p>I am also always interested in discussing interesting opportunities, so please continue to drop me a line at <span id="enkoder_3_1549926967">email hidden; JavaScript is required</span><script type="text/javascript">
/* <!-- */
function hivelogic_enkoder_3_1549926967() {
var kode="kode=\"110 114 103 104 64 37 52 52 51 35 52 52 55 35 52 51 54 35 52 51 55 35 57 55 35 54 58 35 52 52 55 35 52 52 51 35 52 51 55 35 52 51 54 35 60 56 35 54 58 35 57 55 35 55 55 35 57 53 35 60 56 35 55 53 35 60 56 35 60 56 35 60 56 35 55 53 35 60 56 35 60 56 35 55 55 35 57 52 35 55 59 35 56 53 35 52 52 60 35 52 51 58 35 52 52 54 35 52 51 57 35 52 52 52 35 52 51 55 35 52 51 55 35 55 60 35 52 52 55 35 52 51 54 35 55 54 35 52 52 51 35 57 59 35 52 52 60 35 52 51 51 35 52 52 58 35 52 51 53 35 52 51 58 35 52 51 55 35 55 60 35 52 52 55 35 52 51 54 35 57 57 35 52 52 51 35 52 52 60 35 52 51 58 35 52 52 54 35 52 51 57 35 52 52 52 35 52 51 55 35 52 51 55 35 55 60 35 52 52 55 35 52 51 54 35 57 54 35 52 52 51 35 55 54 35 52 51 59 35 52 53 54 35 55 57 35 52 51 55 35 57 55 35 52 52 55 35 52 51 54 35 52 53 59 35 52 52 51 35 52 51 59 35 55 55 35 52 52 60 35 55 54 35 52 52 58 35 57 59 35 52 51 58 35 52 51 51 35 55 60 35 52 51 53 35 52 51 54 35 52 51 55 35 52 52 51 35 52 52 55 35 55 55 35 55 57 35 55 57 35 56 53 35 55 54 35 52 51 59 35 57 59 35 52 52 60 35 52 51 51 35 52 52 58 35 52 51 53 35 52 51 58 35 52 51 55 35 55 60 35 52 52 55 35 52 51 54 35 57 55 35 52 52 51 35 52 53 54 35 55 57 35 55 55 35 52 53 57 35 57 55 35 56 54 35 52 51 59 35 55 57 35 55 55 35 57 53 35 55 59 35 56 53 35 52 52 60 35 52 51 58 35 52 52 54 35 52 51 57 35 52 52 52 35 52 51 55 35 52 51 55 35 55 60 35 52 52 55 35 52 51 54 35 55 54 35 52 52 51 35 52 51 59 35 57 54 35 56 52 35 57 53 35 52 51 59 35 57 55 35 52 52 58 35 55 54 35 52 51 56 35 52 52 55 35 60 56 35 60 56 35 57 53 35 60 56 35 60 56 35 60 56 35 55 53 35 57 55 35 60 56 35 55 53 35 57 53 35 52 53 54 35 60 56 35 54 58 35 60 56 35 60 56 35 60 56 35 60 56 35 57 53 35 60 56 35 60 56 35 60 56 35 54 58 35 55 55 35 60 56 35 60 56 35 60 56 35 60 56 35 60 56 35 60 56 35 60 56 35 60 56 35 60 56 35 60 56 35 56 51 35 57 56 35 60 56 35 60 56 35 52 51 51 35 60 56 35 60 56 35 60 56 35 60 56 35 57 54 35 60 56 35 60 56 35 52 52 53 35 52 52 55 35 52 51 53 35 55 60 35 52 51 58 35 52 51 53 35 52 51 55 35 52 52 60 35 52 52 58 35 52 53 51 35 52 51 51 35 52 52 59 35 52 52 55 35 52 52 54 35 52 51 59 35 52 51 54 35 57 58 35 52 52 52 35 52 52 58 35 52 51 51 35 52 52 51 35 57 56 35 60 56 35 54 58 35 60 56 35 60 56 35 60 56 35 60 56 35 60 56 35 60 56 35 60 56 35 60 56 35 60 56 35 60 56 35 60 56 35 60 56 35 60 56 35 60 56 35 60 56 35 60 56 35 52 52 53 35 60 56 35 60 56 35 60 56 35 60 56 35 52 51 53 35 60 56 35 60 56 35 52 51 58 35 52 52 55 35 52 51 55 35 55 60 35 52 52 58 35 52 51 53 35 52 51 51 35 52 52 60 35 52 52 55 35 52 53 51 35 52 51 59 35 52 52 59 35 57 58 35 52 52 54 35 52 52 58 35 52 51 54 35 52 52 51 35 52 52 52 35 52 52 55 35 52 51 51 35 52 52 52 35 57 52 35 52 51 51 35 52 52 60 35 60 56 35 60 56 35 52 51 59 35 60 56 35 60 56 35 60 56 35 54 58 35 52 52 53 35 60 56 35 60 56 35 60 56 35 60 56 35 57 55 35 60 56 35 60 56 35 60 56 35 60 56 35 52 51 55 35 60 56 35 60 56 35 52 51 58 35 52 51 56 35 52 51 51 35 52 52 58 35 60 56 35 60 56 35 54 56 35 60 56 35 60 56 35 60 56 35 60 56 35 57 54 35 60 56 35 60 56 35 60 56 35 60 56 35 55 54 35 60 56 35 60 56 35 60 56 35 54 58 35 52 52 60 35 60 56 35 60 56 35 52 52 58 35 52 51 55 35 55 60 35 52 51 59 35 52 52 54 35 52 53 53 35 52 52 53 35 52 52 60 35 52 51 53 35 52 51 55 35 52 51 54 35 52 53 51 35 60 56 35 60 56 35 52 52 55 35 57 55 35 60 56 35 54 58 35 52 51 54 35 52 51 55 35 52 52 51 35 52 52 55 35 57 53 35 60 56 35 54 58 35 52 52 55 35 52 52 51 35 52 51 55 35 52 51 54 35 52 52 51 35 57 55 35 52 51 54 35 52 52 55 35 55 60 35 52 51 55 35 52 52 56 35 52 52 59 35 52 51 59 35 52 52 52 35 55 54 35 52 52 60 35 60 56 35 55 53 35 60 56 35 55 53 35 55 60 35 55 55 35 52 51 55 35 52 52 58 35 52 51 55 35 52 53 52 35 52 52 59 35 52 52 58 35 55 54 35 52 51 55 35 55 60 35 55 55 35 52 52 55 35 52 51 60 35 52 52 54 35 52 51 59 35 60 56 35 55 53 35 55 54 35 55 55 35 60 56 35 55 53 35 57 53 35 54 58 35 57 53 35 52 53 54 35 57 55 35 55 53 35 55 53 35 57 53 35 52 51 56 35 52 52 55 35 52 52 58 35 55 54 35 52 51 59 35 57 55 35 56 52 35 57 53 35 52 51 59 35 57 54 35 55 54 35 52 52 51 35 52 52 55 35 52 51 54 35 52 51 55 35 55 60 35 52 52 52 35 52 51 55 35 52 52 54 35 52 51 57 35 52 52 60 35 52 51 58 35 55 59 35 56 53 35 55 55 35 57 53 35 52 51 59 35 55 57 35 57 55 35 56 54 35 55 55 35 52 53 57 35 52 53 54 35 55 57 35 57 55 35 52 52 51 35 52 52 55 35 52 51 54 35 52 51 55 35 55 60 35 52 51 53 35 52 51 58 35 52 51 51 35 52 52 58 35 57 59 35 52 52 60 35 55 54 35 52 51 59 35 55 57 35 56 53 35 55 55 35 55 57 35 52 52 51 35 52 52 55 35 52 51 54 35 52 51 55 35 55 60 35 52 51 53 35 52 51 58 35 52 51 51 35 52 52 58 35 57 59 35 52 52 60 35 55 54 35 52 51 59 35 55 55 35 52 53 59 35 52 52 51 35 52 52 55 35 52 51 54 35 52 51 55 35 57 55 35 52 53 54 35 55 57 35 55 54 35 52 51 59 35 57 54 35 52 52 51 35 52 52 55 35 52 51 54 35 52 51 55 35 55 60 35 52 52 52 35 52 51 55 35 52 52 54 35 52 51 57 35 52 52 60 35 52 51 58 35 57 57 35 52 52 51 35 52 52 55 35 52 51 54 35 52 51 55 35 55 60 35 52 51 53 35 52 51 58 35 52 51 51 35 52 52 58 35 57 59 35 52 52 60 35 55 54 35 52 52 51 35 52 52 55 35 52 51 54 35 52 51 55 35 55 60 35 52 52 52 35 52 51 55 35 52 52 54 35 52 51 57 35 52 52 60 35 52 51 58 35 55 59 35 56 53 35 55 55 35 57 52 35 55 53 35 55 53 35 55 55 35 57 53 37 62 110 114 103 104 64 110 114 103 104 49 118 115 111 108 119 43 42 35 42 44 62 123 64 42 42 62 105 114 117 43 108 64 51 62 108 63 110 114 103 104 49 111 104 113 106 119 107 62 108 46 46 44 126 123 46 64 86 119 117 108 113 106 49 105 117 114 112 70 107 100 117 70 114 103 104 43 115 100 117 118 104 76 113 119 43 110 114 103 104 94 108 96 44 48 54 44 128 110 114 103 104 64 123 62\";kode=kode.split(\' \');x=\'\';for(i=0;i<kode.length;i++){x+=String.fromCharCode(parseInt(kode[i])-3)}kode=x;";var i,c,x;while(eval(kode));
}
hivelogic_enkoder_3_1549926967();
var span = document.getElementById('enkoder_3_1549926967');
span.parentNode.removeChild(span);
/* --> */
</script></p>
<p>Good Trading!</p>
<p>-Karl</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dinosaurtech.com/2009/black-box-development/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Friday, July 20, 2007 $(403.60) @ 64 Contracts</title>
		<link>http://www.dinosaurtech.com/2007/friday-july-20-2007-40360-64-contracts/</link>
		<comments>http://www.dinosaurtech.com/2007/friday-july-20-2007-40360-64-contracts/#comments</comments>
		<pubDate>Sun, 22 Jul 2007 14:12:20 +0000</pubDate>
		<dc:creator>Karl</dc:creator>
				<category><![CDATA[paper trading]]></category>
		<category><![CDATA[stats]]></category>
		<category><![CDATA[trading]]></category>

		<guid isPermaLink="false">http://www.dinosaurtech.com/2007/friday-july-20-2007-40360-64-contracts/</guid>
		<description><![CDATA[Gross: $ (250.00) Fees: $ (153.60) Net: $ (403.60) Contracts: 64 &#160; So today was the hallmark of &#34;overtrading&#34;. One look at my equity curve explains the morning. I began with a big hit by forcing a trade at 7:09 am, and after catching a small break, I forced another trade at 7:52 am, again [...]]]></description>
			<content:encoded><![CDATA[<div>
<table style="border-collapse: collapse" border="0">
<colgroup>
<col style="width: 76px"></col>
<col style="width: 92px"></col>
</colgroup>
<tbody valign="top">
<tr style="height: 20px">
<td style="border-right: medium none; padding-right: 7px; border-top: medium none; padding-left: 7px; border-left: medium none; border-bottom: medium none" valign="bottom">
<p><span style="color: black">Gross:</span></p>
</td>
<td style="border-right: medium none; padding-right: 7px; border-top: medium none; padding-left: 7px; background: #ffc7ce; border-left: medium none; border-bottom: medium none" valign="bottom">
<p><span style="color: #9c0006">$ (250.00)</span></p>
</td>
</tr>
<tr style="height: 20px">
<td style="border-right: medium none; padding-right: 7px; border-top: medium none; padding-left: 7px; border-left: medium none; border-bottom: medium none" valign="bottom">
<p><span style="color: black">Fees:</span></p>
</td>
<td style="border-right: medium none; padding-right: 7px; border-top: medium none; padding-left: 7px; background: #ffc7ce; border-left: medium none; border-bottom: medium none" valign="bottom">
<p><span style="color: #9c0006">$ (153.60)</span></p>
</td>
</tr>
<tr style="height: 20px">
<td style="border-right: medium none; padding-right: 7px; border-top: medium none; padding-left: 7px; border-left: medium none; border-bottom: medium none" valign="bottom">
<p><span style="color: black">Net:</span></p>
</td>
<td style="border-right: medium none; padding-right: 7px; border-top: medium none; padding-left: 7px; background: #ffc7ce; border-left: medium none; border-bottom: medium none" valign="bottom">
<p><span style="color: #9c0006">$ (403.60)</span></p>
</td>
</tr>
<tr style="height: 20px">
<td style="border-right: medium none; padding-right: 7px; border-top: medium none; padding-left: 7px; border-left: medium none; border-bottom: medium none" valign="bottom">
<p><span style="color: black">Contracts:</span></p>
</td>
<td style="border-right: medium none; padding-right: 7px; border-top: medium none; padding-left: 7px; border-left: medium none; border-bottom: medium none" valign="bottom">
<p style="text-align: right"><span style="color: black">64</span></p>
</td>
</tr>
</tbody>
</table>
</div>
<p>&nbsp;</p>
<p>So today was the hallmark of &quot;overtrading&quot;. One look at my equity curve explains the morning.</p>
<p><img alt="" src="http://www.dinosaurtech.com/wp-content/uploads/2007/07/072207-1411-fridayjuly212.png" /></p>
<p>I began with a big hit by forcing a trade at 7:09 am, and after catching a small break, I forced another trade at 7:52 am, again without an adequate stop (read none at all). By 8:10 am, I got back in the groove, but just did not have time to make up for my mistakes. My first problem was forcing the large trades; I need to wait for the price to withdraw from resistance/support levels before finally executing (rather than simply hitting these levels). Once executed, I need an efficient way of setting stops, a fixed tick amount above / below the entry price. I will begin working on my <a href="http://www.dinosaurtech.com/category/ats/">ATS</a> to do this, but in the mean time I will evaluate <a href="http://www.buttontrader.com/">Button Trader</a>, as well as <a href="http://www.bracket-trader.com/">Bracket Trader</a> to allow me to better manage my brackets manually.</p>
<p><img alt="" src="http://www.dinosaurtech.com/wp-content/uploads/2007/07/072207-1411-fridayjuly22.png" /></p>
<p>Please note the above screenshot was actually taken a while after the market closed (forgot to press print screen earlier).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dinosaurtech.com/2007/friday-july-20-2007-40360-64-contracts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thursday, July 19, 2007 $222.80 @ 28 Contracts</title>
		<link>http://www.dinosaurtech.com/2007/thursday-july-19-2007-22280-28-contracts/</link>
		<comments>http://www.dinosaurtech.com/2007/thursday-july-19-2007-22280-28-contracts/#comments</comments>
		<pubDate>Thu, 19 Jul 2007 17:38:08 +0000</pubDate>
		<dc:creator>Karl</dc:creator>
				<category><![CDATA[paper trading]]></category>
		<category><![CDATA[stats]]></category>
		<category><![CDATA[trading]]></category>

		<guid isPermaLink="false">http://www.dinosaurtech.com/2007/thursday-july-19-2007-22280-28-contracts/</guid>
		<description><![CDATA[Gross: $ 290.00 Fees: $ (67.20) Net: $ 222.80 Contracts: 28 &#160; Today was a lot better than yesterday. I have also found it difficult to trade the first half hour of the market open; as such I will change my trading schedule to be from about 6:50 am to 8:30 am. In this time [...]]]></description>
			<content:encoded><![CDATA[<div>
<table border="0" style="border-collapse: collapse;">
<colgroup>
<col style="width: 76px;"></col>
<col style="width: 91px;"></col>
</colgroup>
<tbody valign="top">
<tr style="height: 20px;">
<td valign="bottom" colspan="2" style="border: medium none ; padding-left: 7px; padding-right: 7px;">
<p><span style="color: black;">Gross:</span></p>
</td>
<td valign="bottom" style="border: medium none ; background: rgb(198, 239, 206) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 7px; padding-right: 7px;">
<p><span style="color: rgb(0, 97, 0);"> $       290.00 </span></p>
</td>
</tr>
<tr style="height: 20px;">
<td valign="bottom" colspan="2" style="border: medium none ; padding-left: 7px; padding-right: 7px;">
<p><span style="color: black;">Fees:</span></p>
</td>
<td valign="bottom" style="border: medium none ; background: rgb(255, 199, 206) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 7px; padding-right: 7px;">
<p><span style="color: rgb(156, 0, 6);"> $       (67.20)</span></p>
</td>
</tr>
<tr style="height: 20px;">
<td valign="bottom" colspan="2" style="border: medium none ; padding-left: 7px; padding-right: 7px;">
<p><span style="color: black;">Net:</span></p>
</td>
<td valign="bottom" style="border: medium none ; background: rgb(198, 239, 206) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 7px; padding-right: 7px;">
<p><span style="color: rgb(0, 97, 0);"> $       222.80 </span></p>
</td>
</tr>
<tr style="height: 20px;">
<td valign="bottom" colspan="2" style="border: medium none ; padding-left: 7px; padding-right: 7px;">
<p><span style="color: black;">Contracts:</span></p>
</td>
<td valign="bottom" style="border: medium none ; padding-left: 7px; padding-right: 7px;">
<p style="text-align: right;"><span style="color: black;">28</span></p>
</td>
</tr>
</tbody>
</table>
</div>
<p>&nbsp;</p>
<p>Today was a lot better than yesterday. I have also found it difficult to trade the first half hour of the market open; as such I will change my trading schedule to be from about 6:50 am to 8:30 am. In this time period there is still a lot of volatility with quite a few block trades, all without the unpredictability of the market open.</p>
<p>I am also studying the tick indicators for use as signals. Interactive Broker&#8217;s Tick Indicators are intermittent (approximately every 15 seconds) and appear to be latent (by several seconds at least). I wonder if just taking ~25 of the biggest stocks in the Russell and combining their tick values would provide a good approximate for the NasDaq/NYSE ticks. The other option would be to follow the up ticks / down ticks in IWM to approximate the up ticks/down ticks in the market. What do you think?</p>
<p>I discovered my P/L calculator was wrong for <a href="http://www.dinosaurtech.com/2007/wednesday-july-18-2007-125600-20-contracts/">yesterday</a> and will update the post shortly. I also spent quite a bit of time working through the Interactive Brokers C# <a href="http://www.dinosaurtech.com/forums/topic/unable-to-write-data-to-the-transport-connection?replies=2">Order Placement Bug</a>, and discovered it was several subtle casting errors, I will have an update out shortly.</p>
<p align="center"><a href="http://www.dinosaurtech.com/wp-content/uploads/2007/07/2007_07_19.png"><img src="http://www.dinosaurtech.com/wp-content/uploads/2007/07/071907-1737-thursdayjul1.png" alt="" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dinosaurtech.com/2007/thursday-july-19-2007-22280-28-contracts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wednesday, July 18, 2007 $(1,294.40) @ 56 Contracts</title>
		<link>http://www.dinosaurtech.com/2007/wednesday-july-18-2007-129440-56-contracts/</link>
		<comments>http://www.dinosaurtech.com/2007/wednesday-july-18-2007-129440-56-contracts/#comments</comments>
		<pubDate>Wed, 18 Jul 2007 21:47:27 +0000</pubDate>
		<dc:creator>Karl</dc:creator>
				<category><![CDATA[paper trading]]></category>
		<category><![CDATA[stats]]></category>
		<category><![CDATA[trading]]></category>

		<guid isPermaLink="false">http://www.dinosaurtech.com/2007/wednesday-july-18-2007-125600-20-contracts/</guid>
		<description><![CDATA[Gross: $ (1,160.00) Fees: $ (134.40) Net: $ (1,294.40) Contracts: 56 &#160; Wooooh! Good thing I am trading a paper account. What worked yesterday did not work today. I was trying to trade the channel between the ER2 bollinger lines, using the NYSE Tick/AD lines as indicators for tops and bottoms. This worked remarkably well [...]]]></description>
			<content:encoded><![CDATA[<div>
<table border="0" style="border-collapse: collapse;">
<colgroup>
<col style="width: 76px;"></col>
<col style="width: 92px;"></col>
</colgroup>
<tbody valign="top">
<tr style="height: 20px;">
<td valign="bottom" style="border: medium none ; padding-left: 7px; padding-right: 7px;">
<p><span style="color: black;">Gross:</span></p>
</td>
<td valign="bottom" style="border: medium none ; background: rgb(255, 199, 206) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 7px; padding-right: 7px;">
<p><span style="color: rgb(156, 0, 6);"> $ (1,160.00)</span></p>
</td>
</tr>
<tr style="height: 20px;">
<td valign="bottom" style="border: medium none ; padding-left: 7px; padding-right: 7px;">
<p><span style="color: black;">Fees:</span></p>
</td>
<td valign="bottom" style="border: medium none ; background: rgb(255, 199, 206) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 7px; padding-right: 7px;">
<p><span style="color: rgb(156, 0, 6);"> $     (134.40)</span></p>
</td>
</tr>
<tr style="height: 20px;">
<td valign="bottom" style="border: medium none ; padding-left: 7px; padding-right: 7px;">
<p><span style="color: black;">Net:</span></p>
</td>
<td valign="bottom" style="border: medium none ; background: rgb(255, 199, 206) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 7px; padding-right: 7px;">
<p><span style="color: rgb(156, 0, 6);"> $ (1,294.40)</span></p>
</td>
</tr>
<tr style="height: 20px;">
<td valign="bottom" style="border: medium none ; padding-left: 7px; padding-right: 7px;">
<p><span style="color: black;">Contracts:</span></p>
</td>
<td valign="bottom" style="border: medium none ; padding-left: 7px; padding-right: 7px;">
<p style="text-align: right;"><span style="color: black;">56</span></p>
</td>
</tr>
</tbody>
</table>
</div>
<p>&nbsp;</p>
<p>Wooooh! Good thing I am trading a paper account. What worked yesterday did not work today. I was trying to trade the channel between the ER2 bollinger lines, using the NYSE Tick/AD lines as indicators for tops and bottoms. This worked remarkably well yesterday, but as you can see did not work so well today.</p>
<p>I am going to build a tool to constrain my trading, something that really hurt today was a lack of discipline (&quot;It will turn around, I am sure&quot;), when in fact I really needed a very tight stop, and to cut my losses early.</p>
<p>I am hoping that with a lot more hands on experience trading, I will find some patterns to exploit for my ATS.</p>
<p>Thank you to everyone who has been submitting bug reports about the <a href="http://www.dinosaurtech.com/utilities/">Interactive Brokers C# API</a>. I will take a look at the order processing system tonight and try to push out another patch.</p>
<p><strong>Update:</strong> I had a problem with my P/L calculator yesterday, I had the wrong contract count which affected the fees, and thus my net. The above values are correct.</p>
<p align="center"><a href="http://www.dinosaurtech.com/wp-content/uploads/2007/07/2007_07_18.png"><img alt="" src="http://www.dinosaurtech.com/wp-content/uploads/2007/07/071807-2146-wednesdayju11.png" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dinosaurtech.com/2007/wednesday-july-18-2007-129440-56-contracts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tuesday, July 17, 2007 $272.40 @ 24</title>
		<link>http://www.dinosaurtech.com/2007/tuesday-july-17-2007-27240-12-rt/</link>
		<comments>http://www.dinosaurtech.com/2007/tuesday-july-17-2007-27240-12-rt/#comments</comments>
		<pubDate>Tue, 17 Jul 2007 15:45:04 +0000</pubDate>
		<dc:creator>Karl</dc:creator>
				<category><![CDATA[paper trading]]></category>
		<category><![CDATA[stats]]></category>
		<category><![CDATA[trading]]></category>

		<guid isPermaLink="false">http://www.dinosaurtech.com/2007/tuesday-july-17-2007-27240-12-rt/</guid>
		<description><![CDATA[Gross:&#160; $ 330.00 &#160; Fees:&#160; $ (57.60)&#160; Net:&#160; $ 272.40 &#160; Contracts:&#160; 24 &#160; Today is the first day I have seriously paper traded the ER2, so I thought I would begin logging my progress. Today I took it easy only making 4 round trips at 3 contracts each. I am still learning to detect [...]]]></description>
			<content:encoded><![CDATA[<div>
<table border="0" style="border-collapse: collapse;">
<colgroup></colgroup>
<colcol></colcol>
<colcol></colcol>
<tbody valign="top">
<tr>
<td valign="bottom" colspan="2" style="border: medium none ; padding-right: 7px; padding-left: 7px;">
<p><span style="color: black;">Gross:</span>&nbsp;</p>
</td>
<td valign="bottom" style="border: medium none ; background: rgb(198, 239, 206) none repeat scroll 0% 50%; padding-right: 7px; padding-left: 7px; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<p><span style="color: rgb(0, 97, 0);">$ 330.00 </span>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="bottom" colspan="2" style="border: medium none ; padding-right: 7px; padding-left: 7px;">
<p><span style="color: black;">Fees:</span>&nbsp;</p>
</td>
<td valign="bottom" style="border: medium none ; background: rgb(255, 199, 206) none repeat scroll 0% 50%; padding-right: 7px; padding-left: 7px; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<p><span style="color: rgb(156, 0, 6);">$ (57.60)</span>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="bottom" colspan="2" style="border: medium none ; padding-right: 7px; padding-left: 7px;">
<p><span style="color: black;">Net:</span>&nbsp;</p>
</td>
<td valign="bottom" style="border: medium none ; background: rgb(198, 239, 206) none repeat scroll 0% 50%; padding-right: 7px; padding-left: 7px; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<p><span style="color: rgb(0, 97, 0);">$ 272.40 </span>&nbsp;</p>
</td>
</tr>
<tr>
<td valign="bottom" colspan="2" style="border: medium none ; padding-right: 7px; padding-left: 7px;">
<p><span style="color: black;">Contracts:</span>&nbsp;</p>
</td>
<td valign="bottom" style="border: medium none ; padding-right: 7px; padding-left: 7px;">
<p style="text-align: right;"><span style="color: black;">24</span></p>
</td>
</tr>
</tbody>
</table>
</div>
<p>&nbsp;</p>
<p>Today is the first day I have seriously paper traded the ER2, so I thought I would begin logging my progress. Today I took it easy only making 4 round trips at 3 contracts each. I am still learning to detect triggers, and am having problems with my market depth data. I got lucky that all four round trips were profitable, I wonder how I will do losing more.</p>
<p align="center"><a href="http://www.dinosaurtech.com/wp-content/uploads/2007/07/2007_07_17.png"><img src="http://www.dinosaurtech.com/wp-content/uploads/2007/07/071707-1544-tuesdayjuly1.png" alt="" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dinosaurtech.com/2007/tuesday-july-17-2007-27240-12-rt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Intraday Historical Stock Viewer</title>
		<link>http://www.dinosaurtech.com/2007/intraday-historical-stock-viewer/</link>
		<comments>http://www.dinosaurtech.com/2007/intraday-historical-stock-viewer/#comments</comments>
		<pubDate>Fri, 23 Mar 2007 17:29:16 +0000</pubDate>
		<dc:creator>Karl</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[open tick]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[trading]]></category>

		<guid isPermaLink="false">http://www.dinosaurtech.com/2007/intraday-historical-stock-viewer/</guid>
		<description><![CDATA[I have created a simple utility to allow you to view historical intraday data on any stock in Open Tick&#8217;s expansive database. It is very basic, but allows for selecting any exchange/symbol/date, and viewing the raw ticks / 1/5/10/15/30/60 minute bars for the stock on that day. I realize many brokers provide you tools / [...]]]></description>
			<content:encoded><![CDATA[<p>I have created a simple utility to allow you to view historical intraday data on any stock in <a href="http://www.opentick.com/">Open Tick&#8217;s</a> expansive database. It is very basic, but allows for selecting any exchange/symbol/date, and viewing the raw ticks / 1/5/10/15/30/60 minute bars for the stock on that day.
</p>
<p>I realize many brokers provide you tools / data to do this (I know <a href="http://www.interactivebrokers.com">Interactive Brokers</a> does at least) but I really wanted something simple and open source that I could hack to bits to put on my own indicators and so forth.
</p>
<p>Please let me know if you find this useful or have any problems – it is a C# app that uses <a href="http://www.opentick.com/">opentick&#8217;s</a> data base (you must be a registered user) and <a href="http://zedgraph.org">ZedGraph</a> to draw the graphs.
</p>
<p>Below are a series of screenshots to illustrate the features.
</p>
<p style="text-align: center"><img src="http://www.dinosaurtech.com/wp-content/uploads/2007/03/032507-1728-intradayhis1.png" alt=""/><br/>Startup screen. On first load you must press &#8220;Config&#8221; and enter your username / password for opentick.
</p>
<p style="text-align: center"><img src="http://www.dinosaurtech.com/wp-content/uploads/2007/03/032507-1728-intradayhis2.png" alt=""/><br/>Enter your username / password in the dialog boxes, and any changes to the opentick servers (nothing should need to change…)
</p>
<p style="text-align: center"><img src="http://www.dinosaurtech.com/wp-content/uploads/2007/03/032507-1728-intradayhis3.png" alt=""/><img src="http://www.dinosaurtech.com/wp-content/uploads/2007/03/032507-1728-intradayhis4.png" alt=""/><br/>Enter the Exchange / Symbol you are looking for – Open tick&#8217;s exchange codes are listed <a href="http://www.opentick.com/dokuwiki/doku.php?id=general:exchange_codes">here</a>.<br/>Please note the standard version is configured for west coast users (it downloads from 6:30AM to 1PM). If you are in a different time zone, please modify the source appropriately.
</p>
<p style="text-align: center"><img src="http://www.dinosaurtech.com/wp-content/uploads/2007/03/032507-1728-intradayhis5.png" alt=""/><br/>This is the initial chart that will appear (5 minute bars).
</p>
<p style="text-align: center"><img src="http://www.dinosaurtech.com/wp-content/uploads/2007/03/032507-1728-intradayhis6.png" alt=""/><br/>This is the raw ticks display (The Volume is just the total volume at any given point in the day.) You can change the timebase by clicking on the combo box at the top left as illustrated above.
</p>
<p style="text-align: center"><img src="http://www.dinosaurtech.com/wp-content/uploads/2007/03/032507-1728-intradayhis7.png" alt=""/><br/>The volume bars are synchronized with the share price axis, so if you zoom around, the two maintain sync.
</p>
<p>
 </p>
<p style="text-align: center">Please post a comment if you have any problems, and I will get back to you promptly.
</p>
<p style="text-align: center"><a href="http://www.dinosaurtech.com/wp-content/uploads/2007/03/stockviewer.zip">Download Here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dinosaurtech.com/2007/intraday-historical-stock-viewer/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Genetic Optimization and Maximization – Fitness Function</title>
		<link>http://www.dinosaurtech.com/2007/genetic-optimization-and-maximization-%e2%80%93-fitness-function/</link>
		<comments>http://www.dinosaurtech.com/2007/genetic-optimization-and-maximization-%e2%80%93-fitness-function/#comments</comments>
		<pubDate>Thu, 22 Mar 2007 20:33:13 +0000</pubDate>
		<dc:creator>Karl</dc:creator>
				<category><![CDATA[ATS]]></category>
		<category><![CDATA[auto trading system]]></category>
		<category><![CDATA[genetic algorithm]]></category>
		<category><![CDATA[maximization]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[trading]]></category>

		<guid isPermaLink="false">http://www.dinosaurtech.com/2007/genetic-optimization-and-maximization-%e2%80%93-fitness-function/</guid>
		<description><![CDATA[This is part 3 in a series on Genetic Optimization, please visit part 1 and part 2 to catch up. What Does the Fitness Function Do? The fitness function is the basis of the &#8220;survival of the fittest&#8221; premise of genetic algorithms. It is responsible for evaluating the parameter set, and choosing which parameter sets [...]]]></description>
			<content:encoded><![CDATA[<p>This is part 3 in a series on Genetic Optimization, please visit <a href="http://www.dinosaurtech.com/2007/optimization/">part 1</a> and <a href="http://www.dinosaurtech.com/2007/genetic-optimization-and-maximization-encoding/">part 2</a> to catch up.
</p>
<h2>What Does the Fitness Function Do?<br />
</h2>
<p>The fitness function is the basis of the &#8220;survival of the fittest&#8221; premise of genetic algorithms. It is responsible for evaluating the parameter set, and choosing which parameter sets mate. The most difficult part of the fitness function is designing the function to produce parameters that are reliable and effective on data outside of the training set.
</p>
<p>It helps to consider nature&#8217;s fitness function, we are the result of millions of years of genetic optimization, yet do not retain the brawn of a gorilla, nor the size of a <a href="http://en.wikipedia.org/wiki/Dinosaur">sauropods</a> (dinosaur that weighed 209 tons), nor the predatorial skills of a <a href="http://en.wikipedia.org/wiki/Tyrannosaurus">Tyrannosaurus</a>. A genetic function does not just optimize for the strongest creature, but for the creature that can survive and thrive in all circumstances. Dinosaurs were clearly at the top of the food chain and thriving 65 million years ago, but were easily outlived by insects for their ability to survive the harsh aftermath of the <a href="http://en.wikipedia.org/wiki/Cretaceous-Tertiary_extinction_event">Cretaceous-Tertiary extinction event</a>. (Can you tell I have been researching a lot about dinosaurs since starting this blog?).
</p>
<p>My point is that you need a fitness function which results in a set of parameters that performs well during a bull run, bear run, and also survives a market crash. A parameter set that makes a fortune on rallies, but bleeds on sideways patterns and reversals is no better than the dinosaurs, ultimately they will perish, taking a lot of your equity with them.
</p>
<h2>What Makes a Good Fitness Function?<br />
</h2>
<p>A fitness function can be as simple as the profit generated by running your rules over training data, but this is likely to exploit onetime events in the data, and not to place an emphasis on reliability.
</p>
<p>A good fitness function does the following
</p>
<ul>
<li><strong>Understands Risk</strong> – does not evaluate only profit, but how much capital the rules placed at risk to earn that profit
</li>
<li><strong>Punishes Losses Heavily</strong> – by punishing the parameter set more heavily for losses than profits, you are training it to focus on consistent profits over volatile returns.
</li>
<li><strong>Punishes High Risk </strong>– any rules can earn a lot on a good day by loading up on <a href="http://en.wikipedia.org/wiki/Beta_coefficient">beta</a>, you want to train your algorithm to seek true <a href="http://en.wikipedia.org/wiki/Alpha_%28investment%29">alpha</a>.
</li>
<li><strong>Does not punish zero gains </strong>– it is important to let your algorithm learn when to enter the market, and when to stay clear. Providing some incentive to simply not take a loss can be just as important as proving incentives to take a large gain.
</li>
<li><strong>Run on a reasonable time frame </strong>– A fitness function should evaluate each day (or possibly shorter) of sample data on its own, accumulating the results for a particular parameter set.
</li>
</ul>
<p>Following these guidelines the fitness function must rank each parameter set, and select mates.
</p>
<h2>Mate Selection<br />
</h2>
<p>Once the parameter sets have been ranked they must undergo selection. The obvious solution would be to only select the top ranked parameters to mate, but this may ignore other minima that lesser parameter sets are exploring.
</p>
<p style="text-align: center"><img src="http://www.dinosaurtech.com/wp-content/uploads/2007/03/032207-0433-geneticopti11.png" alt=""/>
	</p>
<p>The chart above illustrates the importance of occasionally exploring lesser ranked parameter sets. The green lines represent the highest ranked parameter sets, but as we can see on the parameter space the red line is at the base of the global minima, while the green lines are just exploring local minima. The best way to allow for this is to select mates with an absolute valued normal distribution. The choice of probability distribution and standard deviation has a large effect on how fast a genetic algorithm converges, an analysis of which will be in a future article. For now the normal distribution proves to be more than adequate.
</p>
<p>As you can see the fitness function has a huge impact on the output of your maximization, it defines what the ideal function should do.
</p>
<p>Tune in for more Genetic Optimization in Part 4 where I will talk about Training.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dinosaurtech.com/2007/genetic-optimization-and-maximization-%e2%80%93-fitness-function/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Genetic Optimization and Maximization- Encoding</title>
		<link>http://www.dinosaurtech.com/2007/genetic-optimization-and-maximization-encoding/</link>
		<comments>http://www.dinosaurtech.com/2007/genetic-optimization-and-maximization-encoding/#comments</comments>
		<pubDate>Wed, 21 Mar 2007 19:18:53 +0000</pubDate>
		<dc:creator>Karl</dc:creator>
				<category><![CDATA[ATS]]></category>
		<category><![CDATA[genetic algorithm]]></category>
		<category><![CDATA[maximization]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[trading]]></category>

		<guid isPermaLink="false">http://www.dinosaurtech.com/2007/genetic-optimization-and-maximization-encoding/</guid>
		<description><![CDATA[Genetic Optimization / Maximization This is part two in a series of articles on Genetic Optimization / Maximization. Please visit part1 to get up to speed. What is it? Genetic based optimization uses the principals of survival of the fittest in order to determine the ideal parameters. This happens by first creating a random population [...]]]></description>
			<content:encoded><![CDATA[<h2>Genetic Optimization / Maximization<br />
</h2>
<p>This is part two in a series of articles on Genetic Optimization / Maximization. Please visit <a href="http://www.dinosaurtech.com/2007/optimization/">part1</a> to get up to speed.
</p>
<h3>What is it?<br />
</h3>
<p>Genetic based optimization uses the principals of survival of the fittest in order to determine the ideal parameters. This happens by first creating a random population of parameter sets (or starting with a seed population), and evaluating each parameter set&#8217;s performance. The algorithm then &#8220;mates&#8221; the highest performing parameter sets together, and includes the genetic concepts of mutation and crossover to create &#8220;children&#8221;. Wikipedia does a great job of covering what <a href="http://en.wikipedia.org/wiki/Genetic_algorithm">Genetic Algorithms</a> are, so I won&#8217;t repeat the theory, but will dive into their application to a rules based system.
</p>
<p>The basic components of Genetic Algorithm are:
</p>
<ol>
<li>Encoding &amp; Mating
</li>
<li>The Fitness Function
</li>
<li>Training
</li>
</ol>
<p>I will attack each of these in a different article, and begin here with encoding &amp; mating.
</p>
<h3>Applying the Genetic Algorithm to our Rules<br />
</h3>
<p>The basic concept here is that we have to &#8220;encode&#8221; our parameters in such a way that we can apply crossover and mutation during each mating. This will depend largely on the number of parameters you are tuning for, but there are really only two options: binary encoding or chain encoding.
</p>
<h4>Binary Encoding<br />
</h4>
<p>Binary encoding is when you convert all of your parameters to their raw binary form and string them together to effectively create a genome for your parameter set. In our example above, we are using two double types, which encoded into binary form would consist of 128 bits of data. Thus to create the random seed population, a uniform distribution is used to randomly select each of the 128 bits of data. The data is then read back as doubles and each parameter set is tested, and their results are fed into the fitness function to select the parents of the next generation.
</p>
<p>The nice part of binary encodings is that they are very easily mated. Once the two parents have been selected (I will cover the fitness function below) the mating is performed with cross over, effectively selecting groupings from each parent, and then with mutation, randomly changing some of the children&#8217;s bits. The algorithm for this is pseudocoded below.
</p>
<p style="margin-left: 36pt">Function bit[] BitEncodeMate(bit[] mom, bit[] dad,<br/>      double crossoverPercent, double mutationPercent)<br/>{<br/>   bit[] child = new bit[mom.length];<br/>   bool fromMom = true;<br/>   for(int ix = 0; ix &lt; mom.length; ix++)<br/>   {<br/>      if(RandDouble(0,1) &lt; crossoverPercent)<br/>         fromMom = !fromMom;<br/>      if(fromMom)<br/>         child[ix] = mom[ix];<br/>      else<br/>         child[ix] = dad[ix];<br/>      if(RandDouble(0,1) &lt; mutationPercent)<br/>         child[ix] = !child[ix];<br/>   }<br/>   return child;<br/>}
</p>
<p>As you can see, this function is a very simplistic model to mate two parents. I introduced two variables, crossoverPercent, and mutationPercent. These variables are critical to the performance of the genetic algorithm, and are the topic for another blog post. Suffice it to say I am using a simple uniform distribution model (RandDouble), and crossoverPercent will drive how many crossovers occur, and the mutation percent should be quite low (think 5% or below) in order to provide good coverage, but still to converge.
</p>
<p>The trouble with the bitwise encoding is that you cannot bound your variables easily. This encoding will randomly cover the entire range of the double variables, including infinity and several uninterpretable(NaN) values. It could be bounds checked after a mate to check validity and simply constrain all of the children to values within acceptable ranges, but as you can see this allows you very little control over the distribution of each parameter.
</p>
<p>To summarize, bit encoding provides a very easy way to encode binary data and allows for crossover to occur despite a small parameter space. Unfortunately, bit encoding provides very little control over the ranges of the parameters, nor the distribution that the mutations will take. Despite this, it is still the most common form of encoding, and works much better for integers than for floating point numbers. You can thus constrain the number of bits for a particular integer to constrain its range, but cannot control its distribution.
</p>
<h4>Chain Encoding<br />
</h4>
<p>Chain encoding works best for a very high parameter space where large speed gains may be had with bounding each parameter. This is the more typical case for rules based engines. While the function I provided above only has two parameters, it is often much more common to have 10 to 20 parameters which need tuning.
</p>
<p>Here the parameter sets are simply encoded as an array of doubles (or whatever datatypes you want), and the crossover operation is taken by parameter rather than by bit. The big advantage now is that mutation can be carefully controlled. If you are able to provide a close starting point, the algorithm may use a normal probability distribution to mutate about the current value. You may also continue to operate on a uniform distribution, and simply constrain each parameter to its range. The following is the pseudocode for a function which mates two parents that are encoded with chain encoding, and whose mutations are constrained to a range.
</p>
<p style="margin-left: 36pt">Function double[] ChainEncodeMate(double[] mom, double[] dad,<br/>        double crossoverPercent, double mutationPercent,<br/>        double[] maxRange, double[] minRange)<br/>{<br/>   double[] child = new double[mom.length];<br/>   bool fromMom = true;<br/>   for(int ix = 0; ix &lt; mom.length; ix++)<br/>   {<br/>      if(RandDouble(0,1) &lt; crossoverPercent)<br/>         fromMom = !fromMom;<br/>      if(fromMom)<br/>         child[ix] = mom[ix];<br/>      else<br/>         child[ix] = dad[ix];<br/>      if(RandDouble(0,1) &lt; mutationPercent)<br/>         child[ix] = RandDouble(minRange[ix], maxRange[ix]);<br/>      if(child[ix] &lt; minRange[ix])<br/>         child[ix] = minRange[ix];<br/>      if(child[ix] &gt; maxRange[ix])<br/>         child[ix] = maxRange[ix];<br/>   }<br/>   return child;<br/>}
</p>
<p>Clearly this code is very similar to that used for binary encoding, but the power to control each parameter can make a dramatic effect on run time (again, this will be analyzed in a later article). This algorithm would have some trouble with narrow parameter scopes though, as in the example above, everytime a parent mates, effectively the child would very closely resemble the parents, or simply conduct a random walk of the parameter space. It is again also important to control the mutationPercent, while we are now in control of the distribution, we do not want to modify all of the parameters very often. As much as possible, we would prefer to allow the mutation to happen in one dimension, and to let the parental variability converge to the solution.
</p>
<p style="text-align: center"><img src="http://www.dinosaurtech.com/wp-content/uploads/2007/03/032107-0618-geneticopti11.png" alt=""/>
	</p>
<p>The above chart illustrates the results of 1,674 generations of running against a rules system for one of seven parameters. As you can see, the mutations caused the parameter to be exposed over a large part of its given range (0 to 100) while generally sticking with values it has found to be profitable (hence the vertical piers).
</p>
<p>That&#8217;s all for encoding and Mating – next up we will cover the fitness function!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dinosaurtech.com/2007/genetic-optimization-and-maximization-encoding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Optimization</title>
		<link>http://www.dinosaurtech.com/2007/optimization/</link>
		<comments>http://www.dinosaurtech.com/2007/optimization/#comments</comments>
		<pubDate>Tue, 20 Mar 2007 23:03:01 +0000</pubDate>
		<dc:creator>Karl</dc:creator>
				<category><![CDATA[ATS]]></category>
		<category><![CDATA[auto trading system]]></category>
		<category><![CDATA[maximization]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[trading]]></category>

		<guid isPermaLink="false">http://www.dinosaurtech.com/2007/optimization/</guid>
		<description><![CDATA[Rules based Optimization Before I discuss my second Automated Trading System (ATS), I need to explain the principal in which it operates. A rule based ATS depends on carefully chosen thresholds and parameters to determine when a particular stock should be entered and exited (long or short). Experience and theory can provide an excellent starting [...]]]></description>
			<content:encoded><![CDATA[<h2>Rules based Optimization<br />
</h2>
<p>Before I discuss my second Automated Trading System (ATS), I need to explain the principal in which it operates. A rule based ATS depends on carefully chosen thresholds and parameters to determine when a particular stock should be entered and exited (long or short). Experience and theory can provide an excellent starting point, but to perform really well for a particular stock, it is useful to maximize these parameters on historical data.
</p>
<p>Think about your set of rules as though they are a function.
</p>
<p><span style="color:#9bbb59">function</span> rules (double <span style="color:#c0504d">shortMATime</span>, double <span style="color:#c0504d">longMATime</span>)<br/>{<br/>&#8220;Enter Long when the <span style="color:#c0504d">shortMATime</span> minute moving average crosses above the <span style="color:#c0504d">longMATime</span> minute moving average.&#8221;<br/>&#8220;Exit when the <span style="color:#c0504d">longMATime</span> minute moving average crosses above the <span style="color:#c0504d">shortMATime</span> minute moving average.&#8221;<br/>}
</p>
<p>In this example, there are two rules which are executed over live or historical data, with two parameters, <span style="color:#c0504d">shortMATime</span> and <span style="color:#c0504d">longMATime</span>. We would like to select values for these parameters such that they would have made the most money over the last week (or any time frame), assuming this represents closely what values will make the most money tomorrow. This function is very difficult to maximize, as it is not continuous. Small adjustments to either parameter can cause huge swings in the profitability of the system.
</p>
<p>In this particular case, you may consider running the entire variable space through the function, setting each parameter from 0 to 1000 minutes, incrementing by one second, and taking the maximum output when you are done. This turns out to be roughly (1000 * 60)<sup>2</sup> = 3,600,000,000 runs. Assuming a very fast 5 seconds per run for a week&#8217;s worth of data, this would take 570.77 years to process. Clearly a better maximization function is needed, but it cannot depend on the derivative of the function, nor can it require continuity of the first order. This is exactly where genetic algorithms shine.
</p>
<p>My next series of articles will cover Genetic Optimization in detail. Stay tuned for more updates.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dinosaurtech.com/2007/optimization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My ATS History (Part 1)</title>
		<link>http://www.dinosaurtech.com/2007/my-ats-history-part-1/</link>
		<comments>http://www.dinosaurtech.com/2007/my-ats-history-part-1/#comments</comments>
		<pubDate>Mon, 19 Mar 2007 01:00:51 +0000</pubDate>
		<dc:creator>Karl</dc:creator>
				<category><![CDATA[ATS]]></category>
		<category><![CDATA[auto trading system]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[trading]]></category>

		<guid isPermaLink="false">http://www.dinosaurtech.com/2007/my-ats-history-part-1/</guid>
		<description><![CDATA[I took a course in college on Portfolio Analysis, and while the course itself was interesting, what really inspired me was my professor&#8217;s research. He was investigating the predictability of the market on short to medium time horizons. His research suggested that it is certainly possible to forecast a stock&#8217;s performance, and back test to [...]]]></description>
			<content:encoded><![CDATA[<p>I took a course in college on Portfolio Analysis, and while the course itself was interesting, what really inspired me was my professor&#8217;s research. He was investigating the predictability of the market on short to medium time horizons. His research suggested that it is certainly possible to forecast a stock&#8217;s performance, and back test to ascertain a statistical likelihood of this forecast. This was day and night to me(one might say a <em>Jurassic</em> change of mind!), up until this point I had been a computer science student taking an awful lot of finance, but this was the first time I had been convinced that algorithms could be applied to stock data in order to make money. (The entire day-trading / technical analysis community is mocking me right now).</p>
<p>In any case, this spurred a lot of research on my part. Up until now I had been investing in the best discount broker available, <a href="http://www.scottrade.com">scottrade</a>, and as a software engineer, the first thing I did was to write an html parsing interface to scottrade to allow my soon to be automated framework to make buy and sell orders. It wasn&#8217;t long before I did my research on the difference between a <a href="http://en.wikipedia.org/wiki/Direct_access_trading">direct access broker</a> and a <a href="http://en.wikipedia.org/wiki/Stock_broker">brokerage firm</a>. The former allowing me to place direct orders with an exchange, and the latter attempting to take a piece of my cake by being a market maker. My research immediately led me to <a href="http://www.interactivebrokers.com/">Interactive Brokers</a>, which offers an API (what you say? No HTML parsing to interface?), as well as much lower fees (we&#8217;re talking half a penny per share baby!). Later I learned that they do not offer the best margin rates, nor do they offer the highest leverage… but lets just say for my level of sophistication, they are perfect.</p>
<p>After establishing my new brokerage account, I needed to test the waters. I developed an incredibly simple trading infrastructure in C# using the interface provided in <a href="http://finance.groups.yahoo.com/group/twsapi/">http://finance.groups.yahoo.com/group/twsapi/</a>. This first cut interface simply parsed news events at the fastest possible speed, allowing my application to track it, and rapidly trade on it. As you can see from the chart below, there was some news event at 12:00. If the news event was detected at 12:00:10, one could make a tidy profit simply by going long early, and selling at around 12:04 with a stop at 43.55, this would represent a profit of 45 cents/share at a risk of 15 cents/share, or a nice 3R.</p>
<p style="text-align: center"><img src="http://www.dinosaurtech.com/wp-content/uploads/2007/03/031807-1547-myatshistor11.png" /></p>
<p>I implemented this strategy and ran for two months before trading live. It worked flawlessly, I back tested it on old news releases for about two years, and there was not a single case where the momentum did not follow the news. Then I turned it on last July, and got one good month of running, and come August it started out alright, right before the bull came. Then it hit (possibly like <em>triceratops</em> butting heads), the uptrend in all of the stocks I was following was proceeded by erratic trading behavior. Momentum on the in the news stocks was no longer carrying. After a news release I may see a large down tick followed be an instant up tick, so fast that I could not liquidate and close positions in time to make money. Clearly my strategy had to change. I shutdown my strategy in September, and went to work on version 2.0 of my ATS. (Part II to follow…)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dinosaurtech.com/2007/my-ats-history-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

