Exemplo n.º 1
0
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
Exemplo n.º 2
0
        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':
            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)
Exemplo n.º 3
0
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