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 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 #3
0
def getvar():
    x = strftime("%H", gmtime())
    y = int(Bitfinex().get_current_price())
    return str(x), str(y)
# 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 #5
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 #6
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 #7
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 #8
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 #9
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", "",