<?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/"
	>

<channel>
  <title>Open Source, Cisco, Trading and Findability</title>
    <link>http://www.oneunified.net/blog</link>
    <description>An eclectic mixture of Open Source, Cisco, and Automated Trading</description>
    <language>en</language>
    <copyright>Copyright(c) 2008 Ray Burkholder</copyright>
   <lastBuildDate>Thu, 03 Jul 2008 14:38:00 GMT</lastBuildDate>


<item>
  <title>Upgrade from Eclipse Europa to Ganymede (with painful Subversion)</title>
  <link>http://www.oneunified.net/blog/OpenSource/Programming/ganymede.article</link>
  <category>/OpenSource/Programming</category>
  <pubDate>Thu, 03 Jul 2008 14:38:00 +0000</pubDate>
  <content:encoded><![CDATA[
<p>Today, I upgraded from Eclipse/CDT Europa to Eclipse/CDT Ganymede.
(CDT meaning C++ Developer Tools).  The Eclipse upgrade was painless:  
download the Eclipse/CDT package, expand it, and start eclipse from 
within the directory.  After pointing it to my workspace, everything
was there.  Nicely simple.

<p>My subversion client was an entirely different story.  For the Europa installation,
everything came from the tigris site and worked well. For the Ganymede installation,
there are now two sites involved, and I'm not sure which is what.  I think
the tigris site can now be ignored (for the time being).  In the 
installation instructions somewhere, one needs to go to the 
<a href="http://www.oneunified.net/blog/index.rss20?redirectURL=http://www.polarion.org/" onMouseOver="window.status='to www.polarion.org/'; return true;" onMouseOut="window.status=''; return true;" target=_blank>Polarion</a> site for their client.  There 
are Eclipse update links there.

<p>However, what I assumed to be workable defaults of using the JavaHL library on
Debian turned out to be non-workable.  The solution was not to use the JavaHL
client but use the SVNKit client. 

<p>My key problem is that my SVN repository requries an ssh public/private key.
The JavaHL library, if or when it would or wouldn't load, I'm not sure what I was 
seeing, but I could only see the option for user name and password authentication.

<p>It would have been nice if the Subversion/Polarion/Eclipse guys would all get 
together and make it straight-forward in terms of which libraries from 
which sites need to be download.  If they imply that the JavaHL libraries should
be downloaded, please make it painless to get the paths set and ensure the binaries
are present.  After 15 million lines of code, you'd think that would be a 
small task to accomplish.


]]></content:encoded>
  <guid isPermaLink="true">http://www.oneunified.net/blog/OpenSource/Programming/ganymede.article</guid>
</item>
<item>
  <title>Concurrency aka MultiThreading </title>
  <link>http://www.oneunified.net/blog/OpenSource/Programming/concurrency.article</link>
  <category>/OpenSource/Programming</category>
  <pubDate>Tue, 17 Jun 2008 21:36:00 +0000</pubDate>
  <content:encoded><![CDATA[
<p>A number of my projects are approaching the phase where some of their feature sets 
will work better with some form of background processing.  In a trading application,
plowing through historical data on thousands of symbols looking for patterns would be 
best left to a background task, rather than rendering the user-interface frozen during 
the, well, duration.  For Radius, with a listener on an accounting port, and one on an 
authorization port, the two threads need to coordinate access to resources.

<p>Windows has a native threads API, but that isn't necessarily portable between operating systems.
My trading application is in Windows, and the Radius application in on Linux.  Using the same API on both 
platforms wuold be cool.

<p>As I already use the Boost tools in their various forms, Boost::Thread would be a good candidate.
The Boost documentation isn't exactly overflowing with examples.  Dr. Dobb's Portal 
saves the day with an article dating from May 2002 entitled 
<a href="http://www.oneunified.net/blog/index.rss20?redirectURL=http://www.ddj.com/cpp/184401518" onMouseOver="window.status='to www.ddj.com/cpp/184401518'; return true;" onMouseOut="window.status=''; return true;" target=_blank>The Boost.Threads Library</a>.
It has good examples covering the basics:

<ul>
  <li>Thread Creation (boost::thread)
  <li>Mutexes (boost::mutex), which protects one thread from another
  <li>Condition Variables (boost::condition), which are good for getting data into and out of a thread
  <li>Thread Local Storage (boost::thread_specific_ptr), for keeping thread specific storage separate from other threads
  <li>Once Routines (boost::call_once), for making sure statics are initialized once and only once
  </ul>

<p>For mutexes, protecting code regions can be as easy as declaring a mutex:

<blockquote><pre>
boost::mutex CodeProtectionMutex;
</pre></blockquote>

<p>And then putting a scoped lock in the code encountered by multiple threads:

<blockquote><pre>
{ // some scope some where
  // ... some code
boost::mutex::scoped_lock lock(CodeProtectionMutex);
  // .. some more code, which is protected by the lock
} // the scope exit, no unlock is required as the destructor does the work
</pre></blockquote>

<p>After reviewing the examples, making use of the Boost documentation should be an easier
task.  As such, boost::thread documentation should be reviewed anywa as boost::thread
has gone through some changes since that article.

<p>Paul Bridger has also written a 
<a href="http://www.oneunified.net/blog/index.rss20?redirectURL=http://paulbridger.net/multithreading_tutorial" onMouseOver="window.status='to paulbridger.net/multithreading_tutorial'; return true;" onMouseOut="window.status=''; return true;" target=_blank>
tutorial on multithreading</a> making use of the boost::thread 
class.  The navigation through the tutorial isn't the greatest, but the content is good.

<p>Making use of boost::thread as a base, Philipp Henkel has written 
<a href="http://www.oneunified.net/blog/index.rss20?redirectURL=http://threadpool.sourceforge.net/" onMouseOver="window.status='to threadpool.sourceforge.net/'; return true;" onMouseOut="window.status=''; return true;" target=_blank>threadpool</a>.  It has been 
brought up to date for use with boost v1.35.  It provides a dead easy solution to 
making use of a limited number of worker threads to carry out tasks:

<blockquote><pre>
    pool tp(2);  //create a 2 thread pool
    
    // Add some tasks to the pool.
    tp.schedule(&first_task);
    tp.schedule(&second_task);
    tp.schedule(&third_task);  // this task waits until of the other two completes
</pre></blockquote>

<p>In the similar vein to Henkel, Ted Yuan has a boost::thread based 
<a href="http://www.oneunified.net/blog/index.rss20?redirectURL=http://www.bayimage.com/code/pcpaper.html" onMouseOver="window.status='to www.bayimage.com/code/pcpaper.html'; return true;" onMouseOut="window.status=''; return true;" target=_blank>
C++ Producer-Consumer Concurrency Template Library</a>.

<p>Zoltán Porkoláb has written an article on 
<a href="http://www.oneunified.net/blog/index.rss20?redirectURL=http://aszt.inf.elte.hu/~gsd/klagenfurt/material/" onMouseOver="window.status='to aszt.inf.elte.hu/~gsd/klagenfurt/material/'; return true;" onMouseOut="window.status=''; return true;" target=_blank>
Distributed Programming and Metaprogramming in C++</a>.  It has many 
examples and goes into some additional examples for boost::thread.  His article also 
introduces bind and tuples, which are good backgrounds to boost::lambda.

<p>Back to boost for a second.  You can't find it from the boost home page, but here is a
good link to 
<a href="http://www.oneunified.net/blog/index.rss20?redirectURL=http://www.boost.org/doc/libs/1_35_0/libs/libraries.htm" onMouseOver="window.status='to www.boost.org/doc/libs/1_35_0/libs/libraries.htm'; return true;" onMouseOut="window.status=''; return true;" target=_blank>
Boost Libraries Listed Alphabetically</a>.

<p>boost::thread is a basic threading library.  Going above and beyond multi-threading
grunt work, Intel's 
<a href="http://www.oneunified.net/blog/index.rss20?redirectURL=http://www.threadingbuildingblocks.org/" onMouseOver="window.status='to www.threadingbuildingblocks.org/'; return true;" onMouseOut="window.status=''; return true;" target=_blank>
Thread Building Blocks</a> has higher level constructs for getting 
multiple threads going.  For example, it has a 'for' construct for simultaneously 
executing multiple elements of the for statement.  Good tutorials and background 
information can be read through 
<a href="http://www.oneunified.net/blog/index.rss20?redirectURL=http://softwareblogs.intel.com/author/kevin-farnham/" onMouseOver="window.status='to softwareblogs.intel.com/author/kevin-farnham/'; return true;" onMouseOut="window.status=''; return true;" target=_blank>
Kevin Farnham's Blog</a>.

<p>Building further on the Threading Building Blocks is something of
simulating interest:  
<a href="http://www.yetisim.org/index.php/ target=_blank>
YetiSim, a discrete event simulation library for C++</a>.

<p>Since the CPU makers can't make their CPU's any faster, they make more of them.  
This is really forcing concurrent programming to the forefront.  A web site called
<a href="http://www.oneunified.net/blog/index.rss20?redirectURL=http://www.devx.com/go-parallel" onMouseOver="window.status='to www.devx.com/go-parallel'; return true;" onMouseOut="window.status=''; return true;" target=_blank>
go parallel</a> looks to be chock full of content related to multi-core and multi-threaded
programming.

<p>From the theoretical perspective, I came across an HP paper called 
<a href="http://www.oneunified.net/blog/index.rss20?redirectURL=http://www.hpl.hp.com/techreports/2008/HPL-2008-56.pdf" onMouseOver="window.status='to www.hpl.hp.com/techreports/2008/HPL-2008-56.pdf'; return true;" onMouseOut="window.status=''; return true;" target=_blank>
Foundations of the C++ Concurrency Memory Model</a>, and written by Hans-J. Boehm and Sarita V. Adve.
I havn't read it all the way through, but at some time, I think the bibiliography may be
a worthy read in itself.
]]></content:encoded>
  <guid isPermaLink="true">http://www.oneunified.net/blog/OpenSource/Programming/concurrency.article</guid>
</item>
<item>
  <title>Keyword Matching (non-text streams)</title>
  <link>http://www.oneunified.net/blog/OpenSource/Programming/KeyWordMatch.article</link>
  <category>/OpenSource/Programming</category>
  <pubDate>Mon, 16 Jun 2008 16:16:00 +0000</pubDate>
  <content:encoded><![CDATA[
<p>In a previous blog article, I presented the beginnings of a Keyword Lookup class.  This 
article takes that work, turns it into a template and makes it useful for longest match 
lookups.

<p>I'll have to compare this lookup library with what a C++ map or unordered_map does for 
lookup speed.  I'm hoping that when a comparison is made, that this routine is indeed 
faster.  I'm thinking it might be because, even though a map will do a binary search through 
it's map, complete strings are compared at each step.  With this library, keyward patterns 
are added to a rooted tree of characters, possibly reducing the amount of time spent 
mactching. 

<p>I must admit that at each match step, there is a linear search performed through a list 
of likely character candidates.  To imporve the search, I've been thinking that once the 
pattern tree has been 
created, it could be sorted so that each step search can be done with a binary search.  This 
will be something for next time.

<p>In the meantime, this routine does work for finding maximum matches.  For example when 
performing a long distance rate lookup, this will find the most specific rate code from a 
list of various length candidates, something which is difficult to do with a map.

<p>This keyword match algorithm is template based.  'class T' is the type to be returned 
upon a successful match.  It can be an index, a pointer, a number, or anything else 
suitable.  The class constructor requires an initializer... basically a value to be given 
the equivalent meaning of NULL.  On no match, this value is returned.  Use 'AddPattern' to 
add patterns and their associated 'meanings'.  Use FindMatch to perform the lookup.

<p>
<!-- code formatted by http://manoli.net/csharpformat/ -->
<pre class="csharpcode">
<span class="rem">// this is kind of a subset of Aho Corasick algorithm</span>
<span class="rem">// only full keyword matching, no text searches</span>
<span class="rem">// no on failure coding</span>

#ifndef CKEYWORDMATCH_H_
<span class="preproc">#define</span> CKEYWORDMATCH_H_

#include &lt;<span class="kwrd">string</span>&gt;
#include &lt;vector&gt;
#include &lt;stdexcept&gt;
#include &lt;iostream&gt;

template&lt;<span class="kwrd">class</span> T&gt; <span class="kwrd">class</span> CKeyWordMatch {
<span class="kwrd">public</span>:
  <span class="kwrd">explicit</span> CKeyWordMatch&lt;T&gt;( T initializer, size_t size );
  <span class="kwrd">virtual</span> ~CKeyWordMatch(<span class="kwrd">void</span>);
  <span class="kwrd">void</span> ClearPatterns( <span class="kwrd">void</span> );
  <span class="kwrd">void</span> AddPattern( <span class="kwrd">const</span> std::<span class="kwrd">string</span> &amp;sPattern, T <span 
class="kwrd">object</span> );
  T FindMatch( <span class="kwrd">const</span> std::<span class="kwrd">string</span> &amp;sMatch );
  size_t size( <span class="kwrd">void</span> ) { <span class="kwrd">return</span> m_vNodes.size(); };
<span class="kwrd">protected</span>:
    T m_Initializer;
  <span class="kwrd">struct</span> structNode {
    size_t ixLinkToNextLevel;  <span class="rem">// next letter of same word</span>
    size_t ixLinkAtSameLevel;  <span class="rem">// look for other letters at same location</span>
    T <span class="kwrd">object</span>;  <span class="rem">// upon match, (returned when keyword found)</span>
    <span class="kwrd">char</span> chLetter;  <span class="rem">// the letter at this node</span>
    <span class="kwrd">explicit</span> structNode( T initializer ) : ixLinkToNextLevel( 0 ), ixLinkAtSameLevel( 0 ), 
      <span class="kwrd">object</span>( initializer ), chLetter( 0 ) {};
  };
  std::vector&lt;structNode&gt; m_vNodes;
<span class="kwrd">private</span>:
};

template&lt;<span class="kwrd">class</span> T&gt; CKeyWordMatch&lt;T&gt;::CKeyWordMatch( T initializer, size_t size )
: m_Initializer( initializer )
{
  m_vNodes.reserve( size );
  ClearPatterns();
}

template&lt;<span class="kwrd">class</span> T&gt; CKeyWordMatch&lt;T&gt;::~CKeyWordMatch(<span class="kwrd">void</span>) {
  m_vNodes.clear();
}

template&lt;<span class="kwrd">class</span> T&gt; <span class="kwrd">void</span> CKeyWordMatch&lt;T&gt;::ClearPatterns() {
  m_vNodes.clear();
  structNode node( m_Initializer );
  m_vNodes.push_back( node ); <span class="rem">// root node with nothing</span>
}

template&lt;<span class="kwrd">class</span> T&gt; <span class="kwrd">void</span> CKeyWordMatch&lt;T&gt;::AddPattern( 
              <span class="kwrd">const</span> std::<span class="kwrd">string</span> &amp;sPattern, T <span class="kwrd">object</span> ) {
  std::<span class="kwrd">string</span>::const_iterator iter = sPattern.begin(); 
  <span class="kwrd">if</span> ( sPattern.end() == iter ) {
    <span class="kwrd">throw</span> std::invalid_argument( <span class="str">"zero length pattern"</span> );
  }
  size_t ixNode = 0;
  size_t ix;
  <span class="kwrd">bool</span> bDone = <span class="kwrd">false</span>;
  <span class="kwrd">while</span> ( !bDone ) {
    <span class="kwrd">char</span> ch = *iter;
    ix = m_vNodes[ ixNode ].ixLinkToNextLevel;
    <span class="kwrd">if</span> ( 0 == ix ) { <span class="rem">// end of chain, so add letter</span>
      structNode node( m_Initializer );
      node.chLetter = ch;
      m_vNodes.push_back( node );
      ix = m_vNodes.size() - 1;
      m_vNodes[ ixNode ].ixLinkToNextLevel = ix;
      ixNode = ix;
    }
    <span class="kwrd">else</span> { <span class="rem">// find letter at this level</span>
      <span class="kwrd">bool</span> bLevelDone = <span class="kwrd">false</span>;
      size_t ixLevel = ix;  <span class="rem">// set from above</span>
      <span class="kwrd">while</span> ( !bLevelDone ) {
        <span class="kwrd">if</span> ( ch == m_vNodes[ ixLevel ].chLetter ) { 
          <span class="rem">// found matching character</span>
          ixNode = ixLevel;
          bLevelDone = <span class="kwrd">true</span>;
        }
        <span class="kwrd">else</span> {
          <span class="rem">// move onto next node at this level to find character</span>
          size_t ixLinkAtNextSameLevel 
            = m_vNodes[ ixLevel ].ixLinkAtSameLevel;
          <span class="kwrd">if</span> ( 0 == ixLinkAtNextSameLevel ) {
            <span class="rem">// add a new node at this level</span>
            structNode node( m_Initializer );
            node.chLetter = ch;
            m_vNodes.push_back( node );
            ix = m_vNodes.size() - 1;
            m_vNodes[ ixLevel ].ixLinkAtSameLevel = ix;
            ixNode = ix;
            bLevelDone = <span class="kwrd">true</span>;
          }
          <span class="kwrd">else</span> {
            <span class="rem">// check the new node, nothing to do here</span>
            <span class="rem">// check next in sequence</span>
            ixLevel = ixLinkAtNextSameLevel;
          }
        }
      }
    }
    ++iter;
    <span class="kwrd">if</span> ( sPattern.end() == iter ) {
      <span class="kwrd">if</span> ( m_Initializer != m_vNodes[ ixNode ].<span class="kwrd">object</span> ) {
        <span class="kwrd">throw</span> std::domain_error( <span class="str">"Pattern already present"</span> );
      }
      m_vNodes[ ixNode ].<span class="kwrd">object</span> = <span class="kwrd">object</span>;  <span class="rem">// assign and finish</span>
      bDone = <span class="kwrd">true</span>;
    }
  }
}

template&lt;<span class="kwrd">class</span> T&gt; T CKeyWordMatch&lt;T&gt;::FindMatch( <span class="kwrd">const</span> std::<span 
class="kwrd">string</span> &amp;sPattern ) {
  <span class="rem">// traverse structure looking for matches, object at longest match is returned</span>
  std::<span class="kwrd">string</span>::const_iterator iter = sPattern.begin(); 
  <span class="kwrd">if</span> ( sPattern.end() == iter ) {
    <span class="kwrd">throw</span> std::runtime_error( <span class="str">"zero length pattern"</span> );
  }
  T <span class="kwrd">object</span> = m_Initializer;
  size_t ixNode = 0;
  size_t ix;
  <span class="kwrd">bool</span> bDone = <span class="kwrd">false</span>;
  <span class="kwrd">while</span> ( !bDone ) {
    <span class="kwrd">char</span> ch = *iter;
    ix = m_vNodes[ ixNode ].ixLinkToNextLevel;
    <span class="kwrd">if</span> ( 0 == ix ) {
      bDone = <span class="kwrd">true</span>;  <span class="rem">// no more matches to be found so exit</span>
    }
    <span class="kwrd">else</span> {
      <span class="rem">// compare characters at this level</span>
      <span class="kwrd">bool</span> bLevelDone = <span class="kwrd">false</span>;
      size_t ixLevel = ix;  <span class="rem">// set from above</span>
      <span class="kwrd">while</span> ( !bLevelDone ) {
        <span class="kwrd">if</span> ( ch == m_vNodes[ ixLevel ].chLetter ) {
            <span class="kwrd">if</span> ( m_Initializer != m_vNodes[ ixLevel ].<span class="kwrd">object</span> )
                <span class="kwrd">object</span> = m_vNodes[ ixLevel ].<span class="kwrd">object</span>;
          ixNode = ixLevel;
          bLevelDone = <span class="kwrd">true</span>;
        }
        <span class="kwrd">else</span> {
          ixLevel = m_vNodes[ ixLevel ].ixLinkAtSameLevel;
          <span class="kwrd">if</span> ( 0 == ixLevel ) {  <span class="rem">// no match so end</span>
            bLevelDone = <span class="kwrd">true</span>;
            bDone = <span class="kwrd">true</span>;
          }
        }
      }
    }
    ++iter;
    <span class="kwrd">if</span> ( sPattern.end() == iter ) {
      bDone = <span class="kwrd">true</span>;
    }
  }
  <span class="kwrd">return</span> <span class="kwrd">object</span>;
}

<span class="preproc">#endif</span> <span class="rem">/*CKEYWORDMATCH_H_*/</span>
</pre>
]]></content:encoded>
  <guid isPermaLink="true">http://www.oneunified.net/blog/OpenSource/Programming/KeyWordMatch.article</guid>
</item>
<item>
  <title>Mean Reversion Thoughts</title>
  <link>http://www.oneunified.net/blog/Trading/AutomatedTrading/MeanReversion.article</link>
  <category>/Trading/AutomatedTrading</category>
  <pubDate>Sun, 15 Jun 2008 20:47:00 +0000</pubDate>
  <content:encoded><![CDATA[
<p>While still putting together the code for a trading solution, I've been thinking about 
what algorithms to implement for a trading strategy.  I have access to live intra-day tick 
and quote data, so mean-reversion aka contrarian strategies seem like interesting 
candidates.

<p>In the course of manual trading, I've learned that one needs to keep track of a number of 
items: current portfolio costs, current holding costs, existing profit/losses, expected 
market direction, current market location, external influences.  This is a lot to do 
manually.  Hence the desire to implment tools to automate, or even semi-automate the 
process.

<p>A paper by Subramanian Ramamoorthy called 
<a href="http://www.oneunified.net/blog/index.rss20?redirectURL=http://www.cs.utexas.edu/~pstone/Courses/395Tfall03/resources/reports/Ram.pdf" onMouseOver="window.status='to www.cs.utexas.edu/~pstone/Courses/395Tfall03/resources/reports/Ram.pdf'; return true;" onMouseOut="window.status=''; return true;" 
target=_blank>A strategy for stock trading based on multiple models and trading rules</a> 
discusses a state space mechanism for determining how to manage the portfolio composition.  
Another item he brings to the foreground is a description of the Sharpe Ratio, a ratio which 
helps one to keep profit consistent rather than widely dynamic.

<p>Using different terminology, the makers of NeoTicker have a blog with an article called
<a href="http://www.oneunified.net/blog/index.rss20?redirectURL=http://newsletter.neoticker.com/2006/04/17/counter-trend-trading-with-simple-range-exhaustion-system/" onMouseOver="window.status='to newsletter.neoticker.com/2006/04/17/counter-trend-trading-with-simple-range-exhaustion-system/'; return true;" onMouseOut="window.status=''; return true;" target=_blank>
Counter-Trend Trading with Simple Range Exhaustion System</a>.  The key point, which could 
be hard to do, is "most counter-trend traders will try to time their entries as close to the 
extreme reversal points as possible to maximize the profits and minimize the risk 
exposures".  Using multiple time frame charts, and 
<a href="http://www.oneunified.net/blog/index.rss20?redirectURL=http://newsletter.neoticker.com/2006/05/15/basic-tape-reading-the-importance-of-sub-minute-charts/" onMouseOver="window.status='to newsletter.neoticker.com/2006/05/15/basic-tape-reading-the-importance-of-sub-minute-charts/'; return true;" onMouseOut="window.status=''; return true;" target=_blank>
reading the tape</a>, along with some possibly helpful technical analysis tools, it might be 
possible to home in on the zones of reversal.

<p>Working my way into a little scalping in the futures, an older article at Interactive 
Brokers explains the birth of the 
<a href="http://www.oneunified.net/blog/index.rss20?redirectURL=http://www.interactivebrokers.com/en/general/education/chatTranscript-4-01-04.php" onMouseOver="window.status='to www.interactivebrokers.com/en/general/education/chatTranscript-4-01-04.php'; return true;" onMouseOut="window.status=''; return true;" target=_blank>
Dow Mini Futures</a>. Some interesting points:

<ul>
  <li>"try to identify the leader in a group and how its price movement can help us predict 
movement in others in the group"
  <li>"we start to trade it by hand so we can get a better understanding of the nuances in 
that particular trade"
  <li>"We have a trader and a programmer trade together for a while and then we start the 
process of automation. We define our risk parameters and write the rules that we feel give 
us an opportunity to be profitable."
  <li>"In our back testing we saw that if we were patient it would be profitable for us. The 
hard part was learning to be patient because our other successful trades were very high 
frequency. In the mini-sized Dow we may be in and out of 5 to 10 trades in a less than 
minute."
  <li>hedge the mini dow with the underlying basket of stocks
  <li>"We don't have scalping targets. We generate a theoretical value and make markets 
based purely on that value If we our pricing is accurate and we should naturally be able to 
scalp."
  <li>"In the Dow because the bid-ask spread is so tight most of our profits are generated 
from trading."
  <li>"he dow has a much tighter spread compared to the mini-spu. Also it is much easier to 
watch the stocks in the underlying basket to ascertain their effect on the future."
  <li>"The Russell tends to be trendier than other indices."
  </ul>

]]></content:encoded>
  <guid isPermaLink="true">http://www.oneunified.net/blog/Trading/AutomatedTrading/MeanReversion.article</guid>
</item>
<item>
  <title>Adaptive Arrival Price</title>
  <link>http://www.oneunified.net/blog/Trading/AutomatedTrading/AdaptiveArrivalPrice.article</link>
  <category>/Trading/AutomatedTrading</category>
  <pubDate>Sun, 15 Jun 2008 08:35:00 +0000</pubDate>
  <content:encoded><![CDATA[
<p>A keynote lecture at the April 7th Algorithmic Trading Conference in London was by Mr. 
Julian Lorenz of ETH Zurich.  The abstract for his lecture reads as follows:

<blockquote>
Electronic trading of equities and other securities makes heavy use of "arrival price" 
algorithms, that balance the market impact cost of rapid execution against the volatility 
risk of slow execution. In the standard formulation, mean-variance optimal trading 
strategies are static: they donot modify the execution speed in response to price motions 
observed during trading. We show that with a more realistic formulation of the mean-variance 
tradeoff, with no momentum or mean reversion in the price process, substantial improvements 
are possible by using dynamic trading strategies. We develop a technique for computing 
optimal dynamic strategies to any desired degree of precision. The asset price process is 
observed on a discrete tree with a arbitrary number of levels. We introduce a novel dynamic 
programming technique in which the control variables are not only the shares traded at each 
time step, but also the maximum expected cost for the remainder of the program; the value 
function is the variance ofthe remaining program. <i>The resulting adaptive strategies 
are"aggressive-in-the-money": they accelerate the execution when the price moves in the 
trader's favor, spending parts of the trading gains to reduce risk</i>. The improvement is 
larger for large initial positions.
</blockquote>

<p>I think I'll add 'arrival price algorithms' to my key word searches. The above extract 
was from a search on 'mean reversion trading system algorithms'.]]></content:encoded>
  <guid isPermaLink="true">http://www.oneunified.net/blog/Trading/AutomatedTrading/AdaptiveArrivalPrice.article</guid>
</item>
<item>
  <title>Stocks & Commodities, 2008/06</title>
  <link>http://www.oneunified.net/blog/Trading/ReadingMaterial/SC2008Jun.article</link>
  <category>/Trading/ReadingMaterial</category>
  <pubDate>Sun, 08 Jun 2008 20:42:00 +0000</pubDate>
  <content:encoded><![CDATA[
<p>In a recent issue of Technical Analysis of Stocks and Commodities, there was an interview 
with Tom Busby.  A number of his comments struck home with some things I've learned.  He 
also introduced a few more things about which I should think.

<p>He noted that trading can be a twenty four hour operation.  There is always some market 
open to trade.  The world starts off with the Nikkei and the Hang Seng in the far east.  In 
Europe, primary markets are CAS, FTSE, DAX and the Swiss.  I'd say in today's market the 
IPE, with the Brent Crude Futures, is also important.  Here in the west, we have the morning 
New York market and the afternoon California market.

<p>Busby made mention that 'market open' is an important event.  As such, it is important to 
know the time each of the markets open.  I've been working on an algorithm that selects a 
series of instruments, selects a direction and lets the instruments run.  I've been 
wondering what to set for an exit though.  Busby, in the interview, 
suggests exiting once a third of ATR 
(Average True Range) has been reached.  I'm not sure why he would use ATR (which accounts 
for any opening gap) rather than just the daily average range.  Assuming one gets in 
sometime in the open, and exits by the end of the day (in order to eliminate what gaps in 
the wrong direction can do to one's portfolio), then using ATR doesn't seem quite right.

<p>Anyway, To set the tone for a trading day, he suggests some benchmark indexes to be 
watched.  Seven, which he calls the Seven Sisters are: 

<ul>
  <li>S&P
  <li>NASDAQ
  <li>Dow Jones Indexes
  <li>DAX
  <li>Crude Oil
  <li>Long Bonds
  <li>Gold
  </ul>

<p>As for micro-signals, he uses three kinds, with each needing to be in the same direction:  

<ul>
  <li>Volume
  <li>Tick (gainers vs loser)
  <li>Trend
  </ul>

<p>To finish things off, he suggests splitting an entry into three parts:
 
<ul>
  <li>Tick Part:  the trickiest part of the entry based upon the three variables above
  <li>Trade Part: with confidence building, try to make twice the reward vs risk 
  <li>Trend Part:  capture the full movement of the day
  </ul>

]]></content:encoded>
  <guid isPermaLink="true">http://www.oneunified.net/blog/Trading/ReadingMaterial/SC2008Jun.article</guid>
</item>
<item>
  <title>SmartQuant QuantDeveloper & DataCenter Release</title>
  <link>http://www.oneunified.net/blog/Trading/SmartQuant/Releases/release.20080606.article</link>
  <category>/Trading/SmartQuant/Releases</category>
  <pubDate>Fri, 06 Jun 2008 19:30:00 +0000</pubDate>
  <content:encoded><![CDATA[
<p><a href=http://www.smartquant.com target=_blank>SmartQuant</a> has released a revision 
to  DataCenter and
QuantDeveloper.  DataCenter and QuantDeveloper are at the following revision levels:

<p><blockquote><pre>
DataCenter
Version 3.0.2 (06-Jun-2008) 

QuantDeveloper Enterprise Edition
Version 3.0.2 (06-Jun-2008)  

QuantDeveloper Source Code
Version 3.0.1 (21-Apr-2008) 
* Recent Versions available through 
  version control 
</pre></blockquote>]]></content:encoded>
  <guid isPermaLink="true">http://www.oneunified.net/blog/Trading/SmartQuant/Releases/release.20080606.article</guid>
</item>
<item>
  <title>Wt, Some Build Modifications</title>
  <link>http://www.oneunified.net/blog/OpenSource/Debian/Development/wtv3.article</link>
  <category>/OpenSource/Debian/Development</category>
  <pubDate>Fri, 06 Jun 2008 15:26:00 +0000</pubDate>
  <content:encoded><![CDATA[
<p>Back on 
<a href="http://www.oneunified.net/blog/index.rss20?redirectURL=http://www.oneunified.net/blog/OpenSource/Debian/Development/wt.article" onMouseOver="window.status='to www.oneunified.net/blog/OpenSource/Debian/Development/wt.article'; return true;" onMouseOut="window.status=''; return true;" target=_blank>
2007/10/03</a>, I wrote about installing Wt (a C++ library and application server for 
developing and deploying web applications) on a Debian server.  I've revised things a little 
bit since thing while building Wt v2.1.3.

<p>In this case, I build with the newly released version of the Boost libraries:  1.35.  
ASIO is now included in Boost, so some build steps can be removed.

<p>Prerequisites are little changed but for a different library for gd:

<blockquote><pre>
apt-get install gcc
apt-get install zlib1g
apt-get install zlib1g-dev
apt-get install libbz2-dev
apt-get install libgd2-noxpm-dev
apt-get install cmake
apt-get install libfcgi-dev
apt-get install libapache2-mod-fastcgi
apt-get install libssl-dev
</pre></blockquote>

<p>The web site and repository for Wt have changed, so CVS commands will be a bit different:

<blockquote><pre>
cvs -d :pserver:anonymous@cvs.webtoolkit.eu/opt/cvs login
cvs -z3 -d :pserver:anonymous@cvs.webtoolkit.eu/opt/cvs co wt
</pre></blockquote>

<p>I've changed the cmake/build a little bit so the results go into /usr/local/wt/include 
and /usr/local/wt/lib:

<blockquote><pre>
cmake -D DEPLOYROOT=/var/www/wt -D WEBUSER=www-data -D WEBGROUP=www-data \
-D BOOST_DIR=/usr/local \
-D BOOST_COMPILER=gcc42 \
-D BOOST_VERSION=1_35 \
-D BOOST_INCLUDE_DIR=/usr/local/include/boost \
-D BOOST_LIB_DIR=/usr/local  \
-D BOOST_DT_LIB_MT=/usr/local/lib \
-D BOOST_DT_LIB=/usr/local/lib \
-D BOOST_FS_LIB=/usr/local/lib \
-D BOOST_FS_LIB_MT=/usr/local/lib \
-D BOOST_PO_LIB_MT=/usr/local/lib \
-D BOOST_REGEX_LIB_MT=/usr/local/lib \
-D BOOST_SIGNALS_LIB_MT=/usr/local/lib \
-D BOOST_THREAD_LIB=/usr/local/lib \
-D BOOST_ASIO_INCLUDE_DIR=/usr/local/include/boost  \
-D SHARED_LIBS=ON \
-D CONNECTOR_FCGI=OFF \
-D CONNECTOR_HTTP=ON \
-D EXAMPLES_CONNECTOR=wthttp \
-D WTHTTP_CONFIGURATION=/etc/wt/wthttpd \
-D CONFIGURATION=/etc/wt/wt_config.xml \
-D CMAKE_INSTALL_PREFIX=/usr/local/wt \
.
</pre></blockquote>

<p>During make install, an error regarding CMakeFiles arises.  The secret, that I know, is 
to remove the line which includes CmakeFiles in src/Ext/cmake_install.cmake, and restart 
'make install'.  The install should complete normally.

<p>The library directory /usr/local/wt/lib will need to be added to /etc/ld.so.conf, and 
then run ldconfig to update things.

<p>Remember to review the 
<a href="http://www.oneunified.net/blog/index.rss20?redirectURL=http://www.webtoolkit.eu/wt/doc/reference/html/Ext.html" onMouseOver="window.status='to www.webtoolkit.eu/wt/doc/reference/html/Ext.html'; return true;" onMouseOut="window.status=''; return true;" target=_blank>
Ext widgets</a> deployment page as there are some additional files to be downloaded and 
installed from Ext JS.

]]></content:encoded>
  <guid isPermaLink="true">http://www.oneunified.net/blog/OpenSource/Debian/Development/wtv3.article</guid>
</item>
<item>
  <title>PostgreSQL Upgrade 8.2 to 8.3</title>
  <link>http://www.oneunified.net/blog/OpenSource/Debian/pgupgrade.article</link>
  <category>/OpenSource/Debian</category>
  <pubDate>Wed, 04 Jun 2008 13:48:00 +0000</pubDate>
  <content:encoded><![CDATA[
<p>Back in Febrary, I wrote a longish article on how to upgrade PostgreSQL.  That article is 
outdated.  An upgrade can now take place with two lines:

<pre><blockquote>
pg_upgradecluster -v 8.3 8.2 main
pg_dropcluster 8.2 main
</blockquote></pre>

<p>The first copies the older version 8.2 files to the new 8.3 files directory.  It does any 
modifications necessary.  The second line then removes the old stuff.]]></content:encoded>
  <guid isPermaLink="true">http://www.oneunified.net/blog/OpenSource/Debian/pgupgrade.article</guid>
</item>
<item>
  <title>OpenSSH Issues</title>
  <link>http://www.oneunified.net/blog/OpenSource/Debian/opensshproblem.article</link>
  <category>/OpenSource/Debian</category>
  <pubDate>Tue, 03 Jun 2008 20:32:00 +0000</pubDate>
  <content:encoded><![CDATA[
<p>In light of the not so recent news regarding the vulnerability of openSSH in Debian, many 
systems have had to be patched and inter-machine keys changed.

<p>Via 
<a href="http://www.oneunified.net/blog/index.rss20?redirectURL=http://www.insidesocal.com/click/2008/05/i-clean-up-the-openssh-mess-on.html" onMouseOver="window.status='to www.insidesocal.com/click/2008/05/i-clean-up-the-openssh-mess-on.html'; return true;" onMouseOut="window.status=''; return true;" target=_blank>
Steven Rosenberg's Site</a> I learn that a simple 'apt-get update &&  apt-get dist-upgrade' 
will update the necessary files on my system.  Also in the blog entry is a reference to 
<a href="http://www.oneunified.net/blog/index.rss20?redirectURL=http://dronebl.org/" onMouseOver="window.status='to dronebl.org/'; return true;" onMouseOut="window.status=''; return true;" target=_blank>DRONEBL</a> which is another black list site 
dealing with root compromised sites.  A commenter posts the following interesting remarks 
about further protecting a server:

<p><blockquote>
If you aren't running fail2ban or denyhosts, you should. Both will detect brute force 
attempts and deny connections from the attacker for a time. If you feel uncomfortable 
automatically banning hosts for failed logins, you can weakly configure whichever you choose 
to allow 20 or more failed attempts before banning. There's no reason any authenticated 
service should tolerate brute force attempts, in my humble opinion.
<p>Finally, there are services, such as the DroneBL dnsbl, which have honeypot servers set 
up to detect brute force attempts and add them to a blacklist. You can use the "aclexec" 
directive in hosts.deny to query this blacklists before allowing clients to connect, to 
prevent connections from known brute force attackers. See http://headcandy.org/rojo/ for a 
suitable script to call via aclexec (view the source for the checkdnsbl script for usage 
instructions), and see the man page for hosts_options for more info.
</blockquote>

<p>Running 'ssh-vulnkey -a' showed that there were a couple keys that needed to be 
deleted and/or redone.

<p>Debian has a 
<a href="http://www.oneunified.net/blog/index.rss20?redirectURL=http://wiki.debian.org/SSLkeys" onMouseOver="window.status='to wiki.debian.org/SSLkeys'; return true;" onMouseOut="window.status=''; return true;" target=_blank>WIKI</a> with good information 
regarding the problem, affected programs, and utilities to help determine where the problems 
are.

<p>If weak keys have been copied to other non-Debian hosts, the keys need to be removed 
from those hosts as well.]]></content:encoded>
  <guid isPermaLink="true">http://www.oneunified.net/blog/OpenSource/Debian/opensshproblem.article</guid>
</item>
	</channel>
</rss>

