Search in sources :

Example 1 with OkCoinExchange

use of org.knowm.xchange.okcoin.OkCoinExchange 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 2 with OkCoinExchange

use of org.knowm.xchange.okcoin.OkCoinExchange in project XChange by knowm.

the class OkCoinExampleUtils method createTestExchange.

public static Exchange createTestExchange() {
    Exchange okcoinExchange = ExchangeFactory.INSTANCE.createExchange(OkCoinExchange.class);
    okcoinExchange.getExchangeSpecification().setApiKey("");
    okcoinExchange.getExchangeSpecification().setSecretKey("");
    okcoinExchange.getExchangeSpecification().setUserName("");
    okcoinExchange.applySpecification(okcoinExchange.getExchangeSpecification());
    return okcoinExchange;
}
Also used : OkCoinExchange(org.knowm.xchange.okcoin.OkCoinExchange) Exchange(org.knowm.xchange.Exchange)

Example 3 with OkCoinExchange

use of org.knowm.xchange.okcoin.OkCoinExchange in project XChange by knowm.

the class OkCoinCurrencyPairsDemo method main.

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

Example 4 with OkCoinExchange

use of org.knowm.xchange.okcoin.OkCoinExchange in project XChange by knowm.

the class OkCoinDepthDemo method main.

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

Aggregations

Exchange (org.knowm.xchange.Exchange)4 OkCoinExchange (org.knowm.xchange.okcoin.OkCoinExchange)4 ExchangeSpecification (org.knowm.xchange.ExchangeSpecification)3