Bitcoin Forum
October 22, 2017, 02:04:32 PM *
News: Latest stable version of Bitcoin Core: 0.15.0.1  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1] 2 »  All
  Print  
Author Topic: Python Arbitrage trader for various Exchanges  (Read 10631 times)
JohnDorien
Sr. Member
****
Offline Offline

Activity: 462


View Profile
July 28, 2013, 11:25:04 AM
 #1

I wrote an arbitrage trader in Python and want to share it with the community:

https://mega.co.nz/#!X0ZkwRJa!bxdS2Ch2NvXdPDACTsUbYkrlZbN_R9v51OZWkyEj8ms

It does compare the prices sell / buy for various Altcoins on the exchanges: Coins-E, BTC-e, Vircurex and Cryptsy.
It executes the Sell / buy trades as arbitrage of given percentage is found.

Usage:
Edit the config.py with your Keypairs for every exchange
Edit the value "amount" if you like to
Have at least the amount of altcoins you set in the config in your available funds of each exchange. BTC fund has to be highest price altcoin * amount

Run arbitrage_trader.py

It is not totally completed yet, what i will further implement:
 - Error handling on connection errors
 - Percentage of available funds to be traded instead of fixed value
 - Maybe easier edit possibility for more / less coins


If you like this please donate to help my development!
BTC: 1JxT7dgLxbdHR9iBpu7v4z4ph3kjD5pjA9
LTC: LQ32aPGFGwFb7MxvLTai2ePwRFRbnSKpWv


If you encounter any bugs or wish to have more exchanges, or have any other feature request, tell me

Please remember, there is absolutely no guarantee there is any arbitrage at all! I am not responsible for any loss, especially when you modify the code yourself!
1508681072
Hero Member
*
Offline Offline

Posts: 1508681072

View Profile Personal Message (Offline)

Ignore
1508681072
Reply with quote  #2

1508681072
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
mercSuey
Sr. Member
****
Offline Offline

Activity: 364


View Profile
July 28, 2013, 11:59:03 AM
 #2

Have you used your own trader?  How about some results? 
JohnDorien
Sr. Member
****
Offline Offline

Activity: 462


View Profile
July 28, 2013, 12:01:33 PM
 #3

Have you used your own trader?  How about some results? 

Yep ofc I use it. Last 3 days a total win of ~0.5 BTC (Low trading volumes for me as i do not have that much funds)
bybitcoin
Hero Member
*****
Offline Offline

Activity: 672



View Profile
August 21, 2013, 05:08:46 PM
 #4

I've had the impression that arbitrage is only possible among a triangle (or square....) of pairs shaping a cycle, for example BTC/LTC, LTC/XPM, XPM/BTC, or for a pair existing in two different markets (like BTC/$ in MtGox and BitStamp).
But I see that in cryptsy almost all alts are traded against BTC which makes me confused about how your trader is supposed to make any arbitrage trade there. Could you explain this?
alexxy
Sr. Member
****
Offline Offline

Activity: 363


View Profile
August 21, 2013, 05:44:33 PM
 #5

Can you put all your files to github?

also
Code:
$ python2 arbitrage_trader.py
Traceback (most recent call last):
  File "arbitrage_trader.py", line 13, in <module>
    from vircurex import *
ImportError: No module named vircurex
6raygp
Newbie
*
Offline Offline

Activity: 27


View Profile
September 08, 2013, 11:23:42 PM
 #6

has anyone tried this? has there been any updates? Very curious.
ltcgaming
Jr. Member
*
Offline Offline

Activity: 36


View Profile
September 09, 2013, 12:32:51 AM
 #7

Checking this out now - I've pushed a copy to Github for collaboration here:

https://github.com/PeanutPower/CryptoArbitrageTrader

(will transfer ownership of repo to John if he so desires)

ltcgaming
Jr. Member
*
Offline Offline

Activity: 36


View Profile
September 09, 2013, 01:00:54 AM
 #8

Code:
>python arbitrage_trader.py

Starting Arbitrage checking for Currency ltc
Unhandled exception in thread started by <function run1 at 0x0000000002CFA0B8>
Traceback (most recent call last):
  File "arbitrage_trader.py", line 180, in run1
    compare() #die Hauptfunktion der Arbitrage
  File "arbitrage_trader.py", line 147, in compare
    if round((int(bprice) * Diff * FEE),8) < round((int(sprice) * FEE),8):
ValueError: invalid literal for int() with base 10: 'Market buy price get error'

ltcgaming
Jr. Member
*
Offline Offline

Activity: 36


View Profile
September 09, 2013, 01:28:40 AM
 #9

getS returning "price get error" for cryptsy LTC

... https://github.com/salfter/PyCryptsy

and when I try BTC-e on it's own:

Code:
Starting Arbitrage checking for Currency ltc
Unhandled exception in thread started by <function run1 at 0x0000000002C78828>
Traceback (most recent call last):
  File "arbitrage_trader.py", line 180, in run1
    compare() #die Hauptfunktion der Arbitrage
  File "arbitrage_trader.py", line 147, in compare
    if round((int(bprice) * Diff * FEE),8) < round((int(sprice) * FEE),8):
UnboundLocalError: local variable 'bprice' referenced before assignment

ltcgaming
Jr. Member
*
Offline Offline

Activity: 36


View Profile
September 09, 2013, 02:12:26 AM
 #10

OK i've debugged this a bit locally and the price checking stuff seems to be working for me on all exchanges EXCEPT Cryptsy and Crypto-Trade

Code:
Starting Arbitrage checking for ltc/btc
Sell price = 0.02198008 on vircu
Buy price = 0.02244443 on vircu
Sell price = 0.02199008 on vircu
Buy price = 0.02236 on btc-e
Sell price = 0.02199008 on vircu
Buy price = 0.02244443 on coins-e
Sell price = 0.02225 on btc-e
Buy price = 0.02244443 on vircu
Sell price = 0.02225 on btc-e
Buy price = 0.02236 on btc-e
Sell price = 0.02225 on btc-e
Buy price = 0.02236 on coins-e
Sell price = 0.02225 on coins-e
Buy price = 0.02236 on vircu
Sell price = 0.02199008 on coins-e
Buy price = 0.02236 on btc-e
Sell price = 0.02225 on coins-e
Buy price = 0.02236 on coins-e
Starting Arbitrage checking for nmc/btc
Sell price = 0.00468115 on vircu
Buy price = 0.00487995 on vircu
Sell price = 0.00468116 on vircu
Buy price = 0.00478 on btc-e
Sell price = 0.00468116 on vircu
Buy price = 0.00487995 on coins-e
Sell price = 0.00477 on btc-e
Buy price = 0.00487995 on vircu
Sell price = 0.00477 on btc-e
Buy price = 0.00478 on btc-e
Sell price = 0.00477 on btc-e
Buy price = 0.00478 on coins-e
Sell price = 0.00477 on coins-e
Buy price = 0.00478 on vircu
Sell price = 0.00469116 on coins-e
Buy price = 0.00478 on btc-e
Sell price = 0.00477 on coins-e
Buy price = 0.00478 on coins-e
Round completed sleeping for 15 seconds

yourofl10
Full Member
***
Offline Offline

Activity: 168


View Profile
September 09, 2013, 02:22:31 AM
 #11

How do you get it setup and running with the right APIs for your account?

ltcgaming
Jr. Member
*
Offline Offline

Activity: 36


View Profile
September 09, 2013, 02:23:51 AM
 #12

How do you get it setup and running with the right APIs for your account?

edit config.py

note i've just checked in an updated config.py that excludes the two exchanges that aren't working from the default configuration

https://github.com/PeanutPower/CryptoArbitrageTrader/commit/67435e4504c336bdbb2206cc78289bfaf85b6a8a

ltcgaming
Jr. Member
*
Offline Offline

Activity: 36


View Profile
September 09, 2013, 03:04:57 AM
 #13

ok i know why crypto-trade is broken .... cos crypto.py is using POST requests to

https://crypto-trade.com/api/1/depth/ltc_btc

which crypto-trade now reject unless it is an unauthenticated GET request...

so the underlying code from matuszed/crypto needs to be fixed to get crypto-trade to work

p.s. no trading opportunities have come up for me so far Sad

ltcgaming
Jr. Member
*
Offline Offline

Activity: 36


View Profile
September 09, 2013, 04:36:01 AM
 #14

I think I've fixed up the crypto-trade code

https://github.com/PeanutPower/CryptoArbitrageTrader

ltcgaming
Jr. Member
*
Offline Offline

Activity: 36


View Profile
September 09, 2013, 05:01:36 AM
 #15

I've had the impression that arbitrage is only possible among a triangle (or square....) of pairs shaping a cycle, for example BTC/LTC, LTC/XPM, XPM/BTC, or for a pair existing in two different markets (like BTC/$ in MtGox and BitStamp).
But I see that in cryptsy almost all alts are traded against BTC which makes me confused about how your trader is supposed to make any arbitrage trade there. Could you explain this?

not really ... it's possible that LTCBTC on one exchange, LTC is being bought higher than it is being sold on another exchange, just that these opportunities rarely occur

daybyter
Legendary
*
Offline Offline

Activity: 965


View Profile
September 09, 2013, 11:51:43 AM
 #16

It happens quite often. Problem is, to get the money back to the other exchange. Might work best via fiat, if you know a good payment service (I do not... Sad )...

Financisto
Hero Member
*****
Offline Offline

Activity: 544

0=m ฿itcoin m=0


View Profile WWW
November 20, 2013, 04:35:14 AM
 #17

Greetings!

Is this still alive and kicking?

It's been a while since BTC-e, Vircurex and Cryptsy added some more altcoins.

BTW, is it possible to add automated (triangular and 2-currency) arbitrage for altcoins pairs (LTC/BTC; NMC/BTC; PPC/BTC; XPM/BTC etc.)?

Keep up the good work!

BTC BitcoinTalk's Escrow Providers: Ranking & Blacklist BTC Brainwallet & Paper Wallet projects BTC If you think privacy matters, please help keeping these projects alive (donating some coins): Tor BTC Tails BTC Qubes OS BTC Whonix BTC ProtonMail BTC Tutanota BTC VeraCrypt BTC PrivacyTools.io BTC
eureka
Sr. Member
****
Offline Offline

Activity: 300


网络·自由·客


View Profile WWW
November 20, 2013, 07:02:11 AM
 #18

May be all of you will interest the coin trade platform here.
The screenshot is out:
http://eeurl.com/cointrade

nimiq.cn  dac.xyz 《易经》亁卦用九 现群龙无首 吉
Financisto
Hero Member
*****
Offline Offline

Activity: 544

0=m ฿itcoin m=0


View Profile WWW
November 21, 2013, 01:15:28 AM
 #19

May be all of you will interest the coin trade platform here.
The screenshot is out:
http://eeurl.com/cointrade

Your platform is very nice!

Do you have any plans to offer an english version of it?

Does it calculate and monitor arbitrage opportunities at one or more exchanges?

Success with your software!

BTC BitcoinTalk's Escrow Providers: Ranking & Blacklist BTC Brainwallet & Paper Wallet projects BTC If you think privacy matters, please help keeping these projects alive (donating some coins): Tor BTC Tails BTC Qubes OS BTC Whonix BTC ProtonMail BTC Tutanota BTC VeraCrypt BTC PrivacyTools.io BTC
becva
Newbie
*
Offline Offline

Activity: 5


View Profile
December 02, 2013, 10:34:40 PM
 #20

Hi there
Has anyone been using JohnDorien's arbitrage trader? I've been trying to run & it finds some great opportunities, however at the point of buy/sell it errors. This is what I have been seeing - can anyone help me understand why?

Unhandled exception in thread started by <function run1 at 0x0000000002CFF518>
Traceback (most recent call last):
  File "C:\Program Files\CryptoArbitrageTrader-master\arbitrage_trader.py", line 193, in run1
    compare() #The main Arbitrage function
  File "C:\Program Files\CryptoArbitrageTrader-master\arbitrage_trader.py", line 161, in compare
    make_trade(exc[m], "buy", amount1, pairpart1, "btc", bprice)
  File "C:\Program Files\CryptoArbitrageTrader-master\arbitrage_trader.py", line 123, in make_trade
    authenticated_request('market/%s/' % (pairpart1+'_'+pairpart2),"neworder",{'order_type':'buy', 'rate':rate, 'quantity':amount,})
  File "C:\Program Files\CryptoArbitrageTrader-master\coinse_api.py", line 41, in authenticated_request
    f = open('coins-e_nonce', 'w')
IOError: [Errno 13] Permission denied: 'coins-e_nonce'


Thanks!
Becva
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!