We shipped a feature today that I think you are all going to love. You can now graph arbitrary values with your backtests!
You can read the full help description in our API help document, but here is the quick-and-dirty. Within your handle_data function, you can identify up to five data series to be recorded and plotted. Each series consists of a name of the series and the corresponding values to be plotted. Your code might look like this:
record(short_mavg = data[context.sid].mavg(20),
long_mavg = data[context.sid].mavg(60),
goog_price = data[context.sid].price)
Those time series are then plotted in your backtest. You can click on a data series in the legend to remove a series, and then click again to add it back.
There are a number of different ways to use this new feature. We think the most common way is going to display the buy/sell signals that you are computing, like the example below. It's very illuminating to see when the different-length moving averages cross each other. You can also code it such that it shows stock position, buy/sell events, just about anything that you want to see displayed.
There is at least one bug out there - the y-axis is sometimes drawn without numerical labels. Please let us know if you find any others.
All of our features come from member feedback, but this one in particular was driven by your suggestions. Thank you all for weighing in, particularly here and here.
One note about data exploration: We get a lot of feature requests for data exploration tools. We hear them, loud and clear, and we don't think that this feature is powerful enough to be a true data exploration tool; it just scratches the surface. Most days we're working hard on providing live trading so that you can actually trade your algorithms through your broker. Once live trading is available we will have more time to work on data exploration.