Bitcoin Forum
June 22, 2024, 08:40:15 AM *
News: Voting for pizza day contest
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Economy / Trading Discussion / Re: zipline / Quantopian - backtesting / trading framework on: May 13, 2013, 05:54:11 PM
Because MtGox only provide (to my knowledge) only an API to download each trade
(and it's a very big file !!!)


I understand its a very big file and that using 15 minute candles reduces the size of the database considerably, but having each trade can help simulate the spread much better (obviously having the orderbook would be ideal, but thats even more data). And with today hard drives being so cheap is it really a problem?

Certainly.  I think as it stands, I think the main problem with getting detailed trading data is that if you want to start from scratch it will take some time to pull it down from mtgox.  There is a sqlite database up to fairly recent trades here (and a python script that will attempt to pull in more recent trades):

http://cahier2.ww7.be/bitcoinmirror/phantomcircuit/

Edit: the script connects to mtgox.com rather than data.mtgox.com and should be updated in order to continue getting transactions.
2  Economy / Trading Discussion / Re: zipline / Quantopian - backtesting / trading framework on: May 13, 2013, 03:50:18 PM
but there is also an issue with Pandas

https://github.com/pydata/pandas/issues/783

see also this notebook

http://nbviewer.ipython.org/4982660/

it seems to be a clean way to draw candlesticks

Stumbled on that issue before.  It looks like the user who suggested a solution, even though he didn't submit a patch, has put up some of his personal charting tools:

https://github.com/dalejung/trtools

Haven't tried them yet, seems like it needs a few dependencies like tables (and consequently hdf5).
3  Economy / Trading Discussion / Re: zipline / Quantopian - backtesting / trading framework on: May 13, 2013, 01:58:16 AM
Thanks for your code.
We should output portfolio analysis (alpha, beta, sharpe ratio, sortino ratio ...)

I didn't find a good tutorial about zipline
maybe you have any pointer to provide me ?
we should also add entry / exit point efficiency.

There there are some examples:
https://github.com/quantopian/zipline/tree/master/zipline/examples

But I haven't found a ton of documentation.  At the moment if feels like one might be doing some code skimming and pydoc usage to look at the API.  I haven't tried compiling the documentation in the repo but the few files I looked at didn't seem to expand far beyond that.

Here's an example that extends MtQuid's notebook to try a method on the zipline mailing list:

http://nbviewer.ipython.org/ec53445ececcd94980b8

I'm not sure if those are correct or not, didn't check that the dates are actually UTC.

you was talking about trading fees...
but there is an other kind of fee that is not modeled here : spread
bid and ask price for a given BTC volume are differents !
difference is called spread = ask - bid
even if trading fees were 0% you will lose money to buy and sell BTC simultaneously

For now, we only have price... we don't know what spread value was for a
given datetime !

moreover unlike Forex market where spread is either fixed
or time dependant... in BTC market spread is volume dependant.
the higher BTC volume is, the higher spread is !!!

but that's probably only noticeable for very big BTC volume

Yeah, this is one thing that makes me the most concerned about backtesting. I don't know if there are any data sources that keep book history that could be used for this purpose either.  I can think of ways to maybe get a sense for it from the data by looking for alternating jumps in the data, but that'd be an approximation at best.

The only thing that came up in a quick search regarding order book history was this other thread which links to data from 2012:
https://bitcointalk.org/index.php?topic=88054.0

I'd be interested in other theories on how to deal with this.  I'd be thinking maybe either some estimated factor, or binning the data and going by the low, or doing priced asks/bids rather than market orders?  Or, as you suggest perhaps we could collect some data and do a model based on volume?  One could also look at trades that alternatingly up/down to get an idea of the spread?  Any modeling would need some test data though.
4  Economy / Trading Discussion / Re: ncurses based MtGox live monitor and trading-bot-framework on: May 11, 2013, 02:10:18 AM
Been lurking for a bit, mainly because it took a while to get out of newbie jail.

I've been playing around with some strategies using the pandas python module and EMAs.  As I think prof7bit noted somewhere, things like this seem to work well in some cases but then fall apart in others resulting in somewhat of a wash.  The latest thing I've given a try adds thresholding based on volume on top of using EMA crossovers.  We'll see :-)

One thing that might be of interest to those on here developing such algorithms might be quantopian.com which is a Python-based stackexchange-ish online forum for backtesting and discussing algorithms (they'll run the algorithms online and generate some nice plots/stats).  Their main data sources do not include bitcoin, but they do provide an ability to pull in CSV data from anywhere and there's at least one database that will provide daily data for that that one can test against it:

https://www.quantopian.com/posts/anyway-to-import-bitcoin-data

It might be interesting to build an adapter within a template to match the API here, or perhaps one of the other backtesting frameworks out there to be able to test algorithms.

Edit: Also, regarding GUIs why not use something based on matplotlib or maybe Enthought's Chaco which is designed for interactive plotting:
http://code.enthought.com/chaco/

Edit2: quantopian's backend is built around the zipline module, so perhaps that could figure into offline backtesting:
https://github.com/quantopian/zipline
5  Other / Beginners & Help / Re: If you could pick one "alt coin"... on: May 07, 2013, 08:28:17 PM
LTC in the short term.

The other SHA256 currencies are too volatile with fairly low hashrates and ASIC devices coming that can manipulate difficulties easily.
6  Other / Beginners & Help / Re: How long does it take to get rid of Newbie Status? on: May 06, 2013, 08:26:59 PM
this is humiliating, I've been mining since 2011 but never signed up here, and now I have to post in the newbie section

Ditto.  Actually my account here is even from 2011.  I've just usually browsed without logging in.
7  Other / Beginners & Help / Re: I've lurked for years... on: April 29, 2013, 02:07:20 AM
I actually made this account in 2011.  Forgot about the requirements for posting elsewhere.  Now back.
8  Other / Beginners & Help / Re: Newbie restrictions on: April 29, 2013, 02:02:20 AM
is this where we pad our post count to get access to the rest of the board? 

Yes.
9  Other / Beginners & Help / Re: Dwolla bans bitcoins under TOS? on: April 29, 2013, 01:47:57 AM
sure:

Quote
User Conduct

You understand and agree that you will not engage in the following activities:

    Use the Dwolla System without written consent to operate or engage in any business regulated by FinCen, including the money service business;
    Act as a marketplace and/or exchange for virtual currency products without prior written consent;

Key phrase there being "without prior written consent."  I would agree with others that this is just CYA.
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!