Pages:
Author

Topic: Automated bitcoin arbitrage - page 2. (Read 18901 times)

sr. member
Activity: 369
Merit: 250
April 12, 2013, 10:54:00 PM
#39
Oh man, this is one of those times I wish I was more tech savy  Cry
member
Activity: 112
Merit: 10
April 01, 2013, 09:32:40 PM
#38
Can this be used to arbitrage on the same exchange, ie mtgox USD/BTC-> BTC/EUR->EUR/USD?
newbie
Activity: 28
Merit: 0
March 30, 2013, 08:05:34 AM
#37
Yes I made some profits. But I had to stop the bot since some markets are sometimes not responding or replying with erroneous data. So I'm currently working at checking exchanges status/responsiveness and verifying trades.

And I need to write more automated tests for this part (like mocking erroneous response, ...)

If you need help of any kind (not a programmer); please feel free to ask.

Regards, NF414
newbie
Activity: 48
Merit: 0
March 30, 2013, 07:52:58 AM
#36
Yes I made some profits. But I had to stop the bot since some markets are sometimes not responding or replying with erroneous data. So I'm currently working at checking exchanges status/responsiveness and verifying trades.

And I need to write more automated tests for this part (like mocking erroneous response, ...)
newbie
Activity: 28
Merit: 0
March 30, 2013, 07:49:44 AM
#35
Thanks for sharing!

Anyone had any real-life profit from this automation yet?

Regards, NF414
hero member
Activity: 896
Merit: 532
Former curator of The Bitcoin Museum
March 27, 2013, 08:48:49 AM
#34
DobZombie, great work!

But why did you share the code? I think more competitors => less arbitraging possibilities. Or am I wrong?

lol, I'm not sharing any code!  I'm just testing it  Tongue

maxme is the genius behind this code Smiley
legendary
Activity: 2618
Merit: 1007
March 26, 2013, 03:36:52 PM
#33
More arbitrage --> more volume for trading bots!
Also the "algorithm" behind arbitrage bots is not really a secret at all, it might be better to get people to code up plugins for various APIs than to keep it a guarded secret. Also moving big amounts of money between exchanges is not trivial and not cheap too...

Thanks for actually open sourcing and releasing a useful and potentially profitable bot. Smiley
legendary
Activity: 1199
Merit: 1012
March 26, 2013, 03:19:11 PM
#32
DobZombie, great work!

But why did you share the code? I think more competitors => less arbitraging possibilities. Or am I wrong?
newbie
Activity: 48
Merit: 0
March 26, 2013, 01:37:19 PM
#31
I'm using the SpecializedTradingBot and it's outputting this...

What confuses me is ...
profit:
2.354073 EUR with volume:
1.000000 BTC -
buy at 62.7999 (MtGoxEUR)
sell at 62.8000 (BitcoinCentralEUR)
~3.75%

Some of those numbers don't add up.  Am I missing something?

See my previous message here https://bitcointalksearch.org/topic/m.1647793

But I should change logging messages...
hero member
Activity: 896
Merit: 532
Former curator of The Bitcoin Museum
March 26, 2013, 01:10:51 PM
#30
I'm using the SpecializedTradingBot and it's outputting this...

Code:
2013-03-27 04:01:19,473 [INFO][b] profit: 2.354073 EUR with volume: 1.000000 BTC - buy at 62.7999 (MtGoxEUR) sell at 62.8000 (BitcoinCentralEUR) ~3.75%[/b]
2013-03-27 04:01:52,920 [DEBUG] ticker: MtGoxEUR - {'ask': {'price': 61.0, 'amount': 10.0}, 'bid': {'price': 60.5, 'amount': 6.0}}
2013-03-27 04:01:52,921 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'price': 64.0, 'amount': 0.35183044}, 'bid': {'price': 63.0, 'amount': 0.27}}
2013-03-27 04:01:52,982 [WARNING] Can't automate this trade, profit=2.952351 is lower than defined threshold 3.500000
2013-03-27 04:01:52,982 [INFO][b] profit: 1.854073 EUR with volume: 1.000000 BTC - buy at 62.7999 (MtGoxEUR) sell at 62.8000 (BitcoinCentralEUR) ~2.95%[/b]
2013-03-27 04:02:22,983 [DEBUG] ticker: MtGoxEUR - {'ask': {'price': 61.0, 'amount': 10.0}, 'bid': {'price': 60.5, 'amount': 6.0}}
2013-03-27 04:02:22,983 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'price': 64.0, 'amount': 0.35183044}, 'bid': {'price': 63.0, 'amount': 0.27}}
2013-03-27 04:02:23,036 [WARNING] Can't automate this trade, profit=2.952351 is lower than defined threshold 3.500000

What confuses me is ...
profit:
2.354073 EUR with volume:
1.000000 BTC -
buy at 62.7999 (MtGoxEUR)
sell at 62.8000 (BitcoinCentralEUR)
~3.75%

Some of those numbers don't add up.  Am I missing something?
newbie
Activity: 48
Merit: 0
March 26, 2013, 01:00:46 PM
#29

I tried the traderbotsim in an older build and it didn't work.  But I works for me in the recent revision.

I've tried using the traderbot and all I get it this

Code:
2013-03-27 00:34:53,190 [DEBUG] ticker: MtGoxEUR - {'ask': {'price': 62.47, 'amount': 4.0}, 'bid': {'price': 61.9, 'amount': 32.50906816}}
2013-03-27 00:34:53,190 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'price': 64.92, 'amount': 49.16}, 'bid': {'price': 64.41004, 'amount': 1.279645}}
None
2013-03-27 00:35:37,321 [DEBUG] ticker: MtGoxEUR - {'ask': {'price': 62.47, 'amount': 4.0}, 'bid': {'price': 61.9, 'amount': 32.50906816}}
2013-03-27 00:35:37,321 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'price': 64.9, 'amount': 5.0}, 'bid': {'price': 64.41004, 'amount': 1.279645}}
2013-03-27 00:35:44,546 [WARNING] Can't automate this trade, last trade occured 43.9949998856 seconds ago
2013-03-27 00:36:17,240 [DEBUG] ticker: MtGoxEUR - {'ask': {'price': 62.47, 'amount': 4.0}, 'bid': {'price': 61.9, 'amount': 32.50906816}}
2013-03-27 00:36:17,242 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'price': 64.9, 'amount': 5.0}, 'bid': {'price': 64.41004, 'amount': 1.279645}}
2013-03-27 00:36:26,641 [WARNING] Can't automate this trade, last trade occured 86.0899999142 seconds ago
2013-03-27 00:37:00,523 [DEBUG] ticker: MtGoxEUR - {'ask': {'price': 62.485, 'amount': 4.0}, 'bid': {'price': 61.9, 'amount': 41.07126816}}
2013-03-27 00:37:00,525 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'price': 64.9, 'amount': 1.329572}, 'bid': {'price': 64.41004, 'amount': 1.279645}}
None
Whats going on?

Also, I'm okay losing money.  If this works out it could mean profit!!

I'd definitely owe ya Smiley


It seems you made your first automated transaction.

Code:
2013-03-27 00:35:44,546 [WARNING] Can't automate this trade, last trade occured 43.9949998856 seconds ago

The line above is a safeguard, it waits for TraderBot.trade_wait before executing the next trade (this will be removed when websocket order book sync is implemented)
hero member
Activity: 896
Merit: 532
Former curator of The Bitcoin Museum
March 26, 2013, 09:39:08 AM
#28
I tried the traderbotsim in an older build and it didn't work.  But I works for me in the recent revision.

I've tried using the traderbot and all I get it this

Code:
2013-03-27 00:34:53,190 [DEBUG] ticker: MtGoxEUR - {'ask': {'price': 62.47, 'amount': 4.0}, 'bid': {'price': 61.9, 'amount': 32.50906816}}
2013-03-27 00:34:53,190 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'price': 64.92, 'amount': 49.16}, 'bid': {'price': 64.41004, 'amount': 1.279645}}
None
2013-03-27 00:35:37,321 [DEBUG] ticker: MtGoxEUR - {'ask': {'price': 62.47, 'amount': 4.0}, 'bid': {'price': 61.9, 'amount': 32.50906816}}
2013-03-27 00:35:37,321 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'price': 64.9, 'amount': 5.0}, 'bid': {'price': 64.41004, 'amount': 1.279645}}
2013-03-27 00:35:44,546 [WARNING] Can't automate this trade, last trade occured 43.9949998856 seconds ago
2013-03-27 00:36:17,240 [DEBUG] ticker: MtGoxEUR - {'ask': {'price': 62.47, 'amount': 4.0}, 'bid': {'price': 61.9, 'amount': 32.50906816}}
2013-03-27 00:36:17,242 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'price': 64.9, 'amount': 5.0}, 'bid': {'price': 64.41004, 'amount': 1.279645}}
2013-03-27 00:36:26,641 [WARNING] Can't automate this trade, last trade occured 86.0899999142 seconds ago
2013-03-27 00:37:00,523 [DEBUG] ticker: MtGoxEUR - {'ask': {'price': 62.485, 'amount': 4.0}, 'bid': {'price': 61.9, 'amount': 41.07126816}}
2013-03-27 00:37:00,525 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'price': 64.9, 'amount': 1.329572}, 'bid': {'price': 64.41004, 'amount': 1.279645}}
None
Whats going on?

Also, I'm okay losing money.  If this works out it could mean profit!!

I'd definitely owe ya Smiley
full member
Activity: 193
Merit: 100
March 25, 2013, 05:27:51 PM
#27
Just to be sure, you use the TraderBotSim or you are ready to lose money and btc ?

Wink
hero member
Activity: 896
Merit: 532
Former curator of The Bitcoin Museum
March 25, 2013, 06:38:56 AM
#26
okay, So I was getting this
Code:
Traceback (most recent call last):
  File "arbitrage.py", line 186, in
    main()
  File "arbitrage.py", line 183, in main
    arbitrer.loop()
  File "arbitrage.py", line 159, in loop
    self.tick()
  File "arbitrage.py", line 150, in tick
    self.arbitrage_opportunity(kmarket1, market1["asks"][0], kmarket2, market2["bids"][0])
  File "arbitrage.py", line 113, in arbitrage_opportunity
    perc2, weighted_buyprice, weighted_sellprice)
  File "E:\BotEUR\src\observers\traderbot.py", line 63, in opportunity
    if volume < config.min_tx_volume:
AttributeError: 'module' object has no attribute 'min_tx_volume'

So I added this to the config.py
Code:
min_tx_volume = 0  # in BTC

But now it does this
Code:
2013-03-25 21:36:54,994 [DEBUG] ticker: MtGoxEUR - {'ask': {'price': 56.29, 'amount': 10.0}, 'bid': {'price': 56.09712, 'amount': 0.16727}}
2013-03-25 21:36:54,996 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'price': 59.255, 'amount': 10.0}, 'bid': {'price': 57.70004, 'amount': 1.21748}}
2013-03-25 21:37:08,430 [WARNING] Can't automate this trade, last trade occured 116.200000048 seconds ago
2013-03-25 21:37:40,948 [DEBUG] ticker: MtGoxEUR - {'ask': {'price': 56.29, 'amount': 10.0}, 'bid': {'price': 56.09712, 'amount': 0.16727}}
2013-03-25 21:37:40,950 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'price': 59.255, 'amount': 10.0}, 'bid': {'price': 57.70004, 'amount': 1.21748}}
None
2013-03-25 21:38:28,839 [DEBUG] ticker: MtGoxEUR - {'ask': {'price': 56.29, 'amount': 10.0}, 'bid': {'price': 56.09712, 'amount': 0.16727}}
2013-03-25 21:38:28,841 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'price': 59.255, 'amount': 10.0}, 'bid': {'price': 57.70004, 'amount': 1.21748}}
2013-03-25 21:38:36,418 [WARNING] Can't automate this trade, last trade occured 44.8589999676 seconds ago
2013-03-25 21:39:08,789 [DEBUG] ticker: MtGoxEUR - {'ask': {'price': 56.29, 'amount': 10.0}, 'bid': {'price': 56.09712, 'amount': 0.16727}}
2013-03-25 21:39:08,790 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'price': 59.255, 'amount': 10.0}, 'bid': {'price': 57.70004, 'amount': 1.21748}}
2013-03-25 21:39:16,447 [WARNING] Can't automate this trade, last trade occured 84.8870000839 seconds ago

I make for a good beta tester Tongue
hero member
Activity: 674
Merit: 500
March 22, 2013, 04:53:55 AM
#25
Does this bot require 2 exchanges for trading to happen? If yes is it possible to do trades with only 1?

Yes it requires 2 exchanges. Arbitrage means "buy at X on a market and sell at X+y on another market at the same time".

http://en.wikipedia.org/wiki/Arbitrage

No, it certainly doesn't require 2 exchanges.  There are thousands of people doing cross-currency arbitrage as we write this.  See: http://en.wikipedia.org/wiki/Triangular_arbitrage  This can be done in a single exchange.

And cross-currency arbitrage is getting quite popular in exchanges with several virtual and fiat currencies, like vircurex and btc-e.

A market is not synonymous with "an exchange".  Each exchange has multiple markets (usually): USD-BTC, EUR-BTC, LTC-BTC, etc.

And of course, spot/futures arbitrage
full member
Activity: 218
Merit: 100
March 21, 2013, 10:48:01 PM
#24
Does this bot require 2 exchanges for trading to happen? If yes is it possible to do trades with only 1?

Yes it requires 2 exchanges. Arbitrage means "buy at X on a market and sell at X+y on another market at the same time".

http://en.wikipedia.org/wiki/Arbitrage

No, it certainly doesn't require 2 exchanges.  There are thousands of people doing cross-currency arbitrage as we write this.  See: http://en.wikipedia.org/wiki/Triangular_arbitrage  This can be done in a single exchange.

And cross-currency arbitrage is getting quite popular in exchanges with several virtual and fiat currencies, like vircurex and btc-e.

A market is not synonymous with "an exchange".  Each exchange has multiple markets (usually): USD-BTC, EUR-BTC, LTC-BTC, etc.
full member
Activity: 193
Merit: 100
March 21, 2013, 05:56:18 AM
#23
Thx for explanations, i understand it after reading a bit more the code.

Also i was thinking of withdraw btc between exchanges place.
Example : buy one btc from bitcoin-central, sell at mtgox, withdraw one btc from bitcoincentral to mtgox 1 btc.

Did you think that a bad idea ?

It ll be more interesting if we can also transfer fund in euros between market, but that s not possible from api.
newbie
Activity: 48
Merit: 0
March 21, 2013, 02:14:36 AM
#22
Also, I'm getting this A LOT

Code:
Traceback (most recent call last):
  File "arbitrage.py", line 186, in
    main()
  File "arbitrage.py", line 183, in main
    arbitrer.loop()
  File "arbitrage.py", line 157, in loop
    self.depths = self.update_depths()
  File "arbitrage.py", line 118, in update_depths
    depths[market.name] = market.get_depth()
  File "E:\botEUR\src\public_markets\market.py", line 20, in get_depth
    self.ask_update_depth()
  File "E:\botEUR\src\public_markets\market.py", line 31, in ask_update_depth
    except HTTPError:
NameError: global name 'HTTPError' is not defined

what am I doin wrong? Is it possible for this error to come up if the network is congested? Also, It takes about an hour or more for this to come up

You're doing nothing, wrong. That was my bad, update the code. And yes it come from no-responding websites
hero member
Activity: 896
Merit: 532
Former curator of The Bitcoin Museum
March 20, 2013, 06:54:46 PM
#21
Does this bot require 2 exchanges for trading to happen? If yes is it possible to do trades with only 1?

Yes it requires 2 exchanges. Arbitrage means "buy at X on a market and sell at X+y on another market at the same time".

http://en.wikipedia.org/wiki/Arbitrage

I told you it was a stupid question Smiley

Also, I'm getting this A LOT

Code:
Traceback (most recent call last):
  File "arbitrage.py", line 186, in
    main()
  File "arbitrage.py", line 183, in main
    arbitrer.loop()
  File "arbitrage.py", line 157, in loop
    self.depths = self.update_depths()
  File "arbitrage.py", line 118, in update_depths
    depths[market.name] = market.get_depth()
  File "E:\botEUR\src\public_markets\market.py", line 20, in get_depth
    self.ask_update_depth()
  File "E:\botEUR\src\public_markets\market.py", line 31, in ask_update_depth
    except HTTPError:
NameError: global name 'HTTPError' is not defined

what am I doin wrong? Is it possible for this error to come up if the network is congested? Also, It takes about an hour or more for this to come up
legendary
Activity: 2618
Merit: 1007
March 20, 2013, 02:39:49 PM
#20
Well, I could trade on MtGox in BTCUSD and BTCEUR if I know EURUSD (or assume EURUSD as static - compared to BTC that might even be true)...

If there's a plugin for other "real" Forex brokers that might even work quite well! Still it might be enough to do fiat trades in bulk after some time, as the volatility is quite different there. Hence it might be possible to trade two currency pairs on the same "market".
Pages:
Jump to: