offsetting iterator
<p>I've got this :</p>

<pre><code>d = {"date": tuple(date),"open":tuple(open),"close":tuple(close)}

comp1 = zip(d['open'],d['close'])

for i in comp1:   
    if i[0]&lt;i[1]:
        print "bar up"

    if i[0]&gt;i[1]:
        print "bar down"
</code></pre>

<p>It's all well and good, it tells me if a bar is up or down, now I would like to "shift" my iteration (by one for example), but I don't know the syntax to it . The logic would be : </p>

<p>"if PREVIOUS bar is UP THEN print "yes" if CURRENT bar is also UP " .</p>

<p>Does it make sense ?</p>

<p>cheers,</p>
