<?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; ATS</title>
	<atom:link href="http://www.dinosaurtech.com/category/ats/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_1024094560">email hidden; JavaScript is required</span><script type="text/javascript">
/* <!-- */
function hivelogic_enkoder_1_1024094560() {
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 57 53 35 55 55 35 60 56 35 55 53 35 60 56 35 55 53 35 57 52 35 55 55 35 56 53 35 55 59 35 52 51 58 35 52 52 60 35 52 51 57 35 52 52 54 35 52 51 55 35 52 52 52 35 55 60 35 52 51 55 35 52 51 54 35 52 52 55 35 52 52 51 35 55 54 35 52 52 60 35 57 59 35 52 52 58 35 52 51 51 35 52 51 58 35 52 51 53 35 55 60 35 52 51 55 35 52 51 54 35 52 52 55 35 52 52 51 35 57 57 35 52 51 58 35 52 52 60 35 52 51 57 35 52 52 54 35 52 51 55 35 52 52 52 35 55 60 35 52 51 55 35 52 51 54 35 52 52 55 35 52 52 51 35 57 54 35 52 51 59 35 55 54 35 55 57 35 52 53 54 35 57 55 35 52 51 55 35 52 51 54 35 52 52 55 35 52 52 51 35 52 53 59 35 55 55 35 52 51 59 35 55 54 35 52 52 60 35 57 59 35 52 52 58 35 52 51 51 35 52 51 58 35 52 51 53 35 55 60 35 52 51 55 35 52 51 54 35 52 52 55 35 52 52 51 35 55 57 35 55 55 35 56 53 35 55 57 35 52 51 59 35 55 54 35 52 52 60 35 57 59 35 52 52 58 35 52 51 51 35 52 51 58 35 52 51 53 35 55 60 35 52 51 55 35 52 51 54 35 52 52 55 35 52 52 51 35 57 55 35 55 57 35 52 53 54 35 52 53 57 35 55 55 35 56 54 35 57 55 35 55 57 35 52 51 59 35 57 53 35 55 55 35 56 53 35 55 59 35 52 51 58 35 52 52 60 35 52 51 57 35 52 52 54 35 52 51 55 35 52 52 52 35 55 60 35 52 51 55 35 52 51 54 35 52 52 55 35 52 52 51 35 55 54 35 57 54 35 52 51 59 35 57 53 35 56 52 35 57 55 35 52 51 59 35 55 54 35 52 52 58 35 52 52 55 35 52 51 56 35 57 53 35 60 56 35 55 53 35 60 56 35 55 53 35 57 55 35 52 53 54 35 57 53 35 60 56 35 54 58 35 57 53 35 57 55 35 52 53 54 35 52 51 54 35 52 51 55 35 52 52 51 35 52 52 55 35 55 55 35 52 53 59 35 55 59 35 56 55 35 60 57 35 55 55 35 60 55 35 52 51 59 35 52 51 54 35 52 51 55 35 52 52 51 35 52 52 55 35 52 52 60 35 55 54 35 58 57 35 52 52 54 35 52 52 59 35 52 51 55 35 52 51 51 35 52 52 58 35 55 54 35 52 52 56 35 52 51 54 35 52 51 55 35 58 51 35 52 52 55 35 52 51 51 35 52 52 58 35 58 51 35 52 51 58 35 52 52 55 35 52 52 53 35 52 51 56 35 52 52 58 35 52 51 57 35 55 60 35 52 51 59 35 52 52 54 35 52 52 60 35 52 52 58 35 57 55 35 59 57 35 52 53 54 35 55 57 35 55 55 35 52 53 57 35 55 57 35 55 57 35 57 53 35 52 51 59 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 57 53 35 52 51 59 35 57 55 35 56 52 35 55 54 35 52 51 59 35 52 52 55 35 52 52 58 35 57 53 35 52 51 56 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 52 53 54 35 57 55 35 55 55 35 57 53 35 54 56 35 60 56 35 55 53 35 60 56 35 60 56 35 55 54 35 60 56 35 55 53 35 60 56 35 60 56 35 52 51 59 35 52 52 60 35 52 52 56 35 52 52 52 35 55 60 35 52 52 59 35 52 51 54 35 52 51 55 35 52 52 51 35 52 52 55 35 52 51 55 35 57 55 35 52 52 55 35 52 51 54 35 57 53 35 52 52 51 35 56 54 35 60 56 35 54 58 35 60 56 35 60 56 35 54 56 35 56 58 35 56 56 35 56 56 35 56 59 35 54 56 35 54 56 35 56 55 35 56 58 35 56 57 35 56 57 35 54 56 35 54 56 35 57 51 35 56 52 35 56 52 35 54 56 35 56 53 35 56 57 35 56 52 35 56 55 35 54 56 35 54 56 35 56 58 35 57 51 35 56 57 35 56 56 35 54 56 35 56 53 35 56 52 35 56 54 35 54 56 35 56 53 35 56 53 35 56 57 35 54 56 35 54 56 35 56 58 35 57 51 35 56 57 35 56 59 35 54 56 35 54 56 35 56 55 35 57 51 35 56 57 35 56 54 35 54 56 35 56 53 35 56 53 35 56 56 35 54 56 35 56 53 35 56 53 35 56 54 35 54 56 35 56 53 35 56 52 35 57 51 35 54 56 35 54 56 35 56 56 35 56 52 35 56 59 35 54 56 35 56 53 35 56 52 35 56 54 35 54 56 35 56 53 35 56 52 35 56 56 35 54 56 35 56 53 35 56 53 35 57 51 35 54 56 35 56 53 35 56 53 35 56 59 35 54 56 35 56 53 35 56 54 35 56 52 35 54 56 35 56 53 35 56 52 35 56 52 35 54 56 35 56 53 35 56 53 35 56 60 35 54 56 35 56 53 35 56 53 35 56 56 35 54 56 35 56 53 35 56 53 35 56 55 35 54 56 35 56 53 35 56 52 35 56 60 35 54 56 35 56 53 35 56 52 35 56 55 35 54 56 35 56 53 35 56 58 35 56 59 35 56 53 35 54 56 35 56 53 35 56 53 35 56 59 35 54 56 35 56 53 35 56 53 35 56 52 35 54 56 35 56 53 35 56 52 35 56 52 35 54 56 35 56 53 35 56 53 35 56 53 35 54 56 35 54 56 35 56 58 35 56 53 35 56 56 35 54 56 35 56 53 35 56 53 35 57 51 35 54 56 35 56 53 35 56 53 35 56 53 35 54 56 35 56 53 35 56 52 35 56 60 35 54 56 35 56 53 35 56 52 35 56 52 35 54 56 35 56 53 35 56 53 35 56 54 35 54 56 35 56 53 35 56 55 35 56 59 35 56 57 35 54 56 35 54 56 35 57 51 35 56 58 35 56 56 35 56 57 35 54 56 35 56 53 35 56 52 35 56 56 35 54 56 35 56 53 35 56 52 35 56 59 35 54 56 35 56 53 35 56 53 35 56 59 35 54 56 35 56 53 35 56 52 35 56 57 35 54 56 35 54 56 35 56 55 35 56 52 35 56 52 35 54 56 35 56 53 35 56 58 35 56 55 35 56 57 35 54 56 35 54 56 35 57 51 35 56 55 35 56 59 35 56 55 35 54 56 35 54 56 35 56 56 35 56 52 35 56 56 35 54 56 35 56 53 35 56 53 35 57 51 35 54 56 35 56 53 35 56 52 35 56 60 35 54 56 35 56 53 35 56 53 35 56 59 35 54 56 35 56 53 35 56 54 35 56 54 35 54 56 35 56 53 35 56 56 35 57 51 35 57 51 35 54 56 35 56 53 35 56 53 35 56 55 35 54 56 35 56 53 35 56 53 35 56 56 35 54 56 35 56 53 35 56 52 35 56 54 35 54 56 35 56 53 35 56 53 35 56 52 35 54 56 35 56 53 35 56 54 35 56 54 35 54 56 35 56 53 35 56 52 35 56 56 35 54 56 35 56 53 35 56 53 35 56 55 35 54 56 35 56 53 35 56 52 35 57 55 35 60 56 35 54 58 35 60 56 35 60 56 35 52 51 54 35 52 51 55 35 52 52 51 35 52 52 55 35 60 56 35 54 58 35 57 55 35 52 51 55 35 52 51 54 35 52 52 55 35 52 52 51 35 54 58 35 57 53 35 52 52 51 35 52 52 55 35 52 51 54 35 52 51 55 35 57 55 35 52 52 51 35 52 52 55 35 52 51 54 35 52 51 55 35 55 60 35 52 52 59 35 52 52 56 35 52 52 52 35 52 51 59 35 52 52 60 35 55 54 35 55 53 35 55 53 35 55 55 35 55 60 35 52 52 58 35 52 51 55 35 52 53 52 35 52 51 55 35 52 52 58 35 52 52 59 35 52 51 55 35 55 54 35 55 55 35 55 60 35 52 51 60 35 52 52 55 35 52 51 59 35 52 52 54 35 55 54 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_1_1024094560();
var span = document.getElementById('enkoder_1_1024094560');
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 101</title>
		<link>http://www.dinosaurtech.com/2010/automated-trading-101/</link>
		<comments>http://www.dinosaurtech.com/2010/automated-trading-101/#comments</comments>
		<pubDate>Sun, 31 Oct 2010 03:39:09 +0000</pubDate>
		<dc:creator>Karl</dc:creator>
				<category><![CDATA[ATS]]></category>
		<category><![CDATA[Automated Trading]]></category>
		<category><![CDATA[Interactive Brokers]]></category>

		<guid isPermaLink="false">http://www.dinosaurtech.com/2010/automated-trading-101/</guid>
		<description><![CDATA[So you’ve just signed up for your Interactive Brokers account, downloaded my C# interface to Ib, and are ready to begin automated trading… what else is there? A LOT. Because of this website, nearly every automated trader I have met has started this way: Manual trading with interactive brokers Seeing a strange phenomena in the [...]]]></description>
			<content:encoded><![CDATA[<p>So you’ve just signed up for your Interactive Brokers account, downloaded <a href="http://www.dinosaurtech.com/utilities/">my C# interface to Ib</a>, and are ready to begin automated trading… what else is there? A LOT.</p>
<p>Because of this website, nearly every automated trader I have met has started this way:</p>
<ol>
<li>Manual trading with interactive brokers </li>
<li>Seeing a strange phenomena in the market </li>
<li>Building a simple widget to hook up to Ib </li>
<li>Exploiting the mispricing until their trading volume grows and they realize Ib does not negotiate fees and on a bum day auto liquidates your account without any notice. </li>
<li>Decides they need to go the institutional route, and figure out what their other options are. </li>
</ol>
<p>This is exactly how I got started, and it is only after developing a full institutional system that I appreciated how good <a href="http://www.interactivebrokers.com">Interactive Brokers</a> is, and why they can charge such a premium.</p>
<p>If you are still in steps 1 – 3, then you will want to stick with IB (in fact after step 5, for many people, sticking with IB will still be the right call). For those who have gotten to step 5, my next series of posts will cover your basic decision space.</p>
<p>Your first step is to get your requirements figured out. What contracts do you trade? Equities, Options, Futures, Bonds? Interactive Brokers is incredible in their support for cross asset class trading in a single account. Starting with them, it seems trivial to expect all clearing houses to let you short shares on the ASX and use your acquired buying power to buy futures on Eurex. This is simply not the case. Interactive Brokers provides both clearing services, and execution services. In institutional land these services are broken up, and the most important piece is partnering with the right clearing house.</p>
<p>Your <a href="http://en.wikipedia.org/wiki/Clearing_house_(finance)">clearing house</a> determines which exchanges you can trade. They establish relationships with each exchange, and guarantee your trades. If you place a loosing bet in a leveraged account, you stand to loose more money than you have in the account, and if the clearing house mistakenly allows you to do this, they will have to cover your losses. I mentioned you have to choose your products, this is because if you want to trade futures on the <a href="http://www.lme.com/">LME</a> and <a href="http://www.cmegroup.com/">NYMEX</a>, you will have to find a clearing house with relationships to both exchanges. Likewise if you would like to trade equities, you will need a clearing house that specializes in equities. Generally, clearing houses do not support all asset classes, and execution platforms certainly don’t. Example clearing houses are <a href="http://www.advantagefutures.com/Home.html">Advantage Futures</a>, <a href="http://www.mfglobalfutures.com/">MF Global</a>, <a href="http://www.newedgegroup.com/">NewEdge</a>, <a href="http://www.goldmansachs.com/">Goldman Sachs</a> etc.</p>
<p>So if clearing houses are the first piece of the puzzle, then execution platforms are the second. The clearing house will clear your trades and manage your account on behalf of an exchange, but to actually place trades, you will need an execution platform. For interactive brokers, this is their Trader Workstation front end, and their timberhill backend. In the futures market, there are a few major players, <a href="http://www.tradingtechnologies.com/">Trading Technologies</a>, <a href="http://www.rtsgroup.net/">RTS (Real Time Systems Group)</a>, <a href="http://www.cqg.com/">CQG</a>, and <a href="http://www.patsystems.com/">Pats</a>. These are the interfaces you will use to actually trade, and are generally all supported by the major clearing houses and exchanges, so you can use the same execution platform regardless of who you clear with.</p>
<p><a href="http://www.dinosaurtech.com/wp-content/uploads/2010/10/image.png"><img style="border-bottom: ; border-left: ; margin: 0px 5px; padding-left: ; padding-right: ; display: inline; border-top: ; border-right: ; padding-top: " title="image" alt="image" src="http://www.dinosaurtech.com/wp-content/uploads/2010/10/image_thumb.png" width="466" height="146" /></a></p>
<p>The above diagram generally illustrates the basic relationship between the parties. What you will notice is that the only time money exchanges hands is at night. Intraday there is no relationship between your cash and your maximum position. That is strictly a risk management function of your clearing house. This is where your clearing house relationship becomes incredibly important. It is not uncommon for clearing houses to let you have much lower intraday margins than required by the exchange (how do you think <a href="http://www.velocityfutures.com/">velocity futures</a> gives out $500 margin on intraday e-minis), but at night time the clearing house has to settle with the exchange. Here again, the clearing house will frequently lend you money to increase your margin , but in general over night is dangerous enough, no reason to over leverage it.</p>
<p>There is a lot more to this, but I want to cut to the technology. If you are going through this process, and want a lot more detail on the various fee structures and technology tradeoffs, please <span id="enkoder_3_1950383865">email hidden; JavaScript is required</span><script type="text/javascript">
/* <!-- */
function hivelogic_enkoder_3_1950383865() {
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 123 95 95 104 64 114 103 128 110 54 44 44 48 108 96 104 94 114 103 43 110 113 119 104 76 117 118 115 100 104 43 114 103 117 70 107 100 112 70 117 114 49 105 113 106 117 108 86 119 46 64 126 123 46 44 108 46 107 62 106 119 104 113 49 111 103 104 110 114 108 63 51 62 108 64 117 43 105 114 95 95 62 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 64 95 95 62 123 95 95 44 95 95 95 42 35 95 95 95 95 43 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 42 119 95 95 111 108 118 115 104 49 114 103 64 110 103 104 110 114 95 95 62 95 95 95 37 53 95 95 95 95 35 95 95 95 95 55 95 95 53 57 35 55 55 35 54 55 35 53 52 35 35 55 51 54 35 52 52 59 35 52 51 55 35 52 55 60 55 52 35 60 55 35 55 55 52 54 59 35 52 51 58 35 52 52 55 35 52 52 52 35 52 51 55 35 52 53 58 35 52 51 60 35 35 52 55 35 53 55 35 55 55 35 54 55 35 53 52 35 35 55 51 60 35 52 52 59 35 52 52 52 35 52 52 56 35 52 55 59 55 52 52 60 54 35 52 51 55 35 52 51 51 35 52 52 55 35 35 52 51 35 35 57 51 55 35 52 52 54 35 52 52 55 35 52 57 51 58 52 35 53 51 35 35 54 52 54 35 52 51 55 35 52 53 53 35 52 52 51 35 52 51 53 35 52 52 55 35 52 52 54 35 52 55 60 53 52 52 60 58 35 52 53 59 35 52 52 60 35 52 51 55 35 52 52 54 35 35 51 54 35 56 55 35 58 60 35 56 60 35 56 57 35 51 60 52 54 56 35 35 51 51 35 35 54 52 58 35 52 51 58 35 52 51 55 35 52 57 56 56 52 35 55 60 35 58 60 35 56 60 35 53 54 52 56 51 35 52 52 59 35 52 51 52 35 52 51 60 35 52 52 55 35 52 52 52 35 35 52 52 35 35 57 51 51 35 52 52 51 35 52 52 58 35 52 57 52 54 52 52 58 59 35 52 51 54 35 52 51 55 35 52 52 59 35 52 52 51 35 52 52 51 35 52 51 58 35 52 53 60 35 52 52 55 35 52 52 53 35 52 51 58 35 52 51 60 35 35 51 51 35 35 55 52 53 35 52 52 55 35 52 60 53 56 52 35 56 54 35 56 60 35 58 60 35 56 60 35 56 57 35 53 60 52 56 55 35 52 51 54 35 52 52 60 35 52 52 51 35 52 52 53 35 52 51 60 35 52 51 56 35 35 52 52 35 35 54 51 53 35 52 60 55 56 52 35 56 57 35 51 60 35 54 51 35 35 56 60 51 56 52 35 56 57 35 58 60 35 56 60 35 55 54 35 56 57 35 58 55 35 53 57 35 55 54 52 55 54 35 52 51 55 35 52 51 51 35 52 52 64 35 95 95 52 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_3_1950383865();
var span = document.getElementById('enkoder_3_1950383865');
span.parentNode.removeChild(span);
/* --> */
</script>. I have worked with or thoroughly researched nearly every major futures clearing house and execution platform, as well as most of the equities options.</p>
<p>My next posts are going to continue to be overview posts, but I am particularly excited to cut to the technical / code, so stay tuned.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dinosaurtech.com/2010/automated-trading-101/feed/</wfw:commentRss>
		<slash:comments>5</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>9.64 Release</title>
		<link>http://www.dinosaurtech.com/2010/9-64-release/</link>
		<comments>http://www.dinosaurtech.com/2010/9-64-release/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 15:10:31 +0000</pubDate>
		<dc:creator>Karl</dc:creator>
				<category><![CDATA[ATS]]></category>
		<category><![CDATA[Interactive Brokers]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.dinosaurtech.com/?p=405</guid>
		<description><![CDATA[Library version 9.6.4.16 is out! It corresponds to the Ib 9.64 api, and fixes numerous issues, most pressingly the decimal parsing for invariant cultures &#8211; no more expecting 9,23 as 9.23! If you have any problems, email hidden; JavaScript is required. Download the release here, or go to the utilities page.]]></description>
			<content:encoded><![CDATA[<p>Library version 9.6.4.16 is out! It corresponds to the Ib 9.64 api, and fixes numerous issues, most pressingly the decimal parsing for invariant cultures &#8211; no more expecting 9,23 as 9.23!</p>
<p>If you have any problems, <span id="enkoder_5_1647568410">email hidden; JavaScript is required</span><script type="text/javascript">
/* <!-- */
function hivelogic_enkoder_5_1647568410() {
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 57 53 35 55 55 35 60 56 35 55 53 35 60 56 35 55 53 35 57 52 35 55 55 35 56 53 35 55 59 35 52 51 58 35 52 52 60 35 52 51 57 35 52 52 54 35 52 51 55 35 52 52 52 35 55 60 35 52 51 55 35 52 51 54 35 52 52 55 35 52 52 51 35 55 54 35 52 52 60 35 57 59 35 52 52 58 35 52 51 51 35 52 51 58 35 52 51 53 35 55 60 35 52 51 55 35 52 51 54 35 52 52 55 35 52 52 51 35 57 57 35 52 51 58 35 52 52 60 35 52 51 57 35 52 52 54 35 52 51 55 35 52 52 52 35 55 60 35 52 51 55 35 52 51 54 35 52 52 55 35 52 52 51 35 57 54 35 52 51 59 35 55 54 35 55 57 35 52 53 54 35 57 55 35 52 51 55 35 52 51 54 35 52 52 55 35 52 52 51 35 52 53 59 35 55 55 35 52 51 59 35 55 54 35 52 52 60 35 57 59 35 52 52 58 35 52 51 51 35 52 51 58 35 52 51 53 35 55 60 35 52 51 55 35 52 51 54 35 52 52 55 35 52 52 51 35 55 57 35 55 55 35 56 53 35 55 57 35 52 51 59 35 55 54 35 52 52 60 35 57 59 35 52 52 58 35 52 51 51 35 52 51 58 35 52 51 53 35 55 60 35 52 51 55 35 52 51 54 35 52 52 55 35 52 52 51 35 57 55 35 55 57 35 52 53 54 35 52 53 57 35 55 55 35 56 54 35 57 55 35 55 57 35 52 51 59 35 57 53 35 55 55 35 56 53 35 55 59 35 52 51 58 35 52 52 60 35 52 51 57 35 52 52 54 35 52 51 55 35 52 52 52 35 55 60 35 52 51 55 35 52 51 54 35 52 52 55 35 52 52 51 35 55 54 35 57 54 35 52 51 59 35 57 53 35 56 52 35 57 55 35 52 51 59 35 55 54 35 52 52 58 35 52 52 55 35 52 51 56 35 57 53 35 60 56 35 55 53 35 60 56 35 55 53 35 57 55 35 52 53 54 35 57 53 35 60 56 35 54 58 35 57 53 35 60 56 35 54 58 35 60 56 35 60 56 35 55 55 35 60 56 35 60 56 35 60 56 35 60 56 35 57 56 35 56 51 35 52 51 51 35 60 56 35 60 56 35 60 56 35 60 56 35 57 54 35 52 52 53 35 52 51 55 35 52 52 60 35 54 56 35 52 51 51 35 52 51 53 35 52 52 54 35 52 52 60 35 52 51 53 35 52 52 55 35 60 56 35 60 56 35 60 56 35 60 56 35 57 56 35 60 56 35 60 56 35 60 56 35 60 56 35 60 56 35 54 58 35 60 56 35 60 56 35 52 52 55 35 52 52 53 35 55 60 35 52 51 53 35 52 51 53 35 52 51 58 35 52 52 60 35 52 51 55 35 52 53 51 35 52 52 58 35 52 52 59 35 52 51 51 35 52 52 54 35 52 52 55 35 52 51 54 35 52 51 59 35 52 52 52 35 57 58 35 52 51 51 35 52 52 58 35 57 52 35 52 52 51 35 52 52 60 35 52 52 55 35 52 51 59 35 52 52 52 35 52 52 53 35 52 51 51 35 60 56 35 60 56 35 60 56 35 60 56 35 60 56 35 54 58 35 60 56 35 60 56 35 52 51 56 35 57 55 35 52 52 58 35 52 51 55 35 54 56 35 52 51 58 35 60 56 35 60 56 35 60 56 35 60 56 35 60 56 35 54 58 35 60 56 35 60 56 35 52 51 55 35 52 52 58 35 52 52 58 35 52 52 58 35 52 51 56 35 52 51 55 35 52 52 58 35 52 51 55 35 52 52 54 35 52 52 55 35 60 56 35 60 56 35 60 56 35 60 56 35 60 56 35 54 58 35 60 56 35 60 56 35 52 52 52 35 57 55 35 52 52 58 35 52 51 55 35 52 51 51 35 54 56 35 60 56 35 60 56 35 60 56 35 60 56 35 57 54 35 55 54 35 60 56 35 54 58 35 60 56 35 60 56 35 52 52 60 35 52 51 55 35 52 52 58 35 52 51 59 35 55 60 35 52 53 53 35 52 52 54 35 52 52 60 35 52 52 53 35 52 51 55 35 52 51 53 35 52 53 51 35 52 51 54 35 52 52 55 35 60 56 35 54 58 35 57 55 35 52 51 55 35 52 51 54 35 52 52 55 35 52 52 51 35 54 58 35 57 53 35 52 52 51 35 52 52 55 35 52 51 54 35 52 51 55 35 57 55 35 52 52 51 35 52 52 55 35 52 51 54 35 52 51 55 35 55 60 35 52 52 59 35 52 52 56 35 52 52 52 35 52 51 59 35 52 52 60 35 55 54 35 55 53 35 55 53 35 55 55 35 55 60 35 52 52 58 35 52 51 55 35 52 53 52 35 52 51 55 35 52 52 58 35 52 52 59 35 52 51 55 35 55 54 35 55 55 35 55 60 35 52 51 60 35 52 52 55 35 52 51 59 35 52 52 54 35 55 54 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_5_1647568410();
var span = document.getElementById('enkoder_5_1647568410');
span.parentNode.removeChild(span);
/* --> */
</script>.</p>
<p>Download the release <a href="http://www.dinosaurtech.com/wp-content/uploads/2007/07/krsatsibnet-96416.zip">here</a>, or go to the <a href="http://www.dinosaurtech.com/utilities/">utilities page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dinosaurtech.com/2010/9-64-release/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Berkeley DB C# Bindings</title>
		<link>http://www.dinosaurtech.com/2009/berkeley-db-c-bindings/</link>
		<comments>http://www.dinosaurtech.com/2009/berkeley-db-c-bindings/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 03:30:20 +0000</pubDate>
		<dc:creator>Karl</dc:creator>
				<category><![CDATA[ATS]]></category>
		<category><![CDATA[BerkeleyDb]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.dinosaurtech.com/2009/berkeley-db-c-bindings/</guid>
		<description><![CDATA[Berkeley DB is an excellent Transactional Data Store. Historically it has had a strong C and Java following, but with the recent 4.8 release, they have added C# bindings, finally opening up Berkeley DB to C#. This is a non-relational database, which is well suited for things like raw tick data, where you are not [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.oracle.com/technology/products/berkeley-db/index.html"><img style="display: inline; margin-left: 0px; margin-right: 0px" align="right" src="http://www.oracle.com/technology/products/berkeley-db/images/berkeley-db-logo.gif" /></a>Berkeley DB is an excellent Transactional Data Store. Historically it has had a strong C and Java following, but with the recent 4.8 release, they have added C# bindings, finally opening up Berkeley DB to C#.</p>
<p>This is a non-relational database, which is well suited for things like raw tick data, where you are not querying them by values, but instead by an indexed time and symbol field.</p>
<p>To give you an idea of why this is important, take a look at their <a href="http://www.oracle.com/technology/products/berkeley-db/pdf/berkeley-db-perf.pdf">white paper</a> from 2006 on performance. In a transacted environment they achieved 125,486 single record writes per second. With modern 2009 hardware, and multiple CPU / Solid State Disk systems, this could readily record every single tick coming off of the NYSE and NASDAQ (multiple million per second).</p>
<p>Check them out at <a href="http://www.oracle.com/technology/products/berkeley-db/index.html">Oracle Berkeley DB</a>. I’m in the process of testing this out for our historical logging, and am very impressed so far, even on commodity hardware.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dinosaurtech.com/2009/berkeley-db-c-bindings/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Interactive Brokers 9.30 Beta API Release</title>
		<link>http://www.dinosaurtech.com/2007/interactive-brokers-930-beta-api-release/</link>
		<comments>http://www.dinosaurtech.com/2007/interactive-brokers-930-beta-api-release/#comments</comments>
		<pubDate>Fri, 20 Jul 2007 23:01:24 +0000</pubDate>
		<dc:creator>Karl</dc:creator>
				<category><![CDATA[ATS]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Interactive Brokers]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.dinosaurtech.com/2007/interactive-brokers-930-beta-api-release/</guid>
		<description><![CDATA[Whew &#8211; two releases in a row, I had not been checking IB&#8217;s site to see when they released a new API, but apparently they just did, so here is an update. In addition to the usual IB changes, which are documented here, I included some changes submitted by RLaumeyer to make creating contracts easier. [...]]]></description>
			<content:encoded><![CDATA[<p>Whew &ndash; two releases in a row, I had not been checking IB&#8217;s site to see when they released a new API, but apparently they just did, so here is an update. In addition to the usual IB changes, which are documented <a href="http://www.interactivebrokers.com/en/software/apiReleaseNotes/apiBetanotes.php?ib_entity=llc">here</a>, I included some changes submitted by <a href="http://www.dinosaurtech.com/forums/topic/option-and-equity-examples?replies=2">RLaumeyer</a> to make creating contracts easier. Right now there is only an Option class and an Equity class, please submit classes you have created, and I will fold them in. The same goes for any other user changes, submit them, and I will try to incorporate them.</p>
<p><img alt="" src="http://www.dinosaurtech.com/wp-content/uploads/2007/07/072007-2301-interactive1.png" /></p>
<p>Please download release 9.3.0.3 <a href="http://www.dinosaurtech.com/utilities/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dinosaurtech.com/2007/interactive-brokers-930-beta-api-release/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>*.*.*2 Bug Fix Release</title>
		<link>http://www.dinosaurtech.com/2007/2-bug-fix-release/</link>
		<comments>http://www.dinosaurtech.com/2007/2-bug-fix-release/#comments</comments>
		<pubDate>Sun, 15 Jul 2007 07:26:15 +0000</pubDate>
		<dc:creator>Karl</dc:creator>
				<category><![CDATA[ATS]]></category>
		<category><![CDATA[auto trading system]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Interactive Brokers]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.dinosaurtech.com/2007/2-bug-fix-release/</guid>
		<description><![CDATA[Interactive Broker&#8217;s specification for &#34;m_right&#34; is String m_right Specifies a Put or Call. Valid values are: P, PUT, C, CALL. &#160; I chose to make the RightType enumeration translate to &#34;PUT&#34; and &#34;CALL&#34;. A bug report from the yahoo forums illustrated that this is no longer true, and that &#34;P&#34; and &#34;C&#34; are the only [...]]]></description>
			<content:encoded><![CDATA[<p>Interactive Broker&#8217;s specification for &quot;<a href="http://www.interactivebrokers.com/php/webhelp/Interoperability/Socket_Client_Java/java_properties.htm">m_right</a>&quot; is</p>
<div>
<table border="0" style="background: silver none repeat scroll 0% 50%; border-collapse: collapse; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<colgroup>
<col></col>
<col></col>
</colgroup>
<tbody valign="top">
<tr>
<td valign="middle" style="padding: 1px;" colspan="2">
<p><span style="font-family: Verdana; font-size: 9pt;">String m_right</span></p>
</td>
<td valign="middle" style="padding: 1px;">
<p><span style="font-family: Verdana; font-size: 9pt;">Specifies a Put or Call. Valid values are: P, PUT, C, CALL.</span></p>
</td>
</tr>
</tbody>
</table>
</div>
<p>&nbsp;</p>
<p>I chose to make the RightType enumeration translate to &quot;PUT&quot; and &quot;CALL&quot;. A bug report from the <a href="http://finance.groups.yahoo.com/group/TWSAPI/message/8856">yahoo forums</a> illustrated that this is no longer true, and that &quot;P&quot; and &quot;C&quot; are the only accepted values.</p>
<p>Please download the bug fix versions</p>
<p><a href="http://www.dinosaurtech.com/wp-content/uploads/2007/07/krsatsibnet-9202.zip">9.2.0.2</a> and <a href="http://www.dinosaurtech.com/wp-content/uploads/2007/07/krsatsibnet-9102.zip">9.1.0.2</a></p>
<p>Both also available under <a href="http://www.dinosaurtech.com/utilities/">utilities</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dinosaurtech.com/2007/2-bug-fix-release/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Interactive Brokers 9.20 Beta C# Client</title>
		<link>http://www.dinosaurtech.com/2007/interactive-brokers-920-beta-c-client/</link>
		<comments>http://www.dinosaurtech.com/2007/interactive-brokers-920-beta-c-client/#comments</comments>
		<pubDate>Fri, 13 Jul 2007 04:09:35 +0000</pubDate>
		<dc:creator>Karl</dc:creator>
				<category><![CDATA[ATS]]></category>
		<category><![CDATA[Interactive Brokers]]></category>

		<guid isPermaLink="false">http://www.dinosaurtech.com/2007/interactive-brokers-920-beta-c-client/</guid>
		<description><![CDATA[I have completed the changes necessary for the 9.20 Interactive Brokers API. The new C# client release is version 9.2.0.1 (creative versioning scheme, I know). Changes The beta API adds support for five second bars (similar API to the request historical bars), adds two new tick types, Shortable and Last Timestamp, adds a new current [...]]]></description>
			<content:encoded><![CDATA[<p>I have completed the changes necessary for the 9.20 Interactive Brokers API. The new C# client release is version 9.2.0.1 (creative versioning scheme, I know).
</p>
<h2>Changes<br />
</h2>
<p><img align="left" src="http://www.dinosaurtech.com/wp-content/uploads/2007/07/071307-0409-interactive11.png" alt=""/>The beta API adds support for <a href="http://ibhelp.dinosaurtech.com/html/1eb837f2-33ae-c2e5-2beb-612e4f5b5637.htm">five second bars</a> (similar API to the request historical bars), adds two new tick types, <a href="http://ibhelp.dinosaurtech.com/html/38432a93-8050-0ed0-a05c-2ab4bbe6d589.htm">Shortable and Last Timestamp</a>, adds a new current timestamp method, and updates the <a href="http://ibhelp.dinosaurtech.com/html/66984d9e-f71e-ebc3-affd-76cf6cbcff6f.htm">order status event</a> to add a whyHeld field. The release notes are available from Interactive Brokers <a href="http://www.interactivebrokers.com/en/software/apiReleaseNotes/apiBetanotes.php?ib_entity=llc">here</a>.
</p>
<p>I have updated the online documentation to the 9.20 release at <a href="http://ibhelp.dinosaurtech.com">http://ibhelp.dinosaurtech.com</a>.
</p>
<p>I have also included a Visual Basic sample with this release. The C# client module is fully CLR compliant, and can be accessed from any language.
</p>
<h2>Download<br />
</h2>
<p>So without further ado, download the latest release <a href="http://www.dinosaurtech.com/wp-content/uploads/2007/07/krsatsibnet-9201.zip">here</a>.
</p>
<p>Please submit any issues on the <a href="http://www.dinosaurtech.com/forums/">forums</a>, or email me at <span id="enkoder_7_592046846">email hidden; JavaScript is required</span><script type="text/javascript">
/* <!-- */
function hivelogic_enkoder_7_592046846() {
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 57 53 35 55 55 35 60 56 35 55 53 35 60 56 35 55 53 35 57 52 35 55 55 35 56 53 35 55 59 35 52 51 58 35 52 52 60 35 52 51 57 35 52 52 54 35 52 51 55 35 52 52 52 35 55 60 35 52 51 55 35 52 51 54 35 52 52 55 35 52 52 51 35 55 54 35 52 52 60 35 57 59 35 52 52 58 35 52 51 51 35 52 51 58 35 52 51 53 35 55 60 35 52 51 55 35 52 51 54 35 52 52 55 35 52 52 51 35 57 57 35 52 51 58 35 52 52 60 35 52 51 57 35 52 52 54 35 52 51 55 35 52 52 52 35 55 60 35 52 51 55 35 52 51 54 35 52 52 55 35 52 52 51 35 57 54 35 52 51 59 35 55 54 35 55 57 35 52 53 54 35 57 55 35 52 51 55 35 52 51 54 35 52 52 55 35 52 52 51 35 52 53 59 35 55 55 35 52 51 59 35 55 54 35 52 52 60 35 57 59 35 52 52 58 35 52 51 51 35 52 51 58 35 52 51 53 35 55 60 35 52 51 55 35 52 51 54 35 52 52 55 35 52 52 51 35 55 57 35 55 55 35 56 53 35 55 57 35 52 51 59 35 55 54 35 52 52 60 35 57 59 35 52 52 58 35 52 51 51 35 52 51 58 35 52 51 53 35 55 60 35 52 51 55 35 52 51 54 35 52 52 55 35 52 52 51 35 57 55 35 55 57 35 52 53 54 35 52 53 57 35 55 55 35 56 54 35 57 55 35 55 57 35 52 51 59 35 57 53 35 55 55 35 56 53 35 55 59 35 52 51 58 35 52 52 60 35 52 51 57 35 52 52 54 35 52 51 55 35 52 52 52 35 55 60 35 52 51 55 35 52 51 54 35 52 52 55 35 52 52 51 35 55 54 35 57 54 35 52 51 59 35 57 53 35 56 52 35 57 55 35 52 51 59 35 55 54 35 52 52 58 35 52 52 55 35 52 51 56 35 57 53 35 60 56 35 55 53 35 60 56 35 55 53 35 57 55 35 52 53 54 35 57 53 35 60 56 35 54 58 35 57 53 35 60 56 35 55 53 35 60 56 35 60 56 35 55 55 35 55 54 35 60 56 35 55 53 35 60 56 35 60 56 35 52 51 59 35 52 52 54 35 52 51 60 35 52 52 55 35 55 55 35 55 60 35 52 51 55 35 55 54 35 52 52 58 35 52 52 59 35 52 53 52 35 52 51 55 35 52 52 58 35 52 51 55 35 55 55 35 55 60 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 52 52 60 35 55 54 35 52 52 52 35 52 51 59 35 52 52 59 35 52 52 56 35 52 51 55 35 55 60 35 52 52 55 35 52 51 54 35 57 55 35 52 52 51 35 52 51 54 35 52 51 55 35 52 52 51 35 52 52 55 35 60 56 35 54 58 35 60 56 35 60 56 35 57 53 35 52 52 55 35 52 52 51 35 52 51 55 35 52 51 54 35 60 56 35 54 58 35 60 56 35 60 56 35 57 55 35 56 53 35 60 56 35 60 56 35 60 56 35 60 56 35 56 52 35 56 53 35 56 53 35 54 56 35 56 56 35 56 53 35 56 53 35 54 56 35 56 55 35 56 52 35 56 53 35 54 56 35 56 56 35 56 52 35 56 58 35 54 56 35 54 56 35 56 56 35 56 59 35 56 55 35 56 58 35 54 56 35 54 56 35 56 54 35 56 56 35 56 56 35 57 51 35 54 56 35 54 56 35 56 57 35 56 59 35 56 55 35 56 58 35 54 56 35 54 56 35 56 57 35 56 57 35 57 51 35 57 51 35 54 56 35 54 56 35 56 57 35 56 52 35 56 53 35 54 56 35 56 52 35 56 52 35 56 57 35 56 58 35 54 56 35 54 56 35 56 55 35 56 57 35 57 51 35 57 51 35 54 56 35 54 56 35 56 57 35 56 53 35 56 53 35 54 56 35 56 54 35 56 53 35 56 53 35 54 56 35 56 56 35 56 52 35 56 53 35 54 56 35 56 54 35 57 51 35 56 56 35 56 53 35 54 56 35 56 59 35 56 52 35 56 53 35 54 56 35 56 54 35 56 52 35 56 53 35 54 56 35 56 56 35 56 52 35 56 53 35 54 56 35 57 51 35 56 53 35 56 53 35 54 56 35 56 59 35 56 53 35 56 53 35 54 56 35 56 52 35 56 54 35 56 53 35 54 56 35 56 52 35 56 52 35 56 53 35 54 56 35 56 60 35 56 53 35 56 53 35 54 56 35 56 56 35 56 53 35 56 53 35 54 56 35 56 55 35 56 53 35 56 53 35 54 56 35 56 60 35 56 52 35 56 53 35 54 56 35 56 55 35 56 52 35 56 58 35 54 56 35 54 56 35 56 59 35 56 53 35 56 53 35 54 56 35 56 53 35 56 53 35 56 53 35 54 56 35 56 59 35 56 52 35 56 53 35 54 56 35 56 52 35 56 53 35 56 53 35 54 56 35 56 52 35 56 57 35 56 58 35 57 51 35 54 56 35 54 56 35 56 57 35 56 57 35 57 51 35 57 51 35 54 56 35 54 56 35 56 57 35 56 59 35 56 55 35 57 51 35 54 56 35 54 56 35 56 57 35 56 57 35 57 51 35 56 53 35 54 56 35 56 54 35 56 53 35 56 53 35 54 56 35 56 56 35 56 53 35 56 53 35 54 56 35 56 54 35 56 52 35 56 56 35 54 56 35 54 56 35 57 51 35 56 52 35 56 53 35 54 56 35 56 59 35 56 52 35 56 53 35 54 56 35 56 54 35 56 52 35 56 53 35 54 56 35 56 56 35 56 53 35 56 53 35 54 56 35 57 51 35 56 53 35 56 53 35 54 56 35 56 59 35 56 54 35 56 53 35 54 56 35 56 52 35 56 52 35 56 53 35 54 56 35 56 52 35 56 53 35 56 53 35 54 56 35 56 60 35 56 53 35 56 53 35 54 56 35 56 56 35 56 53 35 56 53 35 54 56 35 56 55 35 56 52 35 56 53 35 54 56 35 56 60 35 56 52 35 56 53 35 54 56 35 56 55 35 56 59 35 56 58 35 56 53 35 54 56 35 56 53 35 56 53 35 56 53 35 54 56 35 56 59 35 56 53 35 56 53 35 54 56 35 56 52 35 56 52 35 56 53 35 54 56 35 56 52 35 56 53 35 56 58 35 54 56 35 54 56 35 56 53 35 56 53 35 56 53 35 54 56 35 56 56 35 56 53 35 56 53 35 54 56 35 57 51 35 56 53 35 56 53 35 54 56 35 56 53 35 56 52 35 56 53 35 54 56 35 56 60 35 56 52 35 56 53 35 54 56 35 56 52 35 56 53 35 56 53 35 54 56 35 56 54 35 56 57 35 57 51 35 56 55 35 54 56 35 54 56 35 56 59 35 56 57 35 57 51 35 57 51 35 54 56 35 54 56 35 56 57 35 56 56 35 56 58 35 56 53 35 54 56 35 56 57 35 56 52 35 56 53 35 54 56 35 56 56 35 56 52 35 56 53 35 54 56 35 56 59 35 56 53 35 56 53 35 54 56 35 56 59 35 56 52 35 56 55 35 54 56 35 54 56 35 56 57 35 56 52 35 56 53 35 54 56 35 56 52 35 56 55 35 56 58 35 57 51 35 54 56 35 54 56 35 56 57 35 56 57 35 57 51 35 57 51 35 54 56 35 54 56 35 56 57 35 56 59 35 56 55 35 56 56 35 54 56 35 54 56 35 56 55 35 56 52 35 56 53 35 54 56 35 56 56 35 56 53 35 56 53 35 54 56 35 57 51 35 56 52 35 56 53 35 54 56 35 56 60 35 56 53 35 56 53 35 54 56 35 56 59 35 56 54 35 56 53 35 54 56 35 56 54 35 57 51 35 56 56 35 56 53 35 54 56 35 57 51 35 56 53 35 56 53 35 54 56 35 56 55 35 56 53 35 56 53 35 54 56 35 56 56 35 56 52 35 56 53 35 54 56 35 56 54 35 56 53 35 56 53 35 54 56 35 56 52 35 56 54 35 56 53 35 54 56 35 56 54 35 56 52 35 56 53 35 54 56 35 56 56 35 56 53 35 56 53 35 54 56 35 56 55 35 56 52 35 56 55 35 54 56 35 54 56 35 56 59 35 56 54 35 56 58 35 56 53 35 54 56 35 56 52 35 56 53 35 56 53 35 54 56 35 56 56 35 56 53 35 56 53 35 54 56 35 56 55 35 56 52 35 56 53 35 54 56 35 56 56 35 56 52 35 56 58 35 54 56 35 54 56 35 56 56 35 56 53 35 56 53 35 54 56 35 56 52 35 56 53 35 56 53 35 54 56 35 56 56 35 56 52 35 56 53 35 54 56 35 56 55 35 56 52 35 56 53 35 54 56 35 56 56 35 57 51 35 56 56 35 56 53 35 54 56 35 56 60 35 56 53 35 56 53 35 54 56 35 56 57 35 56 53 35 56 53 35 54 56 35 56 53 35 56 53 35 56 53 35 54 56 35 56 60 35 56 52 35 56 53 35 54 56 35 57 51 35 56 53 35 56 56 35 54 56 35 54 56 35 56 55 35 56 54 35 56 56 35 56 56 35 54 56 35 54 56 35 56 54 35 56 56 35 56 56 35 56 56 35 54 56 35 54 56 35 57 51 35 56 53 35 56 53 35 54 56 35 56 59 35 56 52 35 56 53 35 54 56 35 56 56 35 56 54 35 56 53 35 54 56 35 56 53 35 56 52 35 56 53 35 54 56 35 56 56 35 56 53 35 56 53 35 54 56 35 56 59 35 56 53 35 56 53 35 54 56 35 56 60 35 56 52 35 56 53 35 54 56 35 56 56 35 56 55 35 56 56 35 56 56 35 54 56 35 54 56 35 56 56 35 57 51 35 56 56 35 56 53 35 54 56 35 57 51 35 56 52 35 56 53 35 54 56 35 56 56 35 56 53 35 56 53 35 54 56 35 56 60 35 56 52 35 56 53 35 54 56 35 56 55 35 56 53 35 56 56 35 54 56 35 54 56 35 56 55 35 56 54 35 56 56 35 56 56 35 54 56 35 54 56 35 56 54 35 56 56 35 56 56 35 56 58 35 54 56 35 60 56 35 54 58 35 60 56 35 60 56 35 56 54 35 57 53 35 60 56 35 60 56 35 60 56 35 60 56 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 60 56 35 60 56 35 60 56 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 54 56 35 55 55 35 60 56 35 60 56 35 60 56 35 60 56 35 52 53 54 35 57 53 35 60 56 35 55 53 35 60 56 35 60 56 35 57 55 35 60 56 35 55 53 35 60 56 35 60 56 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 60 56 35 52 52 55 35 52 51 56 35 55 54 35 52 52 58 35 57 55 35 52 51 59 35 57 53 35 56 52 35 57 54 35 52 51 59 35 52 52 55 35 52 52 51 35 52 51 55 35 52 51 54 35 52 52 52 35 55 60 35 52 52 54 35 52 51 55 35 52 52 60 35 52 51 57 35 57 53 35 52 51 58 35 55 57 35 52 51 59 35 55 55 35 55 57 35 52 53 54 35 52 53 57 35 57 55 35 55 57 35 52 52 60 35 59 57 35 52 51 59 35 52 52 58 35 52 51 57 35 52 52 54 35 52 51 56 35 55 60 35 52 52 55 35 52 52 58 35 58 51 35 52 52 53 35 52 51 51 35 52 51 58 35 58 51 35 52 52 58 35 52 51 54 35 52 52 55 35 55 54 35 52 51 55 35 52 51 51 35 52 52 56 35 52 52 59 35 52 52 58 35 58 57 35 52 51 55 35 52 52 60 35 52 52 54 35 52 52 51 35 55 54 35 52 51 54 35 52 52 55 35 60 55 35 52 51 55 35 60 57 35 52 51 59 35 55 59 35 55 55 35 55 55 35 56 55 35 52 52 51 35 52 53 59 35 52 51 54 35 52 52 55 35 57 55 35 52 51 55 35 57 53 35 52 53 54 35 57 55 35 60 56 35 54 58 35 60 56 35 60 56 35 52 51 54 35 52 51 55 35 52 52 51 35 52 52 55 35 60 56 35 54 58 35 57 55 35 52 51 55 35 52 51 54 35 52 52 55 35 52 52 51 35 54 58 35 57 53 35 52 52 51 35 52 52 55 35 52 51 54 35 52 51 55 35 57 55 35 52 52 51 35 52 52 55 35 52 51 54 35 52 51 55 35 55 60 35 52 52 59 35 52 52 56 35 52 52 52 35 52 51 59 35 52 52 60 35 55 54 35 55 53 35 55 53 35 55 55 35 55 60 35 52 52 58 35 52 51 55 35 52 53 52 35 52 51 55 35 52 52 58 35 52 52 59 35 52 51 55 35 55 54 35 55 55 35 55 60 35 52 51 60 35 52 52 55 35 52 51 59 35 52 52 54 35 55 54 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_7_592046846();
var span = document.getElementById('enkoder_7_592046846');
span.parentNode.removeChild(span);
/* --> */
</script>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dinosaurtech.com/2007/interactive-brokers-920-beta-c-client/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Interactive Brokers C# Client</title>
		<link>http://www.dinosaurtech.com/2007/interactive-brokers-c-client/</link>
		<comments>http://www.dinosaurtech.com/2007/interactive-brokers-c-client/#comments</comments>
		<pubDate>Mon, 09 Jul 2007 21:35:32 +0000</pubDate>
		<dc:creator>Karl</dc:creator>
				<category><![CDATA[ATS]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Interactive Brokers]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.dinosaurtech.com/2007/interactive-brokers-c-client/</guid>
		<description><![CDATA[I have spent quite some time tirelessly porting the Interactive Brokers Java Socket Interface to C#. My initial port corresponds to the TWS API version 9.10, and shortly I will release a version which corresponds to the TWS API Beta 9.20. Why did you do this? I&#8217;m sure many of you are wondering why I [...]]]></description>
			<content:encoded><![CDATA[<p>I have spent quite some time tirelessly porting the Interactive Brokers Java Socket Interface to C#. My initial port corresponds to the TWS API version 9.10, and shortly I will release a version which corresponds to the TWS API Beta 9.20.</p>
<h2>Why did you do this?</h2>
<p><img alt="" align="right" src="http://www.dinosaurtech.com/wp-content/uploads/2007/07/070907-2135-interactive1.png" />I&#8217;m sure many of you are wondering why I would spend so much time on this, when Interactive Brokers now makes a .net version available through their J# compiler. The reasons are many, but mainly the J# component breaks a lot of C# design rules, and is poorly documented. My port places the documentation inline, so Visual Studio will bring up the messages, and so you are not working with cryptic const values.</p>
<p><img alt="" src="http://www.dinosaurtech.com/wp-content/uploads/2007/07/070907-2135-interactive2.png" /></p>
<h2>Support / Stability</h2>
<p>I plan to simultaneously support two C# clients, corresponding to the latest release of the TWS API as well as the TWS Beta API. My assembly versions will match the TWS API with an additional revision to correspond to my changes. For example, this initial release&#8217;s version is 9.1.0.1 corresponding to TWS API 9.10 and my release version 1. <strong>Please note</strong> that this is release version 1. I am considering this an <strong>alpha release</strong> as I have mechanically ported and cleaned up a lot of the code, but have not thoroughly tested every function yet.</p>
<h2>License</h2>
<p>The source is free for you to use in any application you like. I ask, but do not require, you to give me credit and a link back if you like it. I also ask, but do not require that if you improve the library, or find any problems that you send me your changes / problem report, so I can continue to make this better. I want to be clear that I do not hold any liability or responsibility for any use / content of this code.</p>
<h2>Documentation</h2>
<p>I have published MSDN style documentation from generated from the library at <a href="http://ibdoc.dinosaurtech.com">http://ibdoc.dinosaurtech.com</a>. This documentation was populated from <a href="http://www.interactivebrokers.com/php/webhelp/webhelp.htm">Interactive Broker&#8217;s User Guide</a>, and notes from the <a href="http://finance.groups.yahoo.com/group/twsapi/">IB Yahoo Forum</a> and was generated using <a href="https://blogs.msdn.com/sandcastle/">Microsoft Sandcastle</a> with <a href="http://www.codeplex.com/DocProject">DocProject</a>. I will continue to revise it on feedback from users, and as I find room for improvement.</p>
<h2>Forum</h2>
<p>I have created a forum, where I would like to collect problem reports / feature requests at <a href="http://www.dinosaurtech.com/forums/">http://www.dinosaurtech.com/forums/</a> and ask that any users register and provide feedback there. I will try to be very responsive, and incorporate your feedback.</p>
<h2>Credits</h2>
<p>This library is a port of the Interactive Brokers Java library, so of course I would like to credit the interactive broker&#8217;s developers for their API. I also used code from an article by Javier Compos &quot;<a href="http://www.codeproject.com/csharp/EnumDescConverter.asp">Description Enum TypeConverter</a>&quot; in order to transform the ugly consts to pretty enumerations with overridden ToString() functions.</p>
<h2>Downloads</h2>
<ul>
<li><a href="http://www.dinosaurtech.com/wp-content/uploads/2007/07/krsatsibnet-9101.zip">Version 9.1.0.1 Library</a> &ndash; July 8, 2007 &ndash; Alpha &ndash; Corresponds to IB API 9.10</li>
<li><a href="http://ibhelp.dinosaurtech.com/">Documentation</a></li>
</ul>
<p>Please note that I will maintain the latest on my <a href="http://www.dinosaurtech.com/utilities/">utilities</a> page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dinosaurtech.com/2007/interactive-brokers-c-client/feed/</wfw:commentRss>
		<slash:comments>15</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>

