Ejemplo n.º 1
0
    def __init__(self, app: PyCryptoBot, account: TradingAccount) -> None:
        if app.getExchange() == Exchange.BINANCE:
            self.api = BAuthAPI(
                app.getAPIKey(),
                app.getAPISecret(),
                app.getAPIURL(),
                recv_window=app.getRecvWindow(),
            )
        elif app.getExchange() == Exchange.COINBASEPRO:
            self.api = CAuthAPI(
                app.getAPIKey(),
                app.getAPISecret(),
                app.getAPIPassphrase(),
                app.getAPIURL(),
            )
        elif app.getExchange() == Exchange.KUCOIN:
            self.api = KAuthAPI(
                app.getAPIKey(),
                app.getAPISecret(),
                app.getAPIPassphrase(),
                app.getAPIURL(),
            )
        else:
            self.api = None

        self.app = app
        self.account = account

        self.action = "WAIT"
        self.buy_count = 0
        self.buy_state = ""
        self.buy_sum = 0
        self.eri_text = ""
        self.fib_high = 0
        self.fib_low = 0
        self.first_buy_size = 0
        self.iterations = 0
        self.last_action = "WAIT"
        self.last_buy_size = 0
        self.last_buy_price = 0
        self.last_buy_filled = 0
        self.last_buy_fee = 0
        self.last_buy_high = 0
        self.last_sell_size = 0
        self.last_df_index = ""
        self.sell_count = 0
        self.sell_sum = 0

        self.margintracker = 0
        self.profitlosstracker = 0
        self.feetracker = 0
        self.buy_tracker = 0

        self.last_api_call_datetime = datetime.datetime.now(
        ) - datetime.timedelta(minutes=2)
        self.exchange_last_buy = None
Ejemplo n.º 2
0
    def __init__(self, app:PyCryptoBot, account:TradingAccount) -> None:
        if app.getExchange() == 'binance':
            self.api = BAuthAPI(app.getAPIKey(), app.getAPISecret(), app.getAPIURL())
        elif app.getExchange() == 'coinbasepro':
            self.api = CAuthAPI(app.getAPIKey(), app.getAPISecret(), app.getAPIPassphrase(), app.getAPIURL())
        else:
            self.api = None

        self.app = app
        self.account = account

        self.action = 'WAIT'
        self.buy_count = 0
        self.buy_state = ''
        self.buy_sum = 0
        self.eri_text = ''
        self.fib_high = 0
        self.fib_low = 0
        self.first_buy_size = 0
        self.iterations = 0
        self.last_action = 'WAIT'
        self.last_buy_size = 0
        self.last_buy_price = 0
        self.last_buy_filled = 0
        self.last_buy_fee = 0
        self.last_buy_high = 0 
        self.last_df_index = ''
        self.sell_count = 0
        self.sell_sum = 0
Ejemplo n.º 3
0
from models.PyCryptoBot import PyCryptoBot
from models.exchange.binance import AuthAPI as BAuthAPI
from models.exchange.coinbase_pro import AuthAPI as CAuthAPI

# Coinbase Pro fees
app = PyCryptoBot(exchange='coinbasepro')
api = CAuthAPI(app.getAPIKey(), app.getAPISecret(), app.getAPIPassphrase(),
               app.getAPIURL())
#print (api.getTakerFee())
#print (api.getTakerFee('BTC-GBP'))
#print (api.getMakerFee())
#print (api.getMakerFee('BTC-GBP'))
#print (api.getFees('BTCGBP'))
#print (api.getFees())
print(app.getMakerFee())
print(app.getTakerFee())

# Binance fees
app = PyCryptoBot(exchange='binance')
api = BAuthAPI(app.getAPIKey(), app.getAPISecret(), app.getAPIURL())
#print (api.getTakerFee())
#print (api.getTakerFee('BTCGBP'))
#print (api.getMakerFee())
#print (api.getMakerFee('BTCGBP'))
#print (api.getFees('BTCGBP'))
#print (api.getFees())
print(app.getMakerFee())
print(app.getTakerFee())