Hi Daniel,
tl;dr -- What you are seeing is intended behavior for fetcher, which wasn't intended to ingest raw orders. The core issue is your source data has indexing collisions. However, you can adapt your source data to produce the behavior you want.
Some background - the idea for fetcher is to pull in prices, signals, and other values. The data pulled in is translated to a series of events, such that each row in a csv will be a distinct event. The data parameter sent to handle_data always has the most recent values received -- effectively forward filling.
The confusing bit is that the data you are fetching is used to create the index on the dataframe fed into the simulation. Because the rows have sparse dates, the dataframe itself will have the same sparse dates as its index, and there will be no NaNs for "missing" days.
My initial thought to fix the problem was to massage the dataframe to have a complete index of trading days, letting pandas fill in missing values with NaNs.
This requires some advanced pandas programming. To create the "missing" days, you need the dataframe produced by fetcher to have all the trading days, not just the days where you generated orders. My strategy was to re-index the dataframe with the datetimeindex produced from the zipline trading calendar.
This is complicated firstly because the index in the dataframe is not unique. Since you have orders for multiple securities on each day, there are multiple entries in the index for each day. Look for 7/8/2002 in your source data, for example, there are four orders. The format of the data in the csv is known as "record" or "stacked". Pandas includes a method called pivot, which can reshape the data (more info here: http://pandas.pydata.org/pandas-docs/stable/reshaping.html). This code should make a column for each symbol, create a unique index for the date, and make NShares the value of each cell:
pivot = df.pivot(columns="symbol", index="Date", values="Nshares")
However, this call fails with your source csv, because there are some days that have multiple orders for the same symbol (e.g. XLK has a buy and sell on 7/8/2002), and pandas needs to be able to create a unique index of date,symbol to do the pivot. If you plan to place multiple orders per day, your date field needs more resolution, to avoid index collisions.
Given the issues with reshaping the data, it occurred to me that feeding orders to your algorithm this way conflicts with "expected" use cases for Fetcher, and the best resolution might be to just reformat your input data. My advice is to change your source csv to have "target_position_size" in number of shares for a target position, instead of order amounts. That way you can compare your current position in the sid to the target position from the csv, and place orders accordingly.
thanks,
fawce