Bitcoin Forum

Economy => Economics => Topic started by: itake on July 07, 2011, 10:28:01 PM



Title: Image of my Trading Bot (and it's low power!)
Post by: itake on July 07, 2011, 10:28:01 PM
I just wanted to share a picture of my trading bot.  It has been online for about 2 weeks now and has gotten me more money than my mining equipment.


https://i.imgur.com/NVTOe.jpg

I wrote my script in Python and moved it to the Chumpy via USB.  It's the only computer I have that I can leave on 24/7. :-/


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: kwiky on July 07, 2011, 11:15:26 PM
Care to share or explain any more than that. Or are you just showing off or spreading fud?


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: itake on July 07, 2011, 11:26:15 PM
Care to share or explain any more than that. Or are you just showing off or spreading fud?

I wrote a script in python (tested on my PC) and then I loaded it onto the chumby.

If you need advice for how to put python on a chumby, look here: http://wiki.chumby.com/index.php/Python (http://wiki.chumby.com/index.php/Python).

I currently only trade on MtGox, but I plan on writing a program for TradeHill so I don't have all of my eggs in one basket.


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: imperi on July 07, 2011, 11:27:49 PM
Why not run the trading bot on a Linux server, such as Ubuntu? I don't get it.

You can also get money quickly by gambling heads/tails.


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: itake on July 07, 2011, 11:40:33 PM
Why not run the trading bot on a Linux server, such as Ubuntu? I don't get it.

You can also get money quickly by gambling heads/tails.

it is a linux server?  And its what I had sitting around.


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: naturallaw on July 07, 2011, 11:46:33 PM
Not sure what a chumby is, but it's very geeky with the exposed wires and breadboard, I like it


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: kr105 on July 09, 2011, 03:22:10 PM
Not sure what a chumby is, but it's very geeky with the exposed wires and breadboard, I like it
+1
We want the "how to build" :D


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: itake on July 09, 2011, 05:56:47 PM
Cool.  8)

How much does the entire setup cost to make?

+1
We want the "how to build" :D

As far as hardware, the Chumby is as-is.  Using the previous link, I installed that version linux on there with the python package.

A Chumby One (pictured) costs $129.95 (new). http://store.chumby.com/chumby-CHB802XXXX-one/dp/B0030QUU4M?ie=UTF8&id=chumby%20CHB802XXXX%20one&field_product_site_launch_date_utc=-1y&field_availability=-1&field_browse=2619998011&searchSize=12&searchNodeID=2619998011&searchPage=1&class=quickView&refinementHistory=brandtextbin%2Csubjectbin%2Ccolor_map%2Cprice%2Csize_name&searchRank=salesrank (http://store.chumby.com/chumby-CHB802XXXX-one/dp/B0030QUU4M?ie=UTF8&id=chumby%20CHB802XXXX%20one&field_product_site_launch_date_utc=-1y&field_availability=-1&field_browse=2619998011&searchSize=12&searchNodeID=2619998011&searchPage=1&class=quickView&refinementHistory=brandtextbin%2Csubjectbin%2Ccolor_map%2Cprice%2Csize_name&searchRank=salesrank)

Writing the trading algorthm just took a lot of time.  I compiled the log data from June 19, 2011 until today and this is what I got:

Starting USD: $4000

# of Trades: 5
Net Profit: $861.13
Average Profit: $172.xx
Average Profit %: 3.45%

Winning Trades: 4
Win Rate: 80.xx%
Gross Profit: $974.xx
Average Profit: $243.xx
Max consecutive wins: 3

Losing trades: 1
Loss rate: 20.xx%
Gross Loss: $113.xx
Average Loss: $113.xx
Average Loss %: -2.27%
Max consecutive losses 1

If I just bought and held:
Net Profit: -$694.xx

I don't know if I mentioned this before, but I trade on MtGox.

Not sure what a chumby is, but it's very geeky with the exposed wires and breadboard, I like it

The breadboard is just another project I was working on.  The chumby is a digital alarm clock (see link in previous post).


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: MatthewLM on July 09, 2011, 06:55:29 PM
I'm making a bot and it's annoying because I run my Macbook 24/7 which isn't convenient.

My tests so far have been negative. :( One version made a simulated loss of 25% in only about 2 days.


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: itake on July 09, 2011, 07:19:23 PM
I'm making a bot and it's annoying because I run my Macbook 24/7 which isn't convenient.

My tests so far have been negative. :( One version made a simulated loss of 25% in only about 2 days.

You need to look at more data than just 2 days worth.  I back tested about 40 different strategies (98% of them were no profit or loss).

When backtesting, I chose the range of data from June 11 - present, because that Gizmodo spike isn't something I can realistically expect to happen again.


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: grue on July 09, 2011, 07:26:39 PM
mind sharing its algorithm?


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: MatthewLM on July 09, 2011, 07:34:17 PM
Maybe I didn't give it chance but I made what I believed to be two improved versions which I'm testing now. I have to wait for the simulated results since the algorithm can't be sped up very much.

I can't really use many more than about 8 days of data for performance reasons. ;) I should hopefully increase performance however. I also need to do more tests.


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: itake on July 09, 2011, 07:57:46 PM
Maybe I didn't give it chance but I made what I believed to be two improved versions which I'm testing now. I have to wait for the simulated results since the algorithm can't be sped up very much.

I can't really use many more than about 8 days of data for performance reasons. ;) I should hopefully increase performance however. I also need to do more tests.

I wrote mine on a 4 year old laptop with 2GB RAM.  A few things I did to speed everything up is:

  • Take the trade data and save it to the HD (grabbing from server takes forever...)
  • Don't write anything to the interface.  Having to wait for the UI thread significantly increases processing time.
  • Pre-process as much of the data as possible.  So you don't have to re-calculate everything with each trial


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: MatthewLM on July 09, 2011, 09:15:15 PM
I had a GUI and I removed it. It makes little difference actually but it crashed a few times so I reverted to file and command line UI.

I do cache the data. You use a service which contains more data than the APIs from Mt Gox, Trade Hill or other places? With those APIs you have to download all the data available an then select and append data to the cached data.

You've used python I see. I have used python as well but I will likely try to convert it to C to try and get as much out of it as possible. I use pysco to improve performance.

If I increase performance I can also increase the complexity of the algorithm.


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: angelo95 on July 09, 2011, 09:36:51 PM
Congrats. Wonderful bot.


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: anthony.selby on July 09, 2011, 10:01:20 PM
Sounds awesome


  I would love to see that ... ?


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: angelo95 on July 09, 2011, 10:25:02 PM
so you don't use a database?


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: anthony.selby on July 09, 2011, 10:28:32 PM
If your interested in sharing  pm me and we can talk price


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: itake on July 10, 2011, 01:38:12 AM
so you don't use a database?

A database for what? I didn't do any fancy genetic algorithms (in fact my entire program is only about 300 lines of code).  Although that would be cool to do.  I just don't have the time to figure out how to do it.  I am just a college student that taught myself some programming.


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: MatthewLM on July 10, 2011, 01:52:43 AM
Do you use the bitcoincharts.com API? It says I shouldn't rely on it, so I collect and cache prices myself.


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: itake on July 10, 2011, 03:00:28 AM
Do you use the bitcoincharts.com API? It says I shouldn't rely on it, so I collect and cache prices myself.

Yeah, I saw that it said that too.  I think they don't want people accidently DDOSing their servers.  I just collect the most recent (3 days back) data from bitcoin charts.  It is just easier and I haven't had any problems with it.


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: MatthewLM on July 10, 2011, 01:49:17 PM
How is it performing now, since the bitcoin price has become rather flat?

I'm sure my bot will pick better trades if prices become more volatile again. It's easy to make false signals when it is flat.


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: angelo95 on July 10, 2011, 02:43:01 PM
How is it performing now, since the bitcoin price has become rather flat?

I'm sure my bot will pick better trades if prices become more volatile again. It's easy to make false signals when it is flat.

The thing is I am not sure it will become again as volatile as before again. I am from now 'training' my bot to perform on a flatter market...


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: MatthewLM on July 10, 2011, 02:48:39 PM
My bot is supposed to figure out everything in roughly 30 seconds with 4 days of price data. I don't have to train it over time. I hoped it would adapt to the flatter prices and stop making poor signals but I have run the algorithm very long, so I will see what happens over a bit more time...


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: angelo95 on July 10, 2011, 02:51:08 PM
By training I mean refining your algos. I make them better all the time, and improve the speed to. My bot is now multi-threaded and reacts in 3 seconds, with a giant database to store the history.


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: itake on July 10, 2011, 03:31:40 PM
By training I mean refining your algos. I make them better all the time, and improve the speed to. My bot is now multi-threaded and reacts in 3 seconds, with a giant database to store the history.

Speaking of bitcoin charts not beign reliable... the site went down for a little bit today lol.

What language did you write your bot in?

---------------------

The performance data listed previously was over this range:

http://bitcoincharts.com/charts/mtgoxUSD#rg30zczsg2011-06-18zeg2011-07-11zvztgSzm1g10zm2g25


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: angelo95 on July 10, 2011, 03:37:43 PM
By training I mean refining your algos. I make them better all the time, and improve the speed to. My bot is now multi-threaded and reacts in 3 seconds, with a giant database to store the history.

Speaking of bitcoin charts not beign reliable... the site went down for a little bit today lol.

What language did you write your bot in?

---------------------

The performance data listed previously was over this range:

http://bitcoincharts.com/charts/mtgoxUSD#rg30zczsg2011-06-18zeg2011-07-11zvztgSzm1g10zm2g25

What site? I am using Mtgox data. I started the bot in php and I am now slighty converting it to python. Php is not the fastest language but for a network application it's ok.


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: itake on July 10, 2011, 03:49:52 PM
By training I mean refining your algos. I make them better all the time, and improve the speed to. My bot is now multi-threaded and reacts in 3 seconds, with a giant database to store the history.

Speaking of bitcoin charts not beign reliable... the site went down for a little bit today lol.

What language did you write your bot in?

---------------------

The performance data listed previously was over this range:

http://bitcoincharts.com/charts/mtgoxUSD#rg30zczsg2011-06-18zeg2011-07-11zvztgSzm1g10zm2g25

What site? I am using Mtgox data. I started the bot in php and I am now slighty converting it to python. Php is not the fastest language but for a network application it's ok.

Bitcoin charts was down for about 10 mins.  my algo isn't very resource intensive, so I haven't really had any probs with efficiency.  I am debating on whether or not to add a slicker interface to help me analyze the data better.

I don't like how there isn't a good way to determine what the actual cost per coin was for a completed (or incomplete) order.  So I am just guessing that every order was filled at the expected price.


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: angelo95 on July 10, 2011, 04:00:47 PM
If you trade on mtgox, why don't you use mtgox data?


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: itake on July 10, 2011, 04:03:43 PM
If you trade on mtgox, why don't you use mtgox data?

MtGox only gives you recent trades (I think?).  They don't have the nice start/end time params that bitcoin charts has.  For my bot, I need to look some distance in the past.


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: MatthewLM on July 10, 2011, 04:09:28 PM
I could increase the performance by taking advantage of GPU parrellel computing. The performance increase could be massive. I will look into it.


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: angelo95 on July 10, 2011, 04:40:24 PM
I could increase the performance by taking advantage of GPU parrellel computing. The performance increase could be massive. I will look into it.

I don't think so. You are still limited by your connection to mtgox via internet. Could you elaborate on this?


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: MatthewLM on July 10, 2011, 04:56:49 PM
Downloading the data takes about 2 seconds maximum and the rest takes almost 30 seconds to compute. My algorithm runs on a single thread when I could separate tasks out to 50 cores including the 48 cores the GeForce 320M apparently has.


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: angelo95 on July 10, 2011, 05:05:15 PM
30 secs of computing seems a lot to me for a simple bot. Are you running a db (like SQL) or something? Mine takes almost nothing to compute the algo with a few hundreds mysql queries per minute. I run it on a core 2 duo CPU.

But maybe you are running a Monte-carlo simulation on it... I don't want to go in the secret of your algorithm  :)


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: MatthewLM on July 10, 2011, 05:08:46 PM
Database? No idea why that is needed.

All I can say is my algorithm is supposed to do lots of computations to create the best results but my tests are making me disappointed so far. It's by no means supposed to be a simple algorithm set to follow one simple strategy.

It's in early stages though.


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: angelo95 on July 10, 2011, 05:12:30 PM
The OP has been successful with a simple script. I think at this stage it's the way to go. There is not enough volatility, nor volume to make it more complicated. This is what I get looking at many successful bot related stories...


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: MatthewLM on July 10, 2011, 05:16:26 PM
Can his bot adapt automatically? What if he runs it for a long time but the strategy used is no longer appropriate to changing bitcoin circumstances?


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: angelo95 on July 10, 2011, 05:21:10 PM
We don't know what kind of algos he used in it. And as you might know, it's not polite to ask about algos  ;D

However you can implement many scenarios to manage pretty much any situation and still get a decent execution time. The bitcoin activity has nothing to compare with the density of the Forex.

I have also optimized my code to go from 3 minutes to a few seconds.


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: itake on July 10, 2011, 05:41:13 PM
Can his bot adapt automatically? What if he runs it for a long time but the strategy used is no longer appropriate to changing bitcoin circumstances?

My bot is very very simple and there is nothing dynamic about it.  Ignoring all of the code for talking with the server, my bot is about 80 lines of code.

I think that there isn't enough market data for a bot to be really complicated.  We are really only working with about 3 months of data.

The market is also extremely small, making it very volatile and random.  A few days ago, someone sold like $23k worth of BTC and it caused the market to drop about $3.  This randomness and lack of data makes calculating trends difficult.  I gave up trying to figure out the little swings and I mostly just look at whats in the ticker feed.

Plus, the small hourly swings are very hard to take advantage of because there isn't that much market volume.  So with small swings, there might not be enough coins to purchase at that price.

I have absolutely no expertise in trading, so I really don't know what I am doing.


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: angelo95 on July 10, 2011, 05:42:34 PM
I totally agree with you.


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: Fakeman on July 10, 2011, 08:19:42 PM
I know the OP mentioned buying the device for another purpose originally, but what about using one of those plug computers? No graphics capability but much cheaper in many cases, like under $50. They all seem to have 1.2 Ghz ARM processors.


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: angelo95 on July 10, 2011, 09:14:31 PM
I know the OP mentioned buying the device for another purpose originally, but what about using one of those plug computers? No graphics capability but much cheaper in many cases, like under $50. They all seem to have 1.2 Ghz ARM processors.

Plug computers are perfect for this application!


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: opticbit on July 10, 2011, 10:17:06 PM
has anyone made a trading bot available to everyone?
will this one be open at somepoint?


Title: Re: Image of my Trading Bot (and it's low power!)
Post by: angelo95 on July 10, 2011, 10:39:05 PM
has anyone made a trading bot available to everyone?
will this one be open at somepoint?

There are some bitcoin bots available (I think I stumbled upon a python script one time), have a look on this forum and on pastebin... Thing is the more you share your trading bot the less efficient it it...