Package com.xeiam.xchange.service.polling

Examples of com.xeiam.xchange.service.polling.PollingTradeService


  public void testApplySpecification() {

    assertNotNull(defaultExchange);
    PollingAccountService accountService = defaultExchange.getPollingAccountService();
    PollingMarketDataService marketDataService = defaultExchange.getPollingMarketDataService();
    PollingTradeService tradeService = defaultExchange.getPollingTradeService();
    assertNull(accountService);
    assertNull(marketDataService);
    assertNull(tradeService);
    defaultExchange.applySpecification(exchangeSpecification);
    accountService = defaultExchange.getPollingAccountService();
View Full Code Here


  @Test
  public void testGetPollingTradeService() {

    assertNotNull(testExchange);
    PollingTradeService tradeService = testExchange.getPollingTradeService();
    assertNotNull(tradeService);
  }
View Full Code Here

public class TradeDemo {

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

    Exchange exchange = CexIODemoUtils.createExchange();
    PollingTradeService tradeService = exchange.getPollingTradeService();

    generic(tradeService);
    raw((CexIOTradeServiceRaw) tradeService);

  }
View Full Code Here

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

    CertHelper.trustAllCerts();

    Exchange poloniex = PoloniexExamplesUtils.getExchange();
    PollingTradeService tradeService = poloniex.getPollingTradeService();
    currencyPair = new CurrencyPair("XMR", Currencies.BTC);

    /*
     * Make sure this is below the current market rate!!
     */
 
View Full Code Here

  }

  private static void generic(Exchange krakenExchange) throws IOException {

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

    // Get the open orders
    OpenOrders openOrders = tradeService.getOpenOrders();
    System.out.println(openOrders.toString());
  }
View Full Code Here

  }

  private static void generic(Exchange krakenExchange) throws IOException {

    // 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);
    System.out.println("Market Order ID: " + orderID);
  }
View Full Code Here

    raw(krakenExchange);
  }

  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);

    String orderID = tradeService.placeLimitOrder(limitOrder);
    System.out.println("Limit Order ID: " + orderID);
  }
View Full Code Here

    raw(krakenExchange);
  }

  private static void generic(Exchange krakenExchange) throws IOException {

    PollingTradeService tradeService = krakenExchange.getPollingTradeService();

    System.out.println("Open Orders: " + tradeService.getOpenOrders().toString());

    // place a limit buy order
    LimitOrder limitOrder = new LimitOrder((OrderType.ASK), new BigDecimal(".01"), CurrencyPair.BTC_LTC, "", null, new BigDecimal("51.25"));
    String limitOrderReturnValue = tradeService.placeLimitOrder(limitOrder);
    System.out.println("Limit Order return value: " + limitOrderReturnValue);

    System.out.println("Open Orders: " + tradeService.getOpenOrders().toString());

    // Cancel the added order
    boolean cancelResult = tradeService.cancelOrder(limitOrderReturnValue);
    System.out.println("Canceling returned " + cancelResult);
    System.out.println("Open Orders: " + tradeService.getOpenOrders().toString());
  }
View Full Code Here

  }

  private static void generic(Exchange krakenExchange) throws IOException {

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

    // Get the trade history
    Trades trades = tradeService.getTradeHistory();
    System.out.println(trades.toString());
  }
View Full Code Here

    exSpec.setSecretKey("b03caa2f83e6a42cd2780f0a245f020302eb4fe2a63d268135c927c4d88d265be8e4e559e9f3c812");

    Exchange cryptsyExchange = ExchangeFactory.INSTANCE.createExchange(exSpec);
    PollingAccountService accountService = cryptsyExchange.getPollingAccountService();
    PollingMarketDataService marketDataService = cryptsyExchange.getPollingMarketDataService();
    PollingTradeService tradeService = cryptsyExchange.getPollingTradeService();

    generic(accountService, marketDataService, tradeService);
    raw((CryptsyAccountServiceRaw) accountService, (CryptsyMarketDataServiceRaw) marketDataService, (CryptsyTradeServiceRaw) tradeService);
    publicAPI((CryptsyExchange) cryptsyExchange);
  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.service.polling.PollingTradeService

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.