def set_initial_sell(sellVolumePercent, orderVolume, market, sellValuePercent, currentValue): if (initialSellPrice > currentValue): print "Setting user defined sell value" newSellValue = initialSellPrice else: print "Setting sellValue to market conditions" newSellValue = sellUtil.defSellValue(currentValue, sellValuePercent) if (sellVolumePercent == 0): newSellVolume = tradeAmount else: newSellVolume = sellUtil.defSellVolume(orderVolume, sellVolumePercent) result = api.selllimit(market, newSellVolume, newSellValue) print result
def set_initial_sell(sellVolume, market, sellValuePercent, currentValue, tradeAmount): if (initialSellPrice > currentValue): logging.info("Setting user defined sell value") newSellValue = initialSellPrice else: logging.info("Setting sellValue to market conditions") newSellValue = sellUtil.defSellValue(currentValue, sellValuePercent) if (tradeAmount == 0): tradeAmount = sellVolume logging.info("Currency: " + market) logging.info("Sell Value: " + str(newSellValue)) logging.info("Sell volume: " + str(tradeAmount)) logging.info("Setting sell order...") result = api.selllimit(market, tradeAmount, newSellValue) logging.info(result)
cycle = 0 while True: cycle = cycle + 1 try: orderInventory = orderUtil.orders(market, apiKey, apiSecret) orderUtil.recentTransaction(market, orderInventory, apiKey, apiSecret, checkInterval) orderValueHistory = orderUtil.lastOrderValue(market, apiKey, apiSecret) orderVolume = api.getbalance(currency)['Balance'] + extCoinBalance if blockSell == 'false': sellControl = control_sell_orders(orderInventory) if (sellControl == 0): newSellValue = sellUtil.defSellValue(orderValueHistory, sellValuePercent) if (sellVolumePercent == 0): logging.info("Setting user defined trade amount ") 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':
def set_initial_sell(sellVolumePercent, orderVolume, market, sellValuePercent, currentValue): newSellValue = sellUtil.defSellValue(currentValue, sellValuePercent) newSellVolume = sellUtil.defSellVolume(orderVolume, sellVolumePercent) result = api.selllimit(market, newSellVolume, newSellValue) print result