Giter Club home page Giter Club logo

bitcoin-arbitrage's People

Contributors

achiang avatar hisabness avatar kevin-prichard avatar maccam912 avatar maxme avatar mseneque avatar patricksi avatar sixty4bit avatar sscarduzio avatar tadejs avatar twoblink avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bitcoin-arbitrage's Issues

I can not use the app

Traceback (most recent call last):
File "arbitrage/arbitrage.py", line 97, in
main()
File "arbitrage/arbitrage.py", line 94, in main
cli.main()
File "arbitrage/arbitrage.py", line 90, in main
self.exec_command(args)
File "arbitrage/arbitrage.py", line 24, in exec_command
self.create_arbitrer(args)
File "arbitrage/arbitrage.py", line 61, in create_arbitrer
self.arbitrer = Arbitrer()
File "/home/mvillalba/app/tool/bitcoin-arbitrage/arbitrage/arbitrer.py", line 17, in init
self.init_markets(config.markets)
File "/home/mvillalba/app/tool/bitcoin-arbitrage/arbitrage/arbitrer.py", line 27, in init_markets
market_name + '()')
File "", line 1, in
File "/home/mvillalba/app/tool/bitcoin-arbitrage/arbitrage/public_markets/bitfinexusd.py", line 11, in init
super().init("USD")
File "/home/mvillalba/app/tool/bitcoin-arbitrage/arbitrage/public_markets/market.py", line 18, in init
self.fc.update()
File "/home/mvillalba/app/tool/bitcoin-arbitrage/arbitrage/fiatconverter.py", line 63, in update
self.update_currency_pair(currency)
File "/home/mvillalba/app/tool/bitcoin-arbitrage/arbitrage/fiatconverter.py", line 53, in update_currency_pair
rate = self.get_currency_pair_yahoo(code_from, code_to)
File "/home/mvillalba/app/tool/bitcoin-arbitrage/arbitrage/fiatconverter.py", line 41, in get_currency_pair_yahoo
res = urllib.request.urlopen(url)
File "/usr/lib/python3.5/urllib/request.py", line 163, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.5/urllib/request.py", line 472, in open
response = meth(req, response)
File "/usr/lib/python3.5/urllib/request.py", line 582, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python3.5/urllib/request.py", line 510, in error
return self._call_chain(*args)
File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain
result = func(*args)
File "/usr/lib/python3.5/urllib/request.py", line 590, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden

status project

Is the project still operational or has it been discontinued? Is it working and winning or losing?

ModuleNotFoundError: No module named 'arbitrage.arbitrer'; 'arbitrage' is not a package

I'm new to Python. when i run the code at Debug model. it keeps showing following error message:

Traceback (most recent call last):
File "c:\Users\zbn\Documents\LeShi\OnLineBusiness\Coin\python_work\bitcoin-arbitrage-maxme\arbitrage\arbitrage.py", line 9, in
from arbitrage.arbitrer import Arbitrer
File "c:\Users\zbn\Documents\LeShi\OnLineBusiness\Coin\python_work\bitcoin-arbitrage-maxme\arbitrage\arbitrage.py", line 9, in
from arbitrage.arbitrer import Arbitrer
ModuleNotFoundError: No module named 'arbitrage.arbitrer'; 'arbitrage' is not a package

Btc-e or Campbx private API support

I'm not sure this is the appropriate place to post this question, but I was wondering if anyone has any code (even in beta) that auto-trades with BTC-e and Campbx.

Thanks,
Dave

ImportError: No module named arbitrer

Hi team,

We couldn't run below comments. PFA.

python3 -m arbitrage -m Paymium get-balance

python3 -m arbitrage -m Paymium,BitstampUSD get-balance

image

Then we have checked test commend ( nosetests arbitrage/ ). This is also got some error. PFA.

image

Kindly check and help to us ASAP.

KrakenEUR prices are incorrect (by 1500+ EUR)

When I run $ python -m arbitrage -d

I wait a few minutes, then it outputs, among other prices:

2020-10-14 19:40:23,848 [VERBOSE] ticker: KrakenEUR - {'ask': {'price': 11367.5375, 'amount': 0.098}, 'bid': {'price': 11364.9525, 'amount': 0.112}}
2020-10-14 19:40:23,849 [VERBOSE] ticker: KrakenUSD - {'ask': {'price': 11355.6, 'amount': 3.942}, 'bid': {'price': 11355.5, 'amount': 0.537}}

The ticker price of KrakenUSD is quite close to the actual value just now, which I can see on trade.kraken.com is about 11350.
The ticker price of KrakenEUR however, is FAR away from what trade.kraken.com is reporting, which is closer to 9669... which seems to me to mean that bitcoin-arbitrage is misreporting the price.

Screenshot from 2020-10-14 19-47-51

Using WebSockets for data feeds instead of APIs?

Given the short-lived nature of arbitrage opportunities, has anyone considered using Websockets instead of making lots of API calls after 'market data has expired'? Poloniex for example only allows 6 calls per second -- sockets feed provides even quicker data points.

While this could cause other problems, like data being improperly synchronized, I think the benefits of more frequent market updates (and possibly easing the load on the exchanges' servers) could outweigh those issues. If anyone else is interested I can fork this repo and try to add a Websockets implementation.

Need Help For newbie on Python

Hello,
I newer used python before, now downloaded python3.0. So what is next to start? How to start test? P.S., the only scrypt that works for me is fiatconverter.py

Sth strange by potential_trades sort and TraderBot

In arbitrage.observers.traderbot.TraderBot#end_opportunity_finder

def end_opportunity_finder(self):
    if not self.potential_trades:
        return
    self.potential_trades.sort(key=lambda x: x[0])
    # Execute only the best (more profitable)
    self.execute_trade(*self.potential_trades[0][1:])

potential_trades sort by profit and use 0 index not -1
Why choice the most lowest profit params to trade ?

And I think we should find the max_volume to trade before calculate profit not in the opportunity method in TraderBot . I think the profit will more real and make sence.

Error loading modules

Got some error loading modules...

#python3 arbitrage/arbitrage.py
Traceback (most recent call last):
File "", line 2218, in _find_and_load_unlocked
AttributeError: 'module' object has no attribute 'path'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "arbitrage/arbitrage.py", line 9, in
from arbitrage.arbitrer import Arbitrer
File "/opt/arbitrage/bitcoin-arbitrage/arbitrage/arbitrage.py", line 9, in
from arbitrage.arbitrer import Arbitrer
ImportError: No module named 'arbitrage.arbitrer'; 'arbitrage' is not a package

Error: from arbitrage.arbitrer import Arbitrer

Traceback (most recent call last):
File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1664, in
main()
File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1658, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1068, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "/Users/bicassos/Desktop/bitcoin-arbitrage/arbitrage/arbitrage.py", line 9, in
from arbitrage.arbitrer import Arbitrer
File "/Users/bicassos/Desktop/bitcoin-arbitrage/arbitrage/arbitrage.py", line 9, in
from arbitrage.arbitrer import Arbitrer
ImportError: No module named arbitrer

Bitfinex.com API released

Bitfinex.com has released their API quite recently (https://www.bitfinex.com/pages/api). they offer trading in BTCUSD on both their internal exchange and (as a brokerage service with sightly lower fees compared to low volume accounts) on MtGox and Bitstamp.

The might add LTCBTC and LTCUSD soonish to the API as well.

Won't start

Hi!

I'd like to check this project but whenever I try to start the program I get the following error:

Have I done something wrong or am I running the wrong Python version?

D:\Development\Python33>python D:\Development\bitcoin-arbitrage-master\src\arbitrage.py
Traceback (most recent call last):
File "D:\Development\bitcoin-arbitrage-master\src\arbitrage.py", line 187, in
main()
File "D:\Development\bitcoin-arbitrage-master\src\arbitrage.py", line 176, in main
arbitrer = Arbitrer()
File "D:\Development\bitcoin-arbitrage-master\src\arbitrage.py", line 14, in init
self.init_markets(config.markets)
File "D:\Development\bitcoin-arbitrage-master\src\arbitrage.py", line 20, in init_markets
exec('import public_markets.' + market_name.lower())
File "", line 1, in
File "D:\Development\bitcoin-arbitrage-master\src\public_markets\mtgoxeur.py", line 39
print market.get_depth()
^
SyntaxError: invalid syntax

Add hitbtc/Usdt

Hey guys, how can I add Hitbtc? It has USDT as base and not USD/EUR.
Thank you very much!

Profit calculation problem

Hi, I hope that it is ok if I ask here. I can not understand how the profit is calculated. When I run the application I get the following output:
2014-08-01 15:39:52,269 [INFO] profit: 93.237316 USD with volume: 10.000000 BTC - buy at 592.9140 (BtceUSD) sell at 593.3315 (KrakenEUR) ~1.57%

I can't see how the profit of $93.23 has been calculated as 10 multiplied by $592.9140 is 5929 and then 10 multiplied by the sell price at 593.3315 = $5933 meaning profit of $4 not a profit of $93.23, perhaps im missing something, would it be possible to explain, maybe even i could see the formula you use to calculate the arbitrage profit opportunity (so i can also see if it takes exchange fee's into account). That would be a huge help, and if im totally missing something i apologise in advance.

Thanks.

Functions returning multiple values should probably be returning objects

Looking at arbitrer.py, it seems there is still some encapsulation and abstraction to be done. I don't personally like it when a function returns more than one value, and here we have functions returning as many as six values. It's very easy to mix up return values, and it's very hard to update anything that uses those functions if those functions change.

I propose we create a class to encapsulate those values, and perhaps move some of Arbitrer's functionality into that class. This could also facilitate using other currencies as "pivot" currencies, or at the very least aid in finding arbitrage chains that include links without USD as one of the currencies involved. (I.e., inter-crypto arbitrage.)

Still in development?

Just wondering if this is still in development. If so, I'd be interested in contributing and adding more exchanges to the automation process.

Logger reports one incorrect price but correct percentage opportunity

In the output below, the program correctly reports ticker data for current prices, correctly computes percentage arbitrage opportunity, but incorrectly outputs one of the two prices. In this example, the MtGox price is correct (~136.99), but the Bitstamp price is incorrect (reported at 136.98 but the actual price is closer to 125).

Interestingly, the incorrect price is consistently 0.01 USD lower than the correct price.

2013-10-08 22:24:32,855 [DEBUG] ticker: BtceUSD - {'bid': {'amount': 13.82865397, 'price': 121.5}, 'ask': {'amount': 0.75758432, 'price': 122.0}}
2013-10-08 22:24:32,856 [DEBUG] ticker: MtGoxUSD - {'bid': {'amount': 0.96, 'price': 136.99}, 'ask': {'amount': 9.5592038, 'price': 137.0}}
2013-10-08 22:24:32,856 [DEBUG] ticker: BitstampUSD - {'bid': {'amount': 1.41166519, 'price': 124.9}, 'ask': {'amount': 4.95147998, 'price': 124.95}}
...
2013-10-08 22:27:09,339 [INFO] profit: 0.602000 USD with volume: 0.050000 BTC - buy at 136.9800 (BitstampUSD) sell at 136.9900 (MtGoxUSD) ~8.79%
2013-10-08 22:27:09,339 [INFO] execute buy 0.050000 BTC @ 136.980000 on bitstamp
2013-10-08 22:27:09,340 [INFO] execute sell 0.050000 BTC @ 136.990000 on mtgox

Although maybe this is a kind of feature, and not a bug? I'd love to understand more about what's going on here.

Interpreting logger output

I just ran the logger, and one line of output was this:
[INFO] profit: 241.466307 USD with volume: 10.000000 BTC - buy at 629.7000 (BtceUSD) sell at 629.7338 (MtGoxUSD) ~3.83%

Is this saying that one should buy 10 BTC at the rate of 629.7000 USD/BTC on the BTC-e exchange and sell 10 BTC at the rate of 629.7338 USD/BTC on the MtGox exchange?

If so, the profit calculation doesn't make sense to me. Wouldn't the profit from these trades be (10 BTC * 629.7338 USD/BTC) - (10 BTC * 629.7000 USD/BTC) = .338 USD? Furthermore, what does the 3.83% refer to?

Sorry if the answer obvious, and thanks for this awesome tool!

TypeError: execute_trade() takes exactly 6 positional arguments (8 given)

2013-05-27 19:30:40,879 [DEBUG] ticker: MtGoxUSD - {'ask': {'price': 130.49989, 'amount': 49.34843715}, 'bid': {'price': 130.49984, 'amount': 0.01}}
2013-05-27 19:30:40,879 [DEBUG] ticker: BitstampUSD - {'ask': {'price': 127.15, 'amount': 13.29579641}, 'bid': {'price': 127.12, 'amount': 0.78004172}}
Traceback (most recent call last):
File "arbitrage.py", line 63, in
main()
File "arbitrage.py", line 60, in main
cli.main()
File "arbitrage.py", line 56, in main
self.exec_command(args)
File "arbitrage.py", line 15, in exec_command
self.arbitrer.loop()
File "/home/ubuntu/bitcoin-arbitrage/arbitrage/arbitrer.py", line 190, in loop
self.tick()
File "/home/ubuntu/bitcoin-arbitrage/arbitrage/arbitrer.py", line 184, in tick
observer.end_opportunity_finder()
File "/home/ubuntu/bitcoin-arbitrage/arbitrage/observers/traderbot.py", line 32, in end_opportunity_finder
self.execute_trade(*self.potential_trades[0][1:])
TypeError: execute_trade() takes exactly 6 positional arguments (8 given)

TypeError: buy() takes at least 3 arguments (2 given)

Ta-Mere:bitcoin-arbitrage kouiskas$ python src/arbitrage.py
2013-03-17 02:24:43,434 [INFO] profit: 0.667827 EUR with volume: 4.000000 BTC - buy at 36.5199 (MtGoxEUR) sell at 36.5200 (BitcoinCentralEUR) ~0.46%
Traceback (most recent call last):
File "src/arbitrage.py", line 184, in
main()
File "src/arbitrage.py", line 181, in main
arbitrer.loop()
File "src/arbitrage.py", line 158, in loop
self.tick()
File "src/arbitrage.py", line 152, in tick
observer.end_opportunity_finder()
File "/Users/kouiskas/Documents/bitcoin-arbitrage/src/observers/traderbot.py", line 32, in end_opportunity_finder
self.execute_trade(*self.potential_trades[0][1:])
File "/Users/kouiskas/Documents/bitcoin-arbitrage/src/observers/traderbot.py", line 70, in execute_trade
self.clients[kask].buy(volume)
TypeError: buy() takes at least 3 arguments (2 given)

ImportError: No module named 'public_markets.mtgoxusd'

Any ideas why I'm getting this?

Running on Windows 7 - embarrassingly enough ;)


C:\Python33\Projects\BitCoin Arbitrage\src>python arbitrage.py
Traceback (most recent call last):
File "arbitrage.py", line 202, in
main()
File "arbitrage.py", line 191, in main
arbitrer = Arbitrer()
File "arbitrage.py", line 14, in init
self.init_markets(config.markets)
File "arbitrage.py", line 20, in init_markets
exec('import public_markets.' + market_name.lower())
File "", line 1, in
ImportError: No module named 'public_markets.mtgoxusd'

Bitstamp.net has implemented new API keys to access private api functions, old username and passwords will not work anymore

API KEYS IMPLEMENTED
The Bitstamp team is pleased to announce that we have implemented API keys on our site.

To access our new API security feature simply go to "Account" and select "Security" from the side menu. Click "API Access" and select from a variety of Permissions for your API.

You can now select between two different filters which you can use separately or combine them for maximum security; you can either lock your access to a specific IP address or lock bitcoin withdrawals to a specific bitcoin adress.

Please be advised that our old API access will no longer be available after 31st October 2013.

We are convinced that our new security feature will prove to be a welcome addition to the security of our users' accounts.

https://www.bitstamp.net/article/api-key-implementation/
https://www.bitstamp.net/api/

Kraken issues

Hi,

I just configured Kraken, but the output makes no sense at all:
2013-12-04 11:28:44,531 [INFO] profit: 605.869444 USD with volume: 10.000000 BTC - buy at 1154.9311 (KrakenEUR) sell at 1154.9312 (MtGoxEUR) ~5.25%
2013-12-04 11:29:44,410 [INFO] profit: 598.748147 USD with volume: 10.000000 BTC - buy at 1154.9311 (KrakenEUR) sell at 1154.9312 (MtGoxEUR) ~5.18%
2013-12-04 11:30:43,900 [INFO] profit: 595.359297 USD with volume: 10.000000 BTC - buy at 1154.9311 (KrakenEUR) sell at 1154.9312 (MtGoxEUR) ~5.15%

Seems to get BTC-E prices wrong?

Hey,

Thanks for the tool! you are awesome. I've been reading through your code trying to understand it better. I am a bit confused about the output though. Just running in logger mode with BTC-E and MT GOX. i get the following
2013-05-21 23:37:18,253 [INFO] profit: 61.387990 USD with volume: 10.000000 BTC - buy at 120.0000 (BtceUSD) sell at 120.0000 (MtGoxUSD) ~5.12% 2013-05-21 23:38:52,081 [INFO] profit: 60.841010 USD with volume: 10.000000 BTC - buy at 119.9900 (BtceUSD) sell at 119.9983 (MtGoxUSD) ~5.07% 2013-05-21 23:40:26,723 [INFO] profit: 58.233388 USD with volume: 10.000000 BTC - buy at 120.1000 (BtceUSD) sell at 120.1001 (MtGoxUSD) ~4.85% 2013-05-21 23:41:57,388 [INFO] profit: 57.600099 USD with volume: 10.000000 BTC - buy at 120.1800 (BtceUSD) sell at 120.2000 (MtGoxUSD) ~4.79%

The first line doesn't make any sense at all. buying and selling at the same price somehow makes a profit?

Also, the results don't seem to align at all with the current price at BTC-E which is currently ~116 or MT Gox which is currently ~122

When i look at the content coming back from the BTC-E api, i see this (below). Which i guess does have one ask as high as 120, so maybe the array is just getting sorted in a weird way?
{"asks":[[116.255,0.05],[116.389,3.77020926],[116.39,42.66140104],[116.4,0.01],[116.49,0.45365931],[116.5,10],[116.7,0.1245527],[116.73,0.1],[116.8,5.01],[116.831,0.01],[116.849,6.26366617],[116.85,0.74119139],[116.877,0.055],[116.88,0.5],[116.89,6.02574683],[116.9,1.25],[116.92,2.01],[116.94,0.03367788],[116.947,0.058],[116.96,0.25],[116.97,0.041916],[116.98,21.12059961],[116.99,38.37682156],[117,26.87535471],[117.04,0.25],[117.06,0.25],[117.1,0.1],[117.13,1.01],[117.14,0.25],[117.16,0.1],[117.18,0.21397],[117.19,0.01],[117.198,0.010978],[117.2,0.243016],[117.21,0.05],[117.23,1.02732482],[117.25,0.24500001],[117.26,0.05],[117.29,0.21532213],[117.31,0.12140915],[117.32,0.25],[117.33,0.20459],[117.34,0.01996],[117.38,0.25],[117.39,0.249],[117.4,0.08],[117.431,0.02],[117.49,4.99],[117.5,1.6399],[117.51,0.25],[117.56,0.05],[117.6,12.7504326],[117.66,0.25],[117.67,0.207084],[117.68,0.06019813],[117.69,0.11409919],[117.698,0.010978],[117.7,1],[117.8,1],[117.88,9.74418706],[117.89,0.29214601],[117.9,2.56007741],[117.95,0.08],[117.98,0.23],[117.99,0.5125],[118,19.04555803],[118.02,0.25],[118.03,0.25],[118.04,0.0270787],[118.05,0.25],[118.109,0.1173],[118.141,0.010976],[118.198,0.010978],[118.2,0.5],[118.25,10.56115853],[118.27,1.35],[118.31,3],[118.37,0.08300266],[118.38,0.249],[118.39,0.25],[118.4,0.04418506],[118.43,0.1],[118.47,0.2],[118.49,0.2],[118.5,1.02],[118.583,0.01],[118.68,0.1913],[118.69,0.04036662],[118.698,0.010978],[118.71,0.01],[118.74,0.25],[118.75,0.22231054],[118.76,0.09071577],[118.772,0.0107],[118.783,0.0107],[118.793,0.0107],[118.8,0.8],[118.804,0.0107],[118.814,0.0107],[118.83,0.21688552],[118.84,0.017125],[118.876,0.03],[118.89,5.14346],[118.898,0.01],[118.899,0.01],[118.9,52.2595],[118.911,0.02],[118.94,2.58],[118.967,0.02],[118.98,0.17490046],[118.986,0.01],[118.99,6.2],[119,12.14731743],[119.09,0.249],[119.1,0.249],[119.11,0.25],[119.12,1],[119.18,0.1996],[119.19,0.29464773],[119.198,0.010978],[119.2,0.127],[119.3,0.0214],[119.38,0.60020996],[119.45,0.0881831],[119.46,0.25],[119.47,0.249],[119.49,2],[119.55,0.1],[119.56,5],[119.6,0.184],[119.698,0.010978],[119.705,2.8],[119.72,0.2894],[119.74,0.5],[119.79,1.01197827],[119.8,1.20019885],[119.81,0.249],[119.82,0.249],[119.83,0.25],[119.87,2.80306315],[119.88,1.10277926],[119.89,1.31],[119.9,13.36845694],[119.95,0.6497],[119.961,0.0106],[119.971,0.0106],[119.98,1.9317174],[119.982,0.0106],[119.99,35.08028001],[120,152.0757854]],"bids":[[115.93,0.10461192],[115.92,50.49712537],[115.91,0.1],[115.9,3.2],[115.8,2.62015233],[115.705,0.01],[115.65,0.06],[115.601,0.01],[115.564,0.01003],[115.55,0.05],[115.531,0.053],[115.5,0.1],[115.45,0.05],[115.4,0.0316],[115.35,0.1893],[115.23,0.01004],[115.202,0.71650032],[115.201,0.85301308],[115.2,7.5],[115.19,0.08],[115.15,0.05],[115.131,0.053],[115.129,0.25900627],[115.12,0.05],[115.1,0.01],[115.071,0.15116876],[115.07,2.61427348],[115.06,0.05],[115.05,5.1],[115.04,0.10611367],[115.01,5.3522331],[115.002,0.43872166],[115,34.27972538],[114.98,0.01],[114.979,0.01],[114.978,0.01],[114.9,4.95923387],[114.87,130.30842994],[114.851,0.01],[114.829,0.01506336],[114.82,0.01],[114.801,0.02],[114.8,0.03],[114.79,0.05],[114.78,0.59],[114.77,0.01],[114.76,0.03],[114.74,0.02],[114.739,0.02008],[114.731,0.053],[114.73,0.01],[114.71,0.011],[114.7,0.02],[114.68,0.01],[114.67,0.01],[114.657,0.02004008],[114.65,0.2],[114.62,4.6718084],[114.58,0.01],[114.57,0.57],[114.55,0.02],[114.539,0.01],[114.52,6.72812],[114.506,0.01],[114.502,0.011],[114.5,7.30486988],[114.49,0.6],[114.48,0.174703],[114.472,25.078244],[114.441,0.05],[114.4,0.1],[114.38,1.605],[114.333,0.01004],[114.33,0.053],[114.3,3.19990074],[114.28,1.56],[114.27,0.25142],[114.25,0.98525869],[114.246,0.31987722],[114.22,0.1],[114.21,0.61],[114.2,0.3],[114.19,0.01],[114.11,0.11092539],[114.1,0.11],[114.07,0.1],[114.05,1.58866896],[114.049,0.1],[114.04,1.30535],[114.03,0.91650727],[114.02,16.17246686],[114.01,0.259569],[114.002,0.011],[114,35.42604291],[113.99,0.6],[113.95,5],[113.93,0.053],[113.92,0.63],[113.9,0.29239265],[113.88,0.1],[113.85,0.13453973],[113.82,0.02],[113.8,0.06981992],[113.77,1],[113.75,0.116],[113.749,0.05],[113.7,23.73903837],[113.699,0.1],[113.698,0.1],[113.68,0.05],[113.67,2.88246922],[113.666,31.024758],[113.651,17.731],[113.61,0.0102],[113.6,0.1],[113.53,0.053],[113.51,6.27661587],[113.502,0.011],[113.5,12.07262359],[113.49,0.03],[113.48,2],[113.47,0.28179579],[113.41,0.6402],[113.4,12.75],[113.39,0.5],[113.35,0.29368599],[113.33,0.73538525],[113.32,0.17841088],[113.31,1.07066032],[113.3,12.92856392],[113.29,26.20943287],[113.265,0.01],[113.25,0.12482286],[113.221,0.81413327],[113.22,0.1],[113.21,0.5],[113.2,5.9486038],[113.18,0.69],[113.15,4.63247389],[113.139,0.02],[113.13,1.834663],[113.12,0.1677],[113.11,10.11002],[113.1,11.06297817],[113.09,14],[113.079,0.12921],[113.06,1.01],[113.053,2.4767],[113.05,10.097724],[113.02,4.03029613]]}

Configurable exchange & currency support

I quickly tried a s/EUR/USD/g to use USD instead, but found that the choice of exchanges didn't really return sane data for USD. Python's JSON parser takes a JSON null to a Python None, which doesn't like to be output as a float.

It'd be nice to have configurable exchanges and currency, or just pick from the exchCUR symbol from wherever.

Profit calculation..

buy at 531.6200 (BitstampUSD) sell at 531.7177 (Bitcoin24EUR) ~5.93%

Is it just me or do we see something fishy here? ;-)

[Question] Backtesting / Dry run?

Is it possible to take this for a "dry-run" or view its suggested action without live trade? I'm trying to learn more about this domain of software and want to use this as a learning tool if possible

base currency configurable - feature request

I noticed in your program everything has to be converted to USD.

def convert_to_usd(self)

that you hard wired the base currency to function name.

It is possible to avoid using the concept of base currency at all. This is how to achieve it:

  1. When displaying price difference, cross reference prices in both ccurrency;
  2. When measuring profit, measure it directly using bitcoin.

e.g. output can be:

There is 1BTC profit to be made!
Sell 10 BTC on Intersango @ 110EUR (worth 8800CNY) and buy 11BTC on MtGox @800CNY (worth 100EUR)

In the above example, since USD is not involved, it is not used at all. USD is not necessarily involved in the trade, but bitcoin must, thus profit is better measured in BTC than in USD.

arbitrage_depth_opportunity have a problem

if the amount of lowest i asks have already exceeds the amount of all the candidate bids, eg. N.

which is amount(market1_ask0, market2_aski) >= amount(market2_bid0, market2_bidN)

there's no need to consider the (i + 1, M) range in market1_asks

with this change, the returned final buyprice can be different

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.