Efficient/diffrent way to align data series
<p>What are some ways to align 2 data series (i.e stock data) so that the dates match?</p>

<p>I can think of a few ways.</p>

<ol>
<li>Duplicate older data to fill in </li>
<li>Throw out any missing dates from both sets</li>
</ol>

<p>Not sure how to wrap my head around this to do it efficiently my data is stored in 2 lists.</p>

<p>Thanks for the first reply! Here is what I've tried so far. I don't like these comparer classes, though:</p>

<pre><code>  baseBars = baseBars.Intersect(secondaryBars, new BarDateComparer()).ToList();
  secondaryBars = secondaryBars.Intersect(baseBars, new BarDateComparer()).ToList(); 

 public class BarDateComparer : IEqualityComparer&lt;Bar&gt;
    {

        public bool Equals(Bar x, Bar y)
        {

            return x.Date == y.Date;

        }       
        public int GetHashCode(Bar obj)
        {

            return obj.Date.GetHashCode();
        }

    }
</code></pre>
