Bitcoin Forum
May 11, 2024, 06:01:46 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: 1 2 3 [All]
  Print  
Author Topic: Automated bitcoin arbitrage  (Read 18867 times)
maxme (OP)
Newbie
*
Offline Offline

Activity: 48
Merit: 0



View Profile WWW
March 16, 2013, 01:26:18 PM
 #1

Hi guys,

I wanted to share my code. It's a bitcoin arbitrage watcher and automated trade software. Written in Python:

https://github.com/maxme/bitcoin-arbitrage

Feedback and pull-requests are welcome Wink
1715450506
Hero Member
*
Offline Offline

Posts: 1715450506

View Profile Personal Message (Offline)

Ignore
1715450506
Reply with quote  #2

1715450506
Report to moderator
1715450506
Hero Member
*
Offline Offline

Posts: 1715450506

View Profile Personal Message (Offline)

Ignore
1715450506
Reply with quote  #2

1715450506
Report to moderator
The block chain is the main innovation of Bitcoin. It is the first distributed timestamping system.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
Fireball
Hero Member
*****
Offline Offline

Activity: 674
Merit: 500


View Profile WWW
March 16, 2013, 02:25:39 PM
 #2

If you'd like to add ICBIT support, I will be glad to help.

Margin trading platform OrderBook.net (ICBIT): https://orderbook.net
Follow us in Twitter: https://twitter.com/orderbooknet
whizter
Hero Member
*****
Offline Offline

Activity: 588
Merit: 500


View Profile
March 18, 2013, 07:55:38 PM
 #3

I'm running this in test-mode atm. Is it supposed to do this?

Quote
2013-03-18 20:46:12,680 [DEBUG] ticker: MtGoxEUR - {'ask': {'price': 36.97115, 'amount': 3.055}, 'bid': {'price': 36.95, 'amount': 7.68486008}}
2013-03-18 20:46:12,680 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'price': 37.05425, 'amount': 5.0}, 'bid': {'price': 37.00004, 'amount': 0.321795}}
2013-03-18 20:46:12,700 [INFO] profit: 0.138720 EUR with volume: 5.000000 BTC -buy at 37.0000 (MtGoxEUR) sell at 37.0000 (BitcoinCentralEUR) ~0.07%
2013-03-18 20:46:42,700 [DEBUG] ticker: MtGoxEUR - {'ask': {'price': 36.97115, 'amount': 3.055}, 'bid': {'price': 36.95, 'amount': 7.68486008}}
2013-03-18 20:46:42,700 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'price': 37.05425, 'amount': 5.0}, 'bid': {'price': 37.00004, 'amount': 0.321795}}
2013-03-18 20:46:42,720 [INFO] profit: 0.138720 EUR with volume: 5.000000 BTC -buy at 37.0000 (MtGoxEUR) sell at 37.0000 (BitcoinCentralEUR) ~0.07%
2013-03-18 20:47:15,361 [DEBUG] ticker: MtGoxEUR - {'ask': {'price': 36.97115, 'amount': 3.055}, 'bid': {'price': 36.95, 'amount': 7.68486008}}
2013-03-18 20:47:15,361 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'price': 37.05425, 'amount': 5.0}, 'bid': {'price': 37.00004, 'amount': 0.321795}}
2013-03-18 20:47:15,381 [INFO] profit: 0.138720 EUR with volume: 5.000000 BTC -buy at 37.0000 (MtGoxEUR) sell at 37.0000 (BitcoinCentralEUR) ~0.07%
2013-03-18 20:47:45,381 [DEBUG] ticker: MtGoxEUR - {'ask': {'price': 36.97115, 'amount': 3.055}, 'bid': {'price': 36.95, 'amount': 7.68486008}}
2013-03-18 20:47:45,381 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'price': 37.05425, 'amount': 5.0}, 'bid': {'price': 37.00004, 'amount': 0.321795}}
2013-03-18 20:47:45,401 [INFO] profit: 0.138720 EUR with volume: 5.000000 BTC -buy at 37.0000 (MtGoxEUR) sell at 37.0000 (BitcoinCentralEUR) ~0.07%
2013-03-18 20:48:17,581 [DEBUG] ticker: MtGoxEUR - {'ask': {'price': 36.97115, 'amount': 3.055}, 'bid': {'price': 36.95, 'amount': 7.58486008}}
2013-03-18 20:48:17,581 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'price': 37.05425, 'amount': 5.0}, 'bid': {'price': 37.00004, 'amount': 0.29454495}}
2013-03-18 20:48:17,601 [INFO] profit: 0.138719 EUR with volume: 5.000000 BTC -buy at 37.0000 (MtGoxEUR) sell at 37.0000 (BitcoinCentralEUR) ~0.07%
2013-03-18 20:48:47,601 [DEBUG] ticker: MtGoxEUR - {'ask': {'price': 36.97115, 'amount': 3.055}, 'bid': {'price': 36.95, 'amount': 7.58486008}}
2013-03-18 20:48:47,601 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'price': 37.05425, 'amount': 5.0}, 'bid': {'price': 37.00004, 'amount': 0.29454495}}
2013-03-18 20:48:47,621 [INFO] profit: 0.138719 EUR with volume: 5.000000 BTC -buy at 37.0000 (MtGoxEUR) sell at 37.0000 (BitcoinCentralEUR) ~0.07%
2013-03-18 20:49:19,020 [DEBUG] ticker: MtGoxEUR - {'ask': {'price': 36.97115, 'amount': 3.055}, 'bid': {'price': 36.95, 'amount': 7.58486008}}
2013-03-18 20:49:19,020 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'price': 37.05425, 'amount': 5.0}, 'bid': {'price': 37.00004, 'amount': 0.29454495}}
2013-03-18 20:49:19,040 [INFO] profit: 0.138719 EUR with volume: 5.000000 BTC -buy at 37.0000 (MtGoxEUR) sell at 37.0000 (BitcoinCentralEUR) ~0.07%
2013-03-18 20:49:49,051 [DEBUG] ticker: MtGoxEUR - {'ask': {'price': 36.97115, 'amount': 3.055}, 'bid': {'price': 36.95, 'amount': 7.58486008}}
2013-03-18 20:49:49,051 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'price': 37.05425, 'amount': 5.0}, 'bid': {'price': 37.00004, 'amount': 0.29454495}}
2013-03-18 20:49:49,061 [INFO] profit: 0.138719 EUR with volume: 5.000000 BTC -buy at 37.0000 (MtGoxEUR) sell at 37.0000 (BitcoinCentralEUR) ~0.07%
2013-03-18 20:50:20,631 [DEBUG] ticker: MtGoxEUR - {'ask': {'price': 36.974, 'amount': 2.0}, 'bid': {'price': 36.97115, 'amount': 15.8547}}
2013-03-18 20:50:20,631 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'price': 37.05425, 'amount': 5.0}, 'bid': {'price': 37.00004, 'amount': 0.29454495}}
2013-03-18 20:50:20,651 [INFO] profit: 0.126012 EUR with volume: 5.000000 BTC -buy at 37.0000 (MtGoxEUR) sell at 37.0000 (BitcoinCentralEUR) ~0.07%
2013-03-18 20:50:50,651 [DEBUG] ticker: MtGoxEUR - {'ask': {'price': 36.974, 'amount': 2.0}, 'bid': {'price': 36.97115, 'amount': 15.8547}}
2013-03-18 20:50:50,651 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'price': 37.05425, 'amount': 5.0}, 'bid': {'price': 37.00004, 'amount': 0.29454495}}
2013-03-18 20:50:50,671 [INFO] profit: 0.126012 EUR with volume: 5.000000 BTC -buy at 37.0000 (MtGoxEUR) sell at 37.0000 (BitcoinCentralEUR) ~0.07%
2013-03-18 20:51:22,151 [DEBUG] ticker: MtGoxEUR - {'ask': {'price': 36.974, 'amount': 2.0}, 'bid': {'price': 36.97115, 'amount': 15.8547}}
2013-03-18 20:51:22,151 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'price': 37.05425, 'amount': 5.0}, 'bid': {'price': 37.00004, 'amount': 0.29454495}}
2013-03-18 20:51:22,161 [INFO] profit: 0.126012 EUR with volume: 5.000000 BTC -buy at 37.0000 (MtGoxEUR) sell at 37.0000 (BitcoinCentralEUR) ~0.07%
2013-03-18 20:51:52,161 [DEBUG] ticker: MtGoxEUR - {'ask': {'price': 36.974, 'amount': 2.0}, 'bid': {'price': 36.97115, 'amount': 15.8547}}
2013-03-18 20:51:52,161 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'price': 37.05425, 'amount': 5.0}, 'bid': {'price': 37.00004, 'amount': 0.29454495}}
2013-03-18 20:51:52,171 [INFO] profit: 0.126012 EUR with volume: 5.000000 BTC -buy at 37.0000 (MtGoxEUR) sell at 37.0000 (BitcoinCentralEUR) ~0.07%
2013-03-18 20:52:23,512 [DEBUG] ticker: MtGoxEUR - {'ask': {'price': 36.974, 'amount': 2.0}, 'bid': {'price': 36.97115, 'amount': 15.8547}}
2013-03-18 20:52:23,512 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'price': 37.05425, 'amount': 5.0}, 'bid': {'price': 37.00004, 'amount': 0.29454495}}
2013-03-18 20:52:23,532 [INFO] profit: 0.126012 EUR with volume: 5.000000 BTC -buy at 37.0000 (MtGoxEUR) sell at 37.0000 (BitcoinCentralEUR) ~0.07%

        ███████████████████▄▄▄
        ████████████████████████▄▄
           ████████████████████████▄
    ▄▄▄▄▄▄▄██████████████████████████▄
    ███████████████       ▀▀███████████
        ███████               ██████████
        ███████                ██████████
████████   ████████             █████████
▀▀▀▀▀▀▀▀▄▄▄████████             █████████
        ███████████             █████████
    ████   ████████            ██████████
    ████   ████████           ██████████
        ███    ████       ▄▄███████████
    ▄▄▄▄███▄▄▄▄██████████████████████▀
    ███████████████████████████████▀
████    ████████████████████████▀▀
████    ███████████████████▀▀▀
DIMCOIN   
❱❱❱  facebook  ❱❱❱  twitter  ❱❱❱  Telegram  ❱❱❱
.The Future of Equity on The Blockchain.
DobZombie
Hero Member
*****
Offline Offline

Activity: 896
Merit: 532


Former curator of The Bitcoin Museum


View Profile
March 19, 2013, 11:42:09 AM
 #4

been getting this non stop all day

Code:
2013-03-19 21:19:57,178 [ERROR] HTTPError, can't update market: MtGoxUSD
2013-03-19 21:19:57,178 [WARNING] Market: MtGoxUSD order book is expired
2013-03-19 21:19:58,427 [ERROR] HTTPError, can't update market: MtGoxUSD
2013-03-19 21:19:58,428 [WARNING] Market: MtGoxUSD order book is expired

Tip Me if believe BTC1 will hit $1 Million by 2030
1DobZomBiE2gngvy6zDFKY5b76yvDbqRra
DobZombie
Hero Member
*****
Offline Offline

Activity: 896
Merit: 532


Former curator of The Bitcoin Museum


View Profile
March 19, 2013, 01:10:14 PM
 #5

oops, just realised.

"MtGox API url changed"

Redownloaded package from github and boom, back in business!

I wonder why they changed it?

Tip Me if believe BTC1 will hit $1 Million by 2030
1DobZomBiE2gngvy6zDFKY5b76yvDbqRra
maxme (OP)
Newbie
*
Offline Offline

Activity: 48
Merit: 0



View Profile WWW
March 19, 2013, 02:16:51 PM
 #6

I'm running this in test-mode atm. Is it supposed to do this?

Quote
2013-03-18 20:46:12,680 [DEBUG] ticker: MtGoxEUR - {'ask': {'price': 36.97115, 'amount': 3.055}, 'bid': {'price': 36.95, 'amount': 7.68486008}}
2013-03-18 20:46:12,680 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'price': 37.05425, 'amount': 5.0}, 'bid': {'price': 37.00004, 'amount': 0.321795}}
2013-03-18 20:46:12,700 [INFO] profit: 0.138720 EUR with volume: 5.000000 BTC -buy at 37.0000 (MtGoxEUR) sell at 37.0000 (BitcoinCentralEUR) ~0.07%

Yes, but the verbose mode, is too verbose Wink
maxme (OP)
Newbie
*
Offline Offline

Activity: 48
Merit: 0



View Profile WWW
March 19, 2013, 02:20:03 PM
 #7

If you'd like to add ICBIT support, I will be glad to help.

Do you have an HTTP API to get the market depth (order book) ?
Cyrus
Ninja
Administrator
Legendary
*
Online Online

Activity: 3766
Merit: 2950



View Profile
March 19, 2013, 02:46:13 PM
 #8

I actually found it on github first and now came here searching for the announcement thread.

Is the current version working?
I want to start testing today

And also... would like to see btc-e support soon! Great job Smiley.

Spaceman_Spiff
Legendary
*
Offline Offline

Activity: 1638
Merit: 1001


₪``Campaign Manager´´₪


View Profile
March 19, 2013, 09:07:44 PM
 #9

Hi guys,

I wanted to share my code. It's a bitcoin arbitrage watcher and automated trade software. Written in Python:

https://github.com/maxme/bitcoin-arbitrage

Feedback and pull-requests are welcome Wink

Aw man, you mean I spent my time building my own arbi-bot (probably a whole lot crappier than yours) for nothing?
Care to explain why you are giving this away for free?  By facilitating the effort required to start arbitraging, you are diminishing your own profits... (and mine  Smiley )
Fireball
Hero Member
*****
Offline Offline

Activity: 674
Merit: 500


View Profile WWW
March 19, 2013, 09:24:30 PM
 #10

Aw man, you mean I spent my time building my own arbi-bot (probably a whole lot crappier than yours) for nothing?
Care to explain why you are giving this away for free?  By facilitating the effort required to start arbitraging, you are diminishing your own profits... (and mine  Smiley )

Good arbitrage helps bitcoin economy and helps decentralize markets (e.g. helps other exchanges grow).

Margin trading platform OrderBook.net (ICBIT): https://orderbook.net
Follow us in Twitter: https://twitter.com/orderbooknet
whizter
Hero Member
*****
Offline Offline

Activity: 588
Merit: 500


View Profile
March 20, 2013, 08:33:22 AM
 #11

What exactly do I have to do to make it trade? It just does this all the time but no trades are happening, the same stuff as in my first post above. I'm using the newest version from github.

Quote
2013-03-20 08:27:17,214 [INFO] profit: 0.346785 EUR with volume: 3.428300 BTC - buy at 46.4201 (MtGoxEUR) sell at 46.5000 (BitcoinCentralEUR) ~0.22%
2013-03-20 08:27:47,570 [INFO] profit: 0.346785 EUR with volume: 3.428300 BTC - buy at 46.4201 (MtGoxEUR) sell at 46.5000 (BitcoinCentralEUR) ~0.22%
2013-03-20 08:28:19,206 [INFO] profit: 0.346785 EUR with volume: 3.428300 BTC - buy at 46.4201 (MtGoxEUR) sell at 46.5000 (BitcoinCentralEUR) ~0.22%

Of course I set my gox api keys and the bitcoincentral credentials. This is my conf:

Quote
markets = ["MtGoxEUR", "BitcoinCentralEUR"]
observers = ["Logger", "TraderBot", "HistoryDumper"]
market_expiration_time = 120 # in seconds: 2 minutes

...

        ███████████████████▄▄▄
        ████████████████████████▄▄
           ████████████████████████▄
    ▄▄▄▄▄▄▄██████████████████████████▄
    ███████████████       ▀▀███████████
        ███████               ██████████
        ███████                ██████████
████████   ████████             █████████
▀▀▀▀▀▀▀▀▄▄▄████████             █████████
        ███████████             █████████
    ████   ████████            ██████████
    ████   ████████           ██████████
        ███    ████       ▄▄███████████
    ▄▄▄▄███▄▄▄▄██████████████████████▀
    ███████████████████████████████▀
████    ████████████████████████▀▀
████    ███████████████████▀▀▀
DIMCOIN   
❱❱❱  facebook  ❱❱❱  twitter  ❱❱❱  Telegram  ❱❱❱
.The Future of Equity on The Blockchain.
maxme (OP)
Newbie
*
Offline Offline

Activity: 48
Merit: 0



View Profile WWW
March 20, 2013, 08:43:54 AM
 #12


Of course I set my gox api keys and the bitcoincentral credentials. This is my conf:

Quote
markets = ["MtGoxEUR", "BitcoinCentralEUR"]
observers = ["Logger", "TraderBot", "HistoryDumper"]
market_expiration_time = 120 # in seconds: 2 minutes

...

I think you're crazy to do that... Did you read the code first ? Are you sure that it will not just steal your coins ?

First, in TraderBot.py, you'll see some safeguards, for instance if the expected profit is lower than X and the expected profit percentage is lower than Y then it will not execute transactions. One of these safeguards should block current transaction.

But seriously, it's not a "packaged product", it's more a in-development project released for other developers. If you just run it like this, I guarantee you'll lose money.

If you really want to run it on real exchanges, then help me to write automated tests.
Khertan
Full Member
***
Offline Offline

Activity: 193
Merit: 100


View Profile WWW
March 20, 2013, 11:30:07 AM
 #13

Now i understand why you didn't put the perc_threshold and profit_threshold in the config file :p

maxme (OP)
Newbie
*
Offline Offline

Activity: 48
Merit: 0



View Profile WWW
March 20, 2013, 12:01:13 PM
 #14

Now i understand why you didn't put the perc_threshold and profit_threshold in the config file :p

Haha Wink

I would like people to write their own "TraderBot" class and not use the default. I should rename it to SampleTraderBot.
Khertan
Full Member
***
Offline Offline

Activity: 193
Merit: 100


View Profile WWW
March 20, 2013, 01:27:50 PM
 #15

Indeed but we can also write a good default one ... i'm a beginner in arbitrage domain ...

Khertan
Full Member
***
Offline Offline

Activity: 193
Merit: 100


View Profile WWW
March 20, 2013, 03:34:49 PM
 #16

There is something strange :

2013-03-20 16:31:32,985 [INFO] profit: 0.007277 EUR with volume: 0.010000 BTC - buy at 48.0000 (MtGoxEUR) sell at 48.0000 (BitcoinCentralEUR) ~1.52%

1.52 % with bought at 48 and sell at 48 ... due to rounding ?

maxme (OP)
Newbie
*
Offline Offline

Activity: 48
Merit: 0



View Profile WWW
March 20, 2013, 04:04:06 PM
 #17

Nope, it's not a rounding problem and it's not an issue.

The "buy price" given by the program is the maximum price you should buy BTC at.
The "sell price" given by the program is the minimum price you should sell BTC at.

Example with this order book:

Code:
books = {
    'MtGoxEUR':
    {'asks': [{'amount': 1, 'price': 47.0},
              {'amount': 2, 'price': 47.3},
              {'amount': 1, 'price': 48.0},
              {'amount': 3, 'price': 49.0}]},
    'BitcoinCentralEUR':
    {'bids': [{'amount': 1, 'price': 48.2},
              {'amount': 2, 'price': 48.1},
              {'amount': 1, 'price': 48.0},
              {'amount': 5, 'price': 47.9}]}}

Output will be :
Code:
volume: 3.0 BTC buy at 48.0 (MtGoxEUR) sell at 48.0 (BitcoinCentralEUR) 

Note: volume is 3.0 btc, not 4.0 btc (that includes 48.0 price)
DobZombie
Hero Member
*****
Offline Offline

Activity: 896
Merit: 532


Former curator of The Bitcoin Museum


View Profile
March 20, 2013, 06:12:43 PM
 #18

I don't intend this to be a dumb question but I fear it will be...

Does this bot require 2 exchanges for trading to happen? If yes is it possible to do trades with only 1?

Tip Me if believe BTC1 will hit $1 Million by 2030
1DobZomBiE2gngvy6zDFKY5b76yvDbqRra
maxme (OP)
Newbie
*
Offline Offline

Activity: 48
Merit: 0



View Profile WWW
March 20, 2013, 07:12:53 PM
 #19

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
Sukrim
Legendary
*
Offline Offline

Activity: 2618
Merit: 1006


View Profile
March 20, 2013, 07: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".

https://www.coinlend.org <-- automated lending at various exchanges.
https://www.bitfinex.com <-- Trade BTC for other currencies and vice versa.
DobZombie
Hero Member
*****
Offline Offline

Activity: 896
Merit: 532


Former curator of The Bitcoin Museum


View Profile
March 20, 2013, 11: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 <module>
    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

Tip Me if believe BTC1 will hit $1 Million by 2030
1DobZomBiE2gngvy6zDFKY5b76yvDbqRra
maxme (OP)
Newbie
*
Offline Offline

Activity: 48
Merit: 0



View Profile WWW
March 21, 2013, 07:14:36 AM
 #22

Also, I'm getting this A LOT

Code:
Traceback (most recent call last):
  File "arbitrage.py", line 186, in <module>
    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
Khertan
Full Member
***
Offline Offline

Activity: 193
Merit: 100


View Profile WWW
March 21, 2013, 10:56:18 AM
Last edit: March 21, 2013, 02:08:16 PM by Khertan
 #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.

w1R903
Full Member
***
Offline Offline

Activity: 218
Merit: 100


View Profile
March 22, 2013, 03:48:01 AM
 #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.

4096R/F5EA0017
Fireball
Hero Member
*****
Offline Offline

Activity: 674
Merit: 500


View Profile WWW
March 22, 2013, 09: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

Margin trading platform OrderBook.net (ICBIT): https://orderbook.net
Follow us in Twitter: https://twitter.com/orderbooknet
DobZombie
Hero Member
*****
Offline Offline

Activity: 896
Merit: 532


Former curator of The Bitcoin Museum


View Profile
March 25, 2013, 11:38:56 AM
 #26

okay, So I was getting this
Code:
Traceback (most recent call last):
  File "arbitrage.py", line 186, in <module>
    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

Tip Me if believe BTC1 will hit $1 Million by 2030
1DobZomBiE2gngvy6zDFKY5b76yvDbqRra
Khertan
Full Member
***
Offline Offline

Activity: 193
Merit: 100


View Profile WWW
March 25, 2013, 10:27:51 PM
 #27

Just to be sure, you use the TraderBotSim or you are ready to lose money and btc ?

Wink

DobZombie
Hero Member
*****
Offline Offline

Activity: 896
Merit: 532


Former curator of The Bitcoin Museum


View Profile
March 26, 2013, 02:39:08 PM
Last edit: March 26, 2013, 03:47:51 PM by DobZombie
 #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

Tip Me if believe BTC1 will hit $1 Million by 2030
1DobZomBiE2gngvy6zDFKY5b76yvDbqRra
maxme (OP)
Newbie
*
Offline Offline

Activity: 48
Merit: 0



View Profile WWW
March 26, 2013, 06: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)
DobZombie
Hero Member
*****
Offline Offline

Activity: 896
Merit: 532


Former curator of The Bitcoin Museum


View Profile
March 26, 2013, 06: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?

Tip Me if believe BTC1 will hit $1 Million by 2030
1DobZomBiE2gngvy6zDFKY5b76yvDbqRra
maxme (OP)
Newbie
*
Offline Offline

Activity: 48
Merit: 0



View Profile WWW
March 26, 2013, 06: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://bitcointalk.org/index.php?topic=153661.msg1647793#msg1647793

But I should change logging messages...
arsenische
Legendary
*
Offline Offline

Activity: 1199
Merit: 1012


View Profile
March 26, 2013, 08: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?

Sukrim
Legendary
*
Offline Offline

Activity: 2618
Merit: 1006


View Profile
March 26, 2013, 08: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

https://www.coinlend.org <-- automated lending at various exchanges.
https://www.bitfinex.com <-- Trade BTC for other currencies and vice versa.
DobZombie
Hero Member
*****
Offline Offline

Activity: 896
Merit: 532


Former curator of The Bitcoin Museum


View Profile
March 27, 2013, 01:48:49 PM
 #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

Tip Me if believe BTC1 will hit $1 Million by 2030
1DobZomBiE2gngvy6zDFKY5b76yvDbqRra
NF414
Newbie
*
Offline Offline

Activity: 28
Merit: 0



View Profile
March 30, 2013, 12:49:44 PM
 #35

Thanks for sharing!

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

Regards, NF414
maxme (OP)
Newbie
*
Offline Offline

Activity: 48
Merit: 0



View Profile WWW
March 30, 2013, 12:52:58 PM
 #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, ...)
NF414
Newbie
*
Offline Offline

Activity: 28
Merit: 0



View Profile
March 30, 2013, 01:05:34 PM
 #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
hiima
Member
**
Offline Offline

Activity: 112
Merit: 10


View Profile
April 02, 2013, 02:32:40 AM
 #38

Can this be used to arbitrage on the same exchange, ie mtgox USD/BTC-> BTC/EUR->EUR/USD?

Whiskey Fund BTC 1K2SG4amzNrB7gUwf5braHuExqnQ5nEKZp LTC Lgoz9gb7q39FMAmBz8odfkx4YFhLeofCpc
Caesar V
Sr. Member
****
Offline Offline

Activity: 369
Merit: 250



View Profile
April 13, 2013, 03:54:00 AM
 #39

Oh man, this is one of those times I wish I was more tech savy  Cry
DobZombie
Hero Member
*****
Offline Offline

Activity: 896
Merit: 532


Former curator of The Bitcoin Museum


View Profile
April 13, 2013, 02:08:06 PM
Last edit: April 14, 2013, 01:58:24 PM by DobZombie
 #40

When there is a potential trade I keep getting this...

Code:
2013-04-13 01:09:02,568 [DEBUG] ticker: BitcoinCentralEUR - {'ask': {'amount': 0.133669, 'price': 58.0}, 'bid': {'amount': 110.72, 'price': 57.0}}
2013-04-13 01:09:02,570 [DEBUG] ticker: MtGoxEUR - {'ask': {'amount': 0.697, 'price': 54.44384}, 'bid': {'amount': 18.8041, 'price': 53.18}}
2013-04-13 01:09:02,600 [INFO] profit: 11.798033 EUR with volume: 5.000000 BTC - buy at 56.9956 (MtGoxEUR) sell at 57.0000 (BitcoinCentralEUR) ~4.14%
Traceback (most recent call last):
  File "arbitrage.py", line 202, in <module>
    main()
  File "arbitrage.py", line 199, in main
    arbitrer.loop()
  File "arbitrage.py", line 172, in loop
    self.tick()
  File "arbitrage.py", line 163, in tick
    "asks"][0], kmarket2, market2["bids"][0])
  File "arbitrage.py", line 123, in arbitrage_opportunity
    perc2, weighted_buyprice, weighted_sellprice)
  File "E:\Bot\src\observers\traderbot.py", line 63, in opportunity
    self.clients[kbid].btc_balance)
AttributeError: 'PrivateBitcoinCentral' object has no attribute 'btc_balance'

EDIT : Nevermind, I downloaded the latest Commit and it's all good Smiley

Tip Me if believe BTC1 will hit $1 Million by 2030
1DobZomBiE2gngvy6zDFKY5b76yvDbqRra
DobZombie
Hero Member
*****
Offline Offline

Activity: 896
Merit: 532


Former curator of The Bitcoin Museum


View Profile
April 15, 2013, 05:28:42 PM
 #41

right, the latest commit does this when the arbitrage program wants to trade

Code:
2013-04-16 03:14:44,024 [INFO] Buy @MtGoxEUR 0.000905 BTC and sell @BitcoinCentralEUR
Traceback (most recent call last):
  File "arbitrage.py", line 214, in <module>
    main()
  File "arbitrage.py", line 198, in main
    arbitrer.loop()
  File "arbitrage.py", line 172, in loop
    self.tick()
  File "arbitrage.py", line 166, in tick
    observer.end_opportunity_finder()
  File "E:\bitcoin-arbitrage-master\src\observers\specializedtraderbot.py", line 34, in end_opportunity_finder
    self.execute_trade(*self.potential_trades[0][1:])
  File "E:\bitcoin-arbitrage-master\src\observers\specializedtraderbot.py", line 94, in execute_trade
    "weighted_buyprice=%f weighted_sellprice=%f" % (weighted_buyprice, weighted_sellprice))
  File "E:\bitcoin-arbitrage-master\src\observers\emailer.py", line 17, in send_email
    smtpObj = smtplib.SMTP(config.smtp_host)
  File "c:\python33\lib\smtplib.py", line 238, in __init__
    (code, msg) = self.connect(host, port)
  File "c:\python33\lib\smtplib.py", line 317, in connect
    self.sock = self._get_socket(host, port, self.timeout)
  File "c:\python33\lib\smtplib.py", line 288, in _get_socket
    self.source_address)
  File "c:\python33\lib\socket.py", line 417, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
socket.gaierror: [Errno 11004] getaddrinfo failed

E:\bitcoin-arbitrage-master\src>python arbitrage.py -v
2013-04-16 03:16:21,532 [DEBUG] ticker: MtGoxEUR - {'bid': {'price': 71.11, 'amount': 5.7}, 'ask': {'price': 71.81099, 'amount': 0.01}}
2013-04-16 03:16:21,533 [DEBUG] ticker: BitcoinCentralEUR - {'bid': {'price': 75.0, 'amount': 85.91478223}, 'ask': {'price': 76.0, 'amount
Traceback (most recent call last):
  File "arbitrage.py", line 214, in <module>
    main()
  File "arbitrage.py", line 198, in main
    arbitrer.loop()
  File "arbitrage.py", line 172, in loop
    self.tick()
  File "arbitrage.py", line 166, in tick
    observer.end_opportunity_finder()
  File "E:\bitcoin-arbitrage-master\src\observers\traderbot.py", line 33, in end_opportunity_finder
    self.execute_trade(*self.potential_trades[0][1:])
  File "E:\bitcoin-arbitrage-master\src\observers\traderbot.py", line 86, in execute_trade
    self.clients[kbid].sell(volume)
  File "E:\bitcoin-arbitrage-master\src\private_markets\bitcoincentral.py", line 73, in sell
    response = self.trade(amount, "sell", price)
  File "E:\bitcoin-arbitrage-master\src\private_markets\bitcoincentral.py", line 66, in trade
    response = self._send_request(self.trade_url, params)
  File "E:\bitcoin-arbitrage-master\src\private_markets\bitcoincentral.py", line 53, in _send_request
    response = urllib.request.urlopen(req)
  File "c:\python33\lib\urllib\request.py", line 160, in urlopen
    return opener.open(url, data, timeout)
  File "c:\python33\lib\urllib\request.py", line 471, in open
    req = meth(req)
  File "c:\python33\lib\urllib\request.py", line 1183, in do_request_
    raise TypeError(msg)
TypeError: POST data should be bytes or an iterable of bytes. It cannot be of type str.

I'm stuck finding the error (help)

o.0

Tip Me if believe BTC1 will hit $1 Million by 2030
1DobZomBiE2gngvy6zDFKY5b76yvDbqRra
somecdnguy4
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile
April 30, 2013, 05:23:01 AM
 #42

Hmm, the bot immediately closes if I include either SpecializedTraderBot or TraderBot, but not if TraderBotSim is included. Also, when trying to include BTC-e, the bot says

Code:
"[WARNING] Can't automate this trade, client not available: BTC-e

Though, upon viewing the TraderBotSim file code, I notice it doesn't fully include BTC-e support. I'll keep looking into it.

Someone earlier asked about inter-market trading. Any plans to support that in later releases?
maxme (OP)
Newbie
*
Offline Offline

Activity: 48
Merit: 0



View Profile WWW
May 02, 2013, 03:06:45 PM
 #43

The private part of BTC-e API is not implemented _yet_

maxme (OP)
Newbie
*
Offline Offline

Activity: 48
Merit: 0



View Profile WWW
May 09, 2013, 11:49:19 AM
 #44

I pushed a new feature: fiat currency mixed trades. Now you can buy on market X with EUR and sell on market Y with USD.

Note: Fiat rates conversion are updated every hour from http://rate-exchange.appspot.com/
small502
Newbie
*
Offline Offline

Activity: 12
Merit: 0


View Profile
May 11, 2013, 06:44:01 PM
 #45

Is anyone getting an error like this?

Code:
Python 3.3.1 (v3.3.1:d9893d13c628, Apr  6 2013, 20:30:21) [MSC v.1600 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>>
Traceback (most recent call last):
  File "C:\Users\small502\Desktop\Bitcoin\bitcoin-arbitrage-master\arbitrage\arbitrage.py", line 5, in <module>
    from arbitrer import Arbitrer
  File "C:\Users\small502\Desktop\Bitcoin\bitcoin-arbitrage-master\arbitrage\arbitrer.py", line 5, in <module>
    import config
  File "C:\Users\small502\Desktop\Bitcoin\bitcoin-arbitrage-master\arbitrage\config.py", line 17
    mtgox_key =
                          ^
SyntaxError: invalid token
>>>

I did remove my mtgox key but when i run the program the key shows up fine.
JstnPwll
Member
**
Offline Offline

Activity: 92
Merit: 10


View Profile
July 05, 2013, 08:56:05 PM
 #46

Is there no way to transfer funds between exchanges? Otherwise why would it be beneficial to buy low on one and sell high on the other?

Developer, entrepreneur, idea-seeker.
BTC: 14MP75VG3Nf53pSEjowmA9gVPVvEvNpabz
maxme (OP)
Newbie
*
Offline Offline

Activity: 48
Merit: 0



View Profile WWW
July 06, 2013, 07:10:39 AM
 #47

You may:
  • withdraw funds from an exchange and deposit to an other exchange (manual and long operation, painful, cuts profits with fees)
  • wait for a counter operation and buy low on the exchange you sold previously
  • use other currencies (ltc for instance)
  • wait for an equilibrium and do a negative operation only to transfer funds from one exchange to another (cuts profits of course)
JstnPwll
Member
**
Offline Offline

Activity: 92
Merit: 10


View Profile
July 06, 2013, 05:17:24 PM
 #48

Hmm. It seems like the most automatic method would be to code it so that when there's an equilibrium, both accounts trade out some of the currency they have been selling for the currency they've been buying. Like you said, it would cut profits (especially with trade fees), but that might be better than stagnating and missing good trade opportunities.

P.S. Thanks for the code! I'm having fun looking at it.

Developer, entrepreneur, idea-seeker.
BTC: 14MP75VG3Nf53pSEjowmA9gVPVvEvNpabz
Ianwhitbread
Member
**
Offline Offline

Activity: 101
Merit: 10


View Profile
August 04, 2013, 09:48:16 PM
 #49

just trying to run

but getting this error, I believed i configured correctly and was using the tradersim  to test

python3 '/xxx/bitcoin-arbitrage-master/arbitrage/arbitrage.py'
Traceback (most recent call last):
  File "/xxx/bitcoin-arbitrage-master/arbitrage/arbitrage.py", line 63, in <module>
    main()
  File "/xxx/bitcoin-arbitrage-master/arbitrage/arbitrage.py", line 60, in main
    cli.main()
  File "/xxx/bitcoin-arbitrage-master/arbitrage/arbitrage.py", line 55, in main
    self.create_arbitrer(args)
  File "/xxx/bitcoin-arbitrage-master/arbitrage/arbitrage.py", line 33, in create_arbitrer
    self.arbitrer = Arbitrer()
  File "/xxx/bitcoin-arbitrage-master/arbitrage/arbitrer.py", line 17, in __init__
    self.init_markets(config.markets)
  File "/xxx/bitcoin-arbitrage-master/arbitrage/arbitrer.py", line 24, in init_markets
    exec('import public_markets.' + market_name.lower())
AttributeError: 'list' object has no attribute 'lower'

Bitcoin-GA-990XA-UD3:~$

Thanks


Ianwhitbread
Member
**
Offline Offline

Activity: 101
Merit: 10


View Profile
August 04, 2013, 09:55:32 PM
 #50

and this is my config file

# watch the following markets
# ["MtGoxEUR", "BitcoinCentralEUR", "IntersangoEUR", "Bitcoin24EUR",
# "BitstampEUR", "BtceUSD", "MtGoxUSD", "BitfloorUSD", "BitstampUSD"]
markets = ["MtGoxUSD", "BitstampUSD"],
#"BitcoinCentralUSD", "Bitcoin24USD"  # BitfloorUSD, , "CampBXUSD (closed), "BtceUSD",

# observers if any
# ["Logger", "TraderBot", "TraderBotSim", "HistoryDumper", "Emailer"]
observers = ["TraderBotSim"]

market_expiration_time = 120  # in seconds: 2 minutes

refresh_rate = 20

#### Trader Bot Config
# Access to Private APIs
mtgox_key = "blah"
mtgox_secret = "blaah"

#bitcoincentral_username = "FIXME"
#bitcoincentral_password = "FIXME"
#bitcoincentral_address = "FIXME"  # to deposit btc from markets / wallets

bitstamp_username = "blah"
bitstamp_password = "blahblah"

# SafeGuards
max_tx_volume = 1  # in BTC
min_tx_volume = 0.1  # in BTC
balance_margin = 0.05  # 5%
profit_thresh = 1  # in EUR
perc_thresh = 3  # in %

#### Emailer Observer Config
smtp_host = 'mysmtp'
smtp_login = 'blahblahblah'
smtp_passwd = 'blahblahblah'
smtp_from = 'myemail'
smtp_to = 'myemal'

#### XMPP Observer
#xmpp_jid = "FROM@jabber.org"
#xmpp_password = "FIXME"
#xmpp_to = "TO@jabber.org"
Ianwhitbread
Member
**
Offline Offline

Activity: 101
Merit: 10


View Profile
August 05, 2013, 12:03:16 AM
 #51

if anyone can help with the above

well that would be very kind

take care and thank you

I just cant see where I am going wrong

im on

ubuntu 13
Python3

thanks


maxme (OP)
Newbie
*
Offline Offline

Activity: 48
Merit: 0



View Profile WWW
August 05, 2013, 02:06:49 PM
 #52

markets = ["MtGoxUSD", "BitstampUSD"],

Remove the trailing comma in the line above.
Ianwhitbread
Member
**
Offline Offline

Activity: 101
Merit: 10


View Profile
August 05, 2013, 02:32:28 PM
 #53

My goodness me

Thank you very much

Wil do it tonight
Ianwhitbread
Member
**
Offline Offline

Activity: 101
Merit: 10


View Profile
August 05, 2013, 09:27:12 PM
 #54

yep all working

just in tradersim mode

thanks

Ian W
sidhujag
Legendary
*
Offline Offline

Activity: 2044
Merit: 1005


View Profile
August 07, 2013, 02:53:43 AM
 #55

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".
U will never make money arbing a forex broker. If u trade against broker u will be banned and id u trade against the bank u will get last looked to death.
Ianwhitbread
Member
**
Offline Offline

Activity: 101
Merit: 10


View Profile
August 07, 2013, 08:42:13 AM
 #56

Was running quite nicely till this happened

2013-08-07 09:40:03,243 [ERROR] HTTPError, can't update market: BitstampUSD
2013-08-07 09:40:03,244 [WARNING] Market: BitstampUSD order book is expired
2013-08-07 09:40:03,964 [ERROR] HTTPError, can't update market: BitstampUSD
2013-08-07 09:40:03,965 [WARNING] Market: BitstampUSD order book is expired
2013-08-07 09:40:24,738 [ERROR] HTTPError, can't update market: BitstampUSD
2013-08-07 09:40:24,739 [WARNING] Market: BitstampUSD order book is expired
2013-08-07 09:40:25,604 [ERROR] HTTPError, can't update market: BitstampUSD
2013-08-07 09:40:25,605 [WARNING] Market: BitstampUSD order book is expired

I was able to login to bitstamp  via the website,
so did not seen offiline

hope you can help

thank you

Ianwhitbread
Member
**
Offline Offline

Activity: 101
Merit: 10


View Profile
August 09, 2013, 06:48:38 PM
 #57

Did try using TraderBot

Just crashed when trying to trade with Bitstamp
Ianwhitbread
Member
**
Offline Offline

Activity: 101
Merit: 10


View Profile
August 11, 2013, 06:47:24 AM
 #58

This was the Error

No Trades were made

is it me thats causing the problem or the exchanges
Traceback (most recent call last):
  File "/home/blah/bitcoin-arbitrage-master/arbitrage/arbitrage.py", line 63, in <module>
    main()
  File "/home/blah/bitcoin-arbitrage-master/arbitrage/arbitrage.py", line 60, in main
    cli.main()
  File "/home/blah/bitcoin-arbitrage-master/arbitrage/arbitrage.py", line 56, in main
    self.exec_command(args)
  File "/home/blah/bitcoin-arbitrage-master/arbitrage/arbitrage.py", line 15, in exec_command
    self.arbitrer.loop()
  File "/home/blah/bitcoin-arbitrage-master/arbitrage/arbitrer.py", line 190, in loop
    self.tick()
  File "/home/blah/bitcoin-arbitrage-master/arbitrage/arbitrer.py", line 181, in tick
    kmarket2, market2["bids"][0])
  File "/home/blah/bitcoin-arbitrage-master/arbitrage/arbitrer.py", line 133, in arbitrage_opportunity
    perc2, weighted_buyprice, weighted_sellprice)
  File "/home/blah/bitcoin-arbitrage-master/arbitrage/observers/traderbot.py", line 60, in opportunity
    self.update_balance()
  File "/home/blah/bitcoin-arbitrage-master/arbitrage/observers/traderbot.py", line 41, in update_balance
    self.clients[kclient].get_info()
  File "/home/blah/bitcoin-arbitrage-master/arbitrage/private_markets/bitstampusd.py", line 68, in get_info
    response = self._send_request(self.balance_url)
  File "/home/blah/bitcoin-arbitrage-master/arbitrage/private_markets/bitstampusd.py", line 45, in _send_request
    response = urllib.request.urlopen(req)
  File "/usr/lib/python3.3/urllib/request.py", line 160, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.3/urllib/request.py", line 479, in open
    response = meth(req, response)
  File "/usr/lib/python3.3/urllib/request.py", line 591, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.3/urllib/request.py", line 517, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.3/urllib/request.py", line 451, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.3/urllib/request.py", line 599, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 522: Origin Connection Time-out
Financisto
Hero Member
*****
Offline Offline

Activity: 632
Merit: 768

BTC⇆⚡⇄BTC


View Profile WWW
November 20, 2013, 01:49:13 AM
Last edit: November 23, 2013, 08:29:06 AM by Financisto
 #59

Greetings!

Just found this tool out.

It's great!

Just some suggestions for TODO:

* Add Triangular Arbitrage calculator and automated arbitrage implementation of it: as previously said - "This can be done in a single exchange";

* Add automated arbitrage for altcoins pairs (LTC/BTC; NMC/BTC; PPC/BTC; XPM/BTC etc.);

* Add support for exchanges with medium volume and various cryptocoins (such as Vircurex and Cryptsy);

Ps.: forget Ripple support...  Cool

BTW, here goes some codes and other similar ideas in order to get some insights:

https://bitcointalk.org/index.php?topic=196313.0

https://bitcointalk.org/index.php?topic=236321.0

https://bitcointalk.org/index.php?topic=263815.0

Keep up the good work bro!

Cheers!

LIST • ESCROW providers • Ranking & Scores available!LIST • FOSS BrainwalletsBTC ⇆⚡⇄ BTCBTC aka BTC: 16MBvhaJoRBxW3Vk6apnvz3UYT9HAgraVS ⚡ PGP: 2680207AA9A1B69FE7A033D80DE0F221074384C4 ⚡ If you think freedom matters, please support the development of these privacy projects→DONATE some sats: TailsQubes OSWhonixVeraCryptPicocryptKryptorSimpleX Chat
Pages: 1 2 3 [All]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!