Search in sources :

Example 11 with Exchange

use of org.knowm.xchange.Exchange in project XChange by knowm.

the class OkCoinTradesDemo method main.

public static void main(String[] args) throws IOException {
    ExchangeSpecification exSpec = new ExchangeSpecification(OkCoinExchange.class);
    exSpec.setSecretKey("x");
    exSpec.setApiKey("x");
    // flag to set Use_Intl (USD) or China (default)
    exSpec.setExchangeSpecificParametersItem("Use_Intl", true);
    exSpec.setExchangeSpecificParametersItem("Use_Futures", false);
    exSpec.setExchangeSpecificParametersItem("Futures_Contract", FuturesContract.ThisWeek);
    Exchange okcoinExchange = ExchangeFactory.INSTANCE.createExchange(exSpec);
    // futures(okcoinExchange);
    generic(okcoinExchange);
    raw(okcoinExchange);
}
Also used : OkCoinExchange(org.knowm.xchange.okcoin.OkCoinExchange) Exchange(org.knowm.xchange.Exchange) ExchangeSpecification(org.knowm.xchange.ExchangeSpecification)

Example 12 with Exchange

use of org.knowm.xchange.Exchange in project XChange by knowm.

the class OkexTradesDemo method main.

public static void main(String[] args) throws IOException {
    ExchangeSpecification exSpec = new ExchangeSpecification(OkexExchange.class);
    Exchange okexExchange = ExchangeFactory.INSTANCE.createExchange(exSpec);
    generic(okexExchange);
}
Also used : OkexExchange(org.knowm.xchange.okex.v5.OkexExchange) Exchange(org.knowm.xchange.Exchange) ExchangeSpecification(org.knowm.xchange.ExchangeSpecification)

Example 13 with Exchange

use of org.knowm.xchange.Exchange in project XChange by knowm.

the class OkexOrdersDemo method main.

public static void main(String[] args) throws IOException {
    ExchangeSpecification exSpec = new ExchangeSpecification(OkexExchange.class);
    exSpec.setSecretKey("");
    exSpec.setApiKey("");
    exSpec.setExchangeSpecificParametersItem("passphrase", "");
    Exchange okexExchange = ExchangeFactory.INSTANCE.createExchange(exSpec);
    generic(okexExchange);
}
Also used : OkexExchange(org.knowm.xchange.okex.v5.OkexExchange) Exchange(org.knowm.xchange.Exchange) ExchangeSpecification(org.knowm.xchange.ExchangeSpecification)

Example 14 with Exchange

use of org.knowm.xchange.Exchange in project XChange by knowm.

the class MercadoBitcoinTradeDemo method main.

public static void main(String[] args) throws IOException, InterruptedException {
    Exchange mercadoBitcoin = InteractiveAuthenticatedExchange.createInstanceFromDefaultInput();
    TradeService tradeService = mercadoBitcoin.getTradeService();
    generic(tradeService);
    raw((MercadoBitcoinTradeServiceRaw) tradeService);
}
Also used : Exchange(org.knowm.xchange.Exchange) InteractiveAuthenticatedExchange(org.knowm.xchange.examples.mercadobitcoin.InteractiveAuthenticatedExchange) TradeService(org.knowm.xchange.service.trade.TradeService)

Example 15 with Exchange

use of org.knowm.xchange.Exchange in project XChange by knowm.

the class KrakenTradesDemo method main.

public static void main(String[] args) throws IOException {
    // Use the factory to get Kraken exchange API using default settings
    Exchange krakenExchange = ExchangeFactory.INSTANCE.createExchange(KrakenExchange.class);
    generic(krakenExchange);
// raw(krakenExchange);
}
Also used : KrakenExchange(org.knowm.xchange.kraken.KrakenExchange) Exchange(org.knowm.xchange.Exchange)

Aggregations

Exchange (org.knowm.xchange.Exchange)416 MarketDataService (org.knowm.xchange.service.marketdata.MarketDataService)155 Test (org.junit.Test)120 ExchangeSpecification (org.knowm.xchange.ExchangeSpecification)93 CurrencyPair (org.knowm.xchange.currency.CurrencyPair)64 TradeService (org.knowm.xchange.service.trade.TradeService)62 Ticker (org.knowm.xchange.dto.marketdata.Ticker)50 AccountService (org.knowm.xchange.service.account.AccountService)38 OrderBook (org.knowm.xchange.dto.marketdata.OrderBook)31 IOException (java.io.IOException)28 LimitOrder (org.knowm.xchange.dto.trade.LimitOrder)27 BigDecimal (java.math.BigDecimal)25 Trades (org.knowm.xchange.dto.marketdata.Trades)22 CoinsuperExchange (org.knowm.xchange.coinsuper.CoinsuperExchange)15 KrakenExchange (org.knowm.xchange.kraken.KrakenExchange)15 OpenOrders (org.knowm.xchange.dto.trade.OpenOrders)12 MercadoBitcoinExchange (org.knowm.xchange.mercadobitcoin.MercadoBitcoinExchange)12 CoinmateExchange (org.knowm.xchange.coinmate.CoinmateExchange)10 UserTrades (org.knowm.xchange.dto.trade.UserTrades)10 ArrayList (java.util.ArrayList)9