Stock transactions indicator

@emord 
Even for something like line 127? Could it possibly be replaced by for f, t in intervals(interval, datespan.startdate, datespan.enddate) ?