def set_initial_buy(buyVolumePercent, orderVolume, market, buyValuePercent, currentValue): newBuyValue = buyUtil.defBuyValue(currentValue, buyValuePercent) if (buyVolumePercent == 0): newBuyVolume = tradeAmount else: newBuyVolume = buyUtil.defBuyVolume(orderVolume, buyVolumePercent) result = api.buylimit(market, newBuyVolume, newBuyValue) print result
logging.info("Sell volume: " + str(newSellVolume)) logging.info("Setting sell order...") result = api.selllimit(market, newSellVolume, newSellValue) logging.info(result) if blockBuy == 'false': buyControl = control_buy_orders(orderInventory) if (buyControl == 0): newBuyValue = buyUtil.defBuyValue(orderValueHistory, buyValuePercent) if (buyVolumePercent == 0): logging.info("Setting user defined trade amount ") logging.info(tradeAmount) newBuyVolume = tradeAmount else: newBuyVolume = buyUtil.defBuyVolume( orderVolume, buyVolumePercent) logging.info("Currency: " + currency) logging.info("Buy Value: " + str(newBuyValue)) logging.info("Buy Volume: " + str(newBuyVolume)) logging.info("Setting buy order...") result = api.buylimit(market, newBuyVolume, newBuyValue) logging.info(result) except: logging.info( "Bittrex probably threw a 503...trying again on the next cycle") if cycle == 100: logging.info("Garbage collection") gc.collect() count = 0