Reputation: 31
Basically as you all know we can backtest our strategies in Zipline, the problem is that Zipline is developed for stock markets and the minimum order of an asset that can be ordered is 1 in those markets but in crypto markets we are able to order a fraction of a Crypto currency. So how can I make zipline to order a fraction of Bitcoin base on the available capital?
Upvotes: 0
Views: 197
Reputation: 51
You can simulate your test on a smaller scale, e.g. on Satoshi level (1e8).
I can think of two methods:
handle_data
method to either order on Satoshi level or based on your portfolio percentage using order_target_percent
method.NOTE: Zipline rounds the inputs to 3 decimal points. So re-scaling to Satoshi turns prices that are lower than 5000 to NaN
(not considering rounding errors for higher prices). My suggestion is to either use 1e5 for Bitcoin or log-scale.
Upvotes: 0