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
def set_initial_buy(buyVolume, market, buyValuePercent, currentValue, tradeAmount): newBuyValue = buyUtil.defBuyValue(currentValue, buyValuePercent) if (tradeAmount == 0): tradeAmount = buyVolume logging.info("Currency: " + market) logging.info("Buy Value: " + str(newBuyValue)) logging.info("Buy Volume: " + str(tradeAmount)) logging.info("Setting buy order...") result = api.buylimit(market, tradeAmount, newBuyValue) logging.info(result)
logging.info(tradeAmount) newSellVolume = tradeAmount else: newSellVolume = sellUtil.defSellVolume( orderVolume, sellVolumePercent) logging.info("Currency: " + currency) logging.info("Sell Value: " + str(newSellValue)) 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: