Pages:
Author

Topic: Automated bitcoin arbitrage (Read 18895 times)

hero member
Activity: 640
Merit: 771
BTC⇆⚡⇄BTC
November 19, 2013, 08:49:13 PM
#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://bitcointalksearch.org/topic/btc-e-php-currency-arbitrage-bot-full-code-196313

https://bitcointalksearch.org/topic/php-btc-e-arbitrage-bot-236321

https://bitcointalksearch.org/topic/python-arbitrage-trader-for-various-exchanges-263815

Keep up the good work bro!

Cheers!
member
Activity: 101
Merit: 10
August 11, 2013, 01: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
    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
member
Activity: 101
Merit: 10
August 09, 2013, 01:48:38 PM
#57
Did try using TraderBot

Just crashed when trying to trade with Bitstamp
member
Activity: 101
Merit: 10
August 07, 2013, 03: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

legendary
Activity: 2044
Merit: 1005
August 06, 2013, 09:53:43 PM
#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.
member
Activity: 101
Merit: 10
August 05, 2013, 04:27:12 PM
#54
yep all working

just in tradersim mode

thanks

Ian W
member
Activity: 101
Merit: 10
August 05, 2013, 09:32:28 AM
#53
My goodness me

Thank you very much

Wil do it tonight
newbie
Activity: 48
Merit: 0
August 05, 2013, 09:06:49 AM
#52
markets = ["MtGoxUSD", "BitstampUSD"],

Remove the trailing comma in the line above.
member
Activity: 101
Merit: 10
August 04, 2013, 07:03:16 PM
#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


member
Activity: 101
Merit: 10
August 04, 2013, 04: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 = "[email protected]"
#xmpp_password = "FIXME"
#xmpp_to = "[email protected]"
member
Activity: 101
Merit: 10
August 04, 2013, 04: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
    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


member
Activity: 92
Merit: 10
July 06, 2013, 12: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.
newbie
Activity: 48
Merit: 0
July 06, 2013, 02: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)
member
Activity: 92
Merit: 10
July 05, 2013, 03: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?
newbie
Activity: 12
Merit: 0
May 11, 2013, 01: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
    from arbitrer import Arbitrer
  File "C:\Users\small502\Desktop\Bitcoin\bitcoin-arbitrage-master\arbitrage\arbitrer.py", line 5, in
    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.
newbie
Activity: 48
Merit: 0
May 09, 2013, 06: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/
newbie
Activity: 48
Merit: 0
May 02, 2013, 10:06:45 AM
#43
The private part of BTC-e API is not implemented _yet_

newbie
Activity: 8
Merit: 0
April 30, 2013, 12: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?
hero member
Activity: 896
Merit: 532
Former curator of The Bitcoin Museum
April 15, 2013, 12: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
    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
    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
hero member
Activity: 896
Merit: 532
Former curator of The Bitcoin Museum
April 13, 2013, 09:08:06 AM
#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
    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
Pages:
Jump to: