Package com.xeiam.xchange.bitfinex.v1.dto.trade

Examples of com.xeiam.xchange.bitfinex.v1.dto.trade.BitfinexCancelOrderRequest


  }

  @Override
  public String placeLimitOrder(LimitOrder limitOrder) throws IOException {

    BitfinexOrderStatusResponse newOrder = placeBitfinexLimitOrder(limitOrder, BitfinexOrderType.LIMIT, false);

    return String.valueOf(newOrder.getId());
  }
View Full Code Here


      boolean isCancelled = false;
      boolean wasForced = false;
      BigDecimal originalAmount = new BigDecimal("70");
      BigDecimal remainingAmount = originalAmount.subtract(new BigDecimal(i * 1));
      BigDecimal executedAmount = originalAmount.subtract(remainingAmount);
      responses[i] = new BitfinexOrderStatusResponse(i, SYMBOL, EXCHANGE, price, avgExecutionPrice, side, type, timestamp, isLive, isCancelled, wasForced, originalAmount, remainingAmount, executedAmount);
    }

    return responses;
  }
View Full Code Here

  }

  public BitfinexTradeResponse[] getBitfinexTradeHistory(String symbol, long timestamp, int limit) throws IOException {

    try {
      BitfinexTradeResponse[] trades = bitfinex.pastTrades(apiKey, payloadCreator, signatureCreator, new BitfinexPastTradesRequest(String.valueOf(nextNonce()), symbol, timestamp, limit));
      return trades;
    } catch (BitfinexException e) {
      throw new ExchangeException(e.getMessage());
    }
  }
View Full Code Here

      String type = i % 2 == 0 ? "buy" : "sell";
      String tradeIdString = String.valueOf(tradeId++);
      String orderIdString = String.valueOf(orderId++);
      BigDecimal feeAmount = new BigDecimal(0l);
      String feeCurrency = "USD";
      responses[i] = new BitfinexTradeResponse(price, amount, timestamp, MARKET, type, tradeIdString, orderIdString, feeAmount, feeCurrency);
    }

    return responses;
  }
View Full Code Here

    super(exchangeSpecification);
    this.bitfinex = RestProxyFactory.createProxy(type, exchangeSpecification.getSslUri());
    this.apiKey = exchangeSpecification.getApiKey();
    this.signatureCreator = BitfinexHmacPostBodyDigest.createInstance(exchangeSpecification.getSecretKey());
    this.payloadCreator = new BitfinexPayloadDigest();
    this.currencyPairs = new HashSet<CurrencyPair>();
  }
View Full Code Here

  public void applySpecification(ExchangeSpecification exchangeSpecification) {

    super.applySpecification(exchangeSpecification);

    this.pollingMarketDataService = new BitfinexMarketDataService(exchangeSpecification);
    this.pollingAccountService = new BitfinexAccountService(exchangeSpecification);
    this.pollingTradeService = new BitfinexTradeService(exchangeSpecification);
  }
View Full Code Here

public class BitfinexAccountDemo {

  public static void main(String[] args) throws IOException {

    Exchange bfx = BitfinexDemoUtils.createExchange();
    BitfinexAccountServiceRaw accountService = (BitfinexAccountServiceRaw) bfx.getPollingAccountService();
    BitfinexMarginInfosResponse[] marginInfos = accountService.getBitfinexMarginInfos();
    System.out.println("Margin infos response: " + marginInfos[0]);

  }
View Full Code Here

  @Override
  public void applySpecification(ExchangeSpecification exchangeSpecification) {

    super.applySpecification(exchangeSpecification);

    this.pollingMarketDataService = new BitfinexMarketDataService(exchangeSpecification);
    this.pollingAccountService = new BitfinexAccountService(exchangeSpecification);
    this.pollingTradeService = new BitfinexTradeService(exchangeSpecification);
  }
View Full Code Here

    super.applySpecification(exchangeSpecification);

    this.pollingMarketDataService = new BitfinexMarketDataService(exchangeSpecification);
    this.pollingAccountService = new BitfinexAccountService(exchangeSpecification);
    this.pollingTradeService = new BitfinexTradeService(exchangeSpecification);
  }
View Full Code Here

    raw(bfx);
  }

  private static void raw(Exchange bfx) throws IOException {

    BitfinexTradeServiceRaw tradeService = (BitfinexTradeServiceRaw) bfx.getPollingTradeService();
    LimitOrder limitOrder = new LimitOrder.Builder(OrderType.BID, CurrencyPair.BTC_USD).limitPrice(new BigDecimal("481.69")).tradableAmount(new BigDecimal("0.001")).build();
    tradeService.placeBitfinexLimitOrder(limitOrder, BitfinexOrderType.LIMIT, false);
  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.bitfinex.v1.dto.trade.BitfinexCancelOrderRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.