Beispiel #1
0
def main():
    btf = Bitfinex()
    kkn = Kraken()
    gdax = Gdax()

    gc = authorize()
    print(update_sheet(gc, 'bitfinex', btf))
    print(update_sheet(gc, 'kraken', kkn))
    print(update_sheet(gc, 'gdax', gdax))
Beispiel #2
0
def initialize_exchanges():
    binance = Binance.Factory(E_BINANCEapiKey, E_BINANCEsecretKey)
    bitfinex = Bitfinex.Factory(A_BITFINEXapiKey, A_BITFINEXsecretKey)
    bittrex = Bittrex.Factory(A_BITTREXapiKey,A_BITTREXsecretKey)
    poloniex = Poloniex.Factory(A_POLONIEXapiKey, A_POLONIEXsecretKey)
    cex = Cex.Factory() # Sarà da togliere
    binance.sync()
    bitfinex.sync()
    bittrex.sync()
    poloniex.sync()
    cex.sync()
    return binance, bitfinex, bittrex, poloniex, cex
Beispiel #3
0
def main():
    okcoin = Okcoin(deploy=True)
    okcoin.add_tickers(['btc'])
    okcoin.run_forever()

    bitfinex = Bitfinex(deploy=True)
    bitfinex.add_ticker(['btc'])
    bitfinex.run_forever()

    t = Thread(target=print_global_dict, args=())
    t.daemon = True
    t.start()

    logic = Logic(deploy=True)
    logic.run_forever()

    try:
        while True:
            time.sleep(2)
    except KeyboardInterrupt as e:
        print e
Beispiel #4
0
def getvar():
    x = strftime("%H", gmtime())
    y = int(Bitfinex().get_current_price())
    return str(x), str(y)
Beispiel #5
0
from bithumb import Bithumb
from bitfinex import Bitfinex

INTERVAL = 30

watch_list = ["ETH", "LTC", "EOS", "XRP", "BCH"]

next_execute_time = int(time()) + 0.5

while True:
    current_time = (int(time()))
    sleep(next_execute_time - current_time)
    next_execute_time += INTERVAL
    bitfinex_prices = []
    bithumb_prices = []
    for symbol in watch_list:
        bithumb_prices.append(
            sum(Bithumb.get_relative_price(symbol, 'BTC')) / 2)
        bitfinex_prices.append(
            sum(Bitfinex.get_relative_price(symbol, 'BTC')) / 2)
    os.system('clear')
    print("{0:<10} | {1:<15} | {2:<15} | {3:<8} ".format(
        "Symbol", "Bitfinex", "Bithumb", "Difference"))
    print("-" * 80)
    for symbol, bitfinex_price, bithumb_price in zip(watch_list,
                                                     bitfinex_prices,
                                                     bithumb_prices):
        difference = 100.0 * (bithumb_price - bitfinex_price) / bitfinex_price
        print("{0:<10} | {1:<15.8f} | {2:<15.8f} | {3:<8.2f}% ".format(
            symbol, bitfinex_price, bithumb_price, difference))
# Copyright (c) 2016 currentsea, Joseph Bull

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:

# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from bitfinex import Bitfinex

bfx = Bitfinex()
print(bfx.run())
Beispiel #7
0
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

__author__ = "currentsea"
__copyright__   = "Copyright 2016, currentsea"

import json, uuid, datetime, pytz, elasticsearch, argparse
from websocket import create_connection
from create_mappings import createMappings
from bitfinex import Bitfinex

DEFAULT_WEBSOCKETS_URL = "wss://api2.bitfinex.com:3000/ws"
DEFAULT_ELASTICSEARCH_URL = "http://localhost:9200"

bitfinexConnector = Bitfinex()

def test_initialization():
	assert bitfinexConnector != None
	assert bitfinexConnector.wsUrl != None
	assert bitfinexConnector.esUrl != None

def test_connect_websocket(): 
	websocketConnection = bitfinexConnector.connectWebsocket()
	assert websocketConnection == True

def test_connect_elasticsearch(): 
	elasticsearchConnection = bitfinexConnector.connectElasticsearch()
	if bitfinexConnector.esUrl != DEFAULT_ELASTICSEARCH_URL: 
		assert elasticsearchConnection == True
Beispiel #8
0
from kraken import Kraken
from bittrex import Bittrex
from bitstamp import Bitstamp
from bitfinex import Bitfinex
from arbiter import Arbiter
from wallet import Wallet

kraken = Wallet(name='kraken',
                exchange=Kraken(),
                balance_usd=10000.0,
                balance_btc=1.0)
bittrex = Wallet(name='bittrex',
                 exchange=Bittrex(),
                 balance_usd=10000.0,
                 balance_btc=1.0)
bitstamp = Wallet(name='bitstamp',
                  exchange=Bitstamp(),
                  balance_usd=10000.0,
                  balance_btc=1.0)
bitfinex = Wallet(name='bitfinex',
                  exchange=Bitfinex(),
                  balance_usd=10000.0,
                  balance_btc=1.0)

a = Arbiter(wallets=[kraken, bittrex, bitstamp], trade_amount=0.25, delay=20)
a.arbitrate()
Beispiel #9
0
#!/usr/bin/python
from bitfinex import Bitfinex
from btce import BTCE
from bot import Bot

bfinex = Bitfinex()
btce = BTCE()

bot = Bot()
bot.addExchange(btce)
bot.addExchange(bfinex)

print 'Running Bot'
bot.run()

#btcelogin.btce_to_bitfinex(0, 'haha')
Beispiel #10
0
import time


from bitfinex import Bitfinex
var1 = True
var2 = True

i = 0

while(True):
    while(var1):
        try:
            y = int(Bitfinex().get_current_price())
            c = {}
            c[y] = []
            z=0
            var1 = False
            var2 = True
        except:
            print('error')

    while(var2):
        try:
            x = int(Bitfinex().get_current_price())
            time.sleep(60)
            c[y] += [x]
            z+=1
            print(z)
            if z==1439:
                n = open("C:/Users/nickd/Desktop/bitcoinchange"+str(i), 'w+')
                n.write(str(c))
Beispiel #11
0
E_BINANCEapiKey = 'key'
E_BINANCEsecretKey = 'key'

E_BITTREXapiKey = 'key'
E_BITTREXsecretKey = 'key'

E_POLONIEXapiKey = 'key'
E_POLONIEXsecretKey = 'key'

#Api ale
A_POLONIEXapiKey = 'key'
A_POLONIEXsecretKey = 'key'

A_BITFINEXapiKey = 'key'
A_BITFINEXsecretKey = 'key'

binance = Binance.Factory(E_BINANCEapiKey, E_BINANCEsecretKey)
bitfinex = Bitfinex.Factory(A_BITFINEXapiKey, A_BITFINEXsecretKey)
bittrex = Bittrex.Factory(E_BITTREXapiKey, E_BITTREXsecretKey)
poloniex = Poloniex.Factory(A_POLONIEXapiKey, A_POLONIEXsecretKey)
max = [None, 0]

cex = Cex.Factory()  # Sarà da togliere
binance.sync()
bitfinex.sync()
bittrex.sync()
poloniex.sync()
cex.sync()

print(binance.is_frozen('ADABTC'))
Beispiel #12
0
import time
from bitfinex import Bitfinex
import smtplib

c = []
d = 1
v = 0
while (True):
    while (d % 4 != 0):

        x = Bitfinex().get_current_price()

        y = 0.62888179 * int(x)

        a = .6288179 * 21000

        z = y - 9170

        b = a - 9170

        c += [z]

        print(z)
        print(b)
        print(c)
        d += 1
        fromaddr = '*****@*****.**'
        toaddrs = '*****@*****.**'
        msg = "\r\n".join([
            "From: [email protected]",
            "To: [email protected]", "Subject: Profit Every Hour", "",