New feature :
variable lot size (instead of fixed lot size)
self.trade_volume is now a function which returns volume to trade according
portfolio cash and BTCUSD price.
http://nbviewer.ipython.org/587a80f5e2eb9cf41d6dalpha= 138.7%
max DD = 7.5%
should I order the rolls-royce?
Nice work.... if only we could go back in time
I think there were some missing rows in the method I used to pull from bitcoincharts so I've made some modifications and a cache that stays up to date.
I've also include frequency information but still 'minute' runs are not working correctly. We might have to tamper with zipline internals to get them going.
You should update your work to at least use the better bitcoincharts methods.
Now in my testing I keep an up to date cache of minute data from bitcoincharts and resample that to how I want it.
Fractional trades are still an issue.
A fix would be to use satoshi but then the prices will all have to be suitable scaled and the results will just look a mess.
Or bump the initial portfolio value up to a few billion and increase the trade volume so that there will be no fractions but then slippage is very unrealistic.
Or modify zipline internals or use an inherited object
About passing live trade data to an algorithm:
I'm thinking of creating a new TradingAlgorithm object that is passed a DateTimeIndex and will take trade data from the phantom sqlite3 db and create OHCL and pass both simulated live data and OHCL to an algorithm under test. So the wrapper gets a datetime and frequency from zipline and extracts the data from the phantom db, passes this to the algo inder test and then passes the results back to zipline.
Just an idea bu this might also be a way to fix the fractional trades issue.
Updated -
http://nbviewer.ipython.org/5572250Edit: In fact even if the zipline results records are always daily it does not matter because we can put minute results into something else, or accumulate them for a day. Depends on what you want to log in the results. Currently, I guess that, the same record gets overwritten a lot for each minute in a day so only the last record of the day is saved in the results
Also seams like there is a bug in my example because the trade volumes are messed up and I've lost a lot of money :/Edit: All working now. I was not using ohlc resampling