Examples of OrderType


Examples of com.xeiam.xchange.dto.Order.OrderType

  private LimitOrder adaptOrder(CoinfloorOrder order) throws ExchangeException {

    String baseCurrency = order.getBase().toString();
    String counterCurrency = order.getCounter().toString();

    OrderType type = null;
    if (order.getBaseQty().doubleValue() > 0) {
      type = OrderType.BID;
    }
    else if (order.getBaseQty().doubleValue() <= 0) {
      type = OrderType.ASK;
View Full Code Here

Examples of com.xeiam.xchange.dto.Order.OrderType

          }
        }
      }
      cachedOrderBook = new OrderBook(new Date(), askList, bidList);

      OrderType type = (rawRetObj.getBidId() > rawRetObj.getAskId() ? OrderType.BID : OrderType.ASK);
      BigDecimal limitPrice = rawRetObj.getPrice();

      trade =
          new Trade(type, rawRetObj.getBaseQty(), new CurrencyPair(rawRetObj.getBase().toString(), rawRetObj.getCounter().toString()), limitPrice, new Date(), String.valueOf(rawRetObj.getId()));
View Full Code Here

Examples of com.xeiam.xchange.dto.Order.OrderType

    // Interested in the private trading functionality (authentication)
    PollingTradeService tradeService = krakenExchange.getPollingTradeService();

    // place a marketOrder with volume 0.01
    OrderType orderType = (OrderType.BID);
    BigDecimal tradeableAmount = new BigDecimal("0.01");

    MarketOrder marketOrder = new MarketOrder(orderType, tradeableAmount, CurrencyPair.BTC_EUR);

    String orderID = tradeService.placeMarketOrder(marketOrder);
View Full Code Here

Examples of com.xeiam.xchange.dto.Order.OrderType

    // Interested in the private trading functionality (authentication)
    KrakenTradeServiceRaw tradeService = (KrakenTradeServiceRaw) krakenExchange.getPollingTradeService();

    // place a marketOrder with volume 0.01
    OrderType orderType = (OrderType.BID);
    BigDecimal tradeableAmount = new BigDecimal("0.01");

    MarketOrder marketOrder = new MarketOrder(orderType, tradeableAmount, CurrencyPair.BTC_EUR);

    KrakenOrderResponse orderID = tradeService.placeKrakenMarketOrder(marketOrder);
View Full Code Here

Examples of com.xeiam.xchange.dto.Order.OrderType

  private static void generic(Exchange krakenExchange) throws IOException {

    PollingTradeService tradeService = krakenExchange.getPollingTradeService();

    OrderType orderType = (OrderType.ASK);
    BigDecimal tradeableAmount = new BigDecimal("0.01");
    BigDecimal price = new BigDecimal("65.25");

    LimitOrder limitOrder = new LimitOrder(orderType, tradeableAmount, CurrencyPair.BTC_LTC, "", null, price);
View Full Code Here

Examples of com.xeiam.xchange.dto.Order.OrderType

  private static void raw(Exchange krakenExchange) throws IOException {

    KrakenTradeServiceRaw tradeService = (KrakenTradeServiceRaw) krakenExchange.getPollingTradeService();

    OrderType orderType = (OrderType.ASK);
    BigDecimal tradeableAmount = new BigDecimal("0.01");
    BigDecimal price = new BigDecimal("65.25");

    LimitOrder limitOrder = new LimitOrder(orderType, tradeableAmount, CurrencyPair.BTC_LTC, "", null, price);
View Full Code Here

Examples of com.xeiam.xchange.dto.Order.OrderType

    return (cryptoTradeOrderType.equals(BTEROrderType.BUY)) ? OrderType.BID : OrderType.ASK;
  }

  public static Trade adaptTrade(BTERPublicTrade trade, CurrencyPair currencyPair) {

    OrderType orderType = adaptOrderType(trade.getType());
    Date timestamp = DateUtils.fromMillisUtc(trade.getDate() * 1000);

    return new Trade(orderType, trade.getAmount(), currencyPair, trade.getPrice(), timestamp, trade.getTradeId());
  }
View Full Code Here

Examples of org.jboss.resteasy.test.providers.jaxb.generated.order.Ordertype

   {
      InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(
              "order_123.xml");
      JAXBContext jaxb = JAXBContext.newInstance(Ordertype.class);
      Unmarshaller u = jaxb.createUnmarshaller();
      Ordertype order = (Ordertype) u.unmarshal(in);
      Assert.assertNotNull(order);
      Assert.assertEquals("Ryan J. McDonough", order.getPerson());
   }
View Full Code Here

Examples of org.jboss.resteasy.test.providers.jaxb.generated.order.Ordertype

   }

   // @Test
   public void testGetOrder()
   {
      Ordertype order = client.getOrderById("order_123");
      Assert.assertEquals("Ryan J. McDonough", order.getPerson());
   }
View Full Code Here

Examples of org.jboss.resteasy.test.providers.jaxb.generated.order.Ordertype

   // @Test
   public void testUpdateOrder()
   {
      InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(
              "orders/order_123.xml");
      Ordertype order = JAXBHelper.unmarshall(Ordertype.class, in).getValue();
      int initialItemCount = order.getItem().size();
      order = client.updateOrder(order, "order_123");
      Assert.assertEquals("Ryan J. McDonough", order.getPerson());
      Assert.assertNotSame(initialItemCount, order.getItem().size());
      Assert.assertEquals(3, order.getItem().size());
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.