Ejemplo n.º 1
0
import time
import sys
# Import the External Poloniex Library (python-poloniex-master folder + PIP install poloniex)
import poloniex 
from poloniex import Poloniex

try: # First check for user BTC Value input
	budget = str(sys.argv[1])#.format('0.001')
except: # Print an Exeption (error) if there is no input
	print("put Budget in as python AllCoinsInBTC.py 0.001")
	exit(1)

while True: # Setup to connect to Poloniex API
	try:
		polo = Poloniex()
		polo.key = 'Your_Poloniex_Key_Here'
		polo.secret = 'Your_Poloniex_Secret_Here'
		print(" ")
		print("---!Connected to Poloniex.com!---")
		break
	except:
		backoff("Can not connect to Poloniex API")
		exit(1)
		
def backoff(msg): # Function for the Error Message later in script
    print(msg)
    time.sleep(0.1)

def decor (func):
	def wrap():
		print(" #################")
Ejemplo n.º 2
0
def create_poloniex_connection():
    polo = Poloniex()
    polo.key = POLONIEX_API_KEY
    polo.secret = POLONIEX_SECRET_KEY
    return polo
from __future__ import division
import urllib
import json
from time import sleep
from datetime import datetime
from poloniex import Poloniex
from bittrex.bittrex import Bittrex

polo = Poloniex()

# poloniex key ve anahtar
polo.key = ''
polo.secret = ''
# bittrex key ve anahtar
my_bittrex = Bittrex("", "")

# islem yapilacak coinler
bittrex_market = ['BTC-DGB', 'BTC-SC']
poloniex_market = ['BTC_DGB', 'BTC_SC']
zorluk = 15  # binde oran DIKKAT. kayip ile beraber kullanilacak
islem_ucreti = 0.0012  # her bir islemde BTC bazinda kullanilacak ucret
tekrar = 150  # islemin tekrar sayisi
kayip = 2  # binde oraninda kayip. emrin garantisi

#!!!!!!!!!!!!! ONEMLI !!!!!!!!!!!!!!!!!!!!
# herbir markette coinin alim ve satim degerleri kontrol edilir.
# marketlerdeki alim fiyatindan satim, satim fiyatindan alim yapilacak sekilde islemler yapilir.
# iki market arasindaki makas zorluk/1000'den buyuk oldugunda her iki markette emir verilir.
# kayip/1000 kadar alim fiyati asagi cekilir
# kayip/1000 kadar satim fiyati yukari cekilir