org.knowm.xchange.currency.Currency.getSymbol()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(152)

本文整理了Java中org.knowm.xchange.currency.Currency.getSymbol()方法的一些代码示例,展示了Currency.getSymbol()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Currency.getSymbol()方法的具体详情如下:
包路径:org.knowm.xchange.currency.Currency
类名称:Currency
方法名:getSymbol

Currency.getSymbol介绍

[英]Gets the unicode symbol of this currency.
[中]获取此货币的unicode符号。

代码示例

代码示例来源:origin: knowm/XChange

public static String getMarket(CurrencyPair currencyPair) {
 return currencyPair.counter.getSymbol() + "_" + currencyPair.base.getSymbol();
}

代码示例来源:origin: knowm/XChange

/**
 * Constructor
 *
 * @param nonce
 */
public CoinoneTradeRequest(
  String accessTocken, Long nonce, BigDecimal price, BigDecimal qty, Currency currency) {
 this.accessTocken = accessTocken;
 this.nonce = nonce;
 this.price = price;
 this.qty = qty;
 this.currency = currency.getSymbol().toLowerCase();
}

代码示例来源:origin: knowm/XChange

@Override
 public void setCurrencyPair(CurrencyPair currencyPair) {
  setMarket(currencyPair.counter.getSymbol() + "_" + currencyPair.base.getSymbol());
 }
}

代码示例来源:origin: knowm/XChange

public static String toSymbol(Currency currency) {
 if (Currency.IOT.equals(currency)) {
  return "IOTA";
 }
 return currency.getSymbol();
}

代码示例来源:origin: knowm/XChange

/**
 * @param currency
 * @return
 */
public static String toSymbol(Currency currency) {
 if (Currency.IOT.equals(currency)) {
  return "IOTA";
 }
 return currency.getSymbol();
}

代码示例来源:origin: knowm/XChange

/**
 * @param currency
 * @return
 */
public static String toSymbol(Currency currency) {
 if (Currency.IOT.equals(currency)) {
  return "IOTA";
 }
 return currency.getSymbol();
}

代码示例来源:origin: knowm/XChange

public CoinoneTrades getTrades(CurrencyPair currencyPair, String period) throws IOException {
  return coinone.getTrades(currencyPair.base.getSymbol(), period);
 }
}

代码示例来源:origin: knowm/XChange

public CoinoneTicker getTicker(CurrencyPair currencyPair) throws IOException {
 return coinone.getTicker(currencyPair.base.getSymbol());
}

代码示例来源:origin: knowm/XChange

public CoinoneOrderBook getCoinoneOrderBook(CurrencyPair currencyPair) throws IOException {
 return coinone.getOrderBook(currencyPair.base.getSymbol());
}

代码示例来源:origin: knowm/XChange

public MercadoBitcoinTicker getMercadoBitcoinTicker(CurrencyPair currencyPair)
  throws IOException {
 MercadoBitcoinUtils.verifyCurrencyPairAvailability(currencyPair);
 return mercadoBitcoin.getTicker(currencyPair.base.getSymbol());
}

代码示例来源:origin: knowm/XChange

public MercadoBitcoinOrderBook getMercadoBitcoinOrderBook(CurrencyPair currencyPair)
  throws IOException {
 MercadoBitcoinUtils.verifyCurrencyPairAvailability(currencyPair);
 return mercadoBitcoin.getOrderBook(currencyPair.base.getSymbol());
}

代码示例来源:origin: knowm/XChange

public CexioClosePosition closePosition(CurrencyPair currencyPair, String id) throws IOException {
 CexioClosePositionResponse response =
   cexIOAuthenticated.closePosition(
     signatureCreator,
     currencyPair.base.getSymbol(),
     currencyPair.counter.getSymbol(),
     new CexIOGetPositionRequest(id));
 if (!"ok".equalsIgnoreCase(response.getStatus())) {
  throw new ExchangeException(response.getEventName() + " " + response.getStatus());
 }
 return response.getPosition();
}

代码示例来源:origin: knowm/XChange

public List<CexioPosition> getOpenPositions(CurrencyPair currencyPair) throws IOException {
 CexioOpenPositionsResponse response =
   cexIOAuthenticated.getOpenPositions(
     signatureCreator,
     currencyPair.base.getSymbol(),
     currencyPair.counter.getSymbol(),
     new CexIORequest());
 if (!"ok".equalsIgnoreCase(response.getStatus())) {
  throw new ExchangeException(response.getEventName() + " " + response.getStatus());
 }
 return response.getPositions();
}

代码示例来源:origin: knowm/XChange

@Override
 public OrderBook getOrderBook(CurrencyPair currencyPair, Object... args)
   throws IOException, RateLimitExceededException {
  DVChainMarketResponse marketResponse = getMarketData();
  DVChainMarketData marketData =
    marketResponse.getMarketData().get(currencyPair.base.getSymbol());
  return DVChainAdapters.adaptOrderBook(marketData, marketData.getExpiresAt(), currencyPair);
 }
}

代码示例来源:origin: knowm/XChange

public CoinoneTradeCancelRequest(String orderId, LimitOrder limitOrder) {
 this.orderId = orderId;
 this.price = limitOrder.getLimitPrice();
 this.qty = limitOrder.getOriginalAmount();
 this.isAsk = limitOrder.getType() == Order.OrderType.ASK ? true : false;
 this.currency = limitOrder.getCurrencyPair().base.getSymbol().toLowerCase();
}

代码示例来源:origin: knowm/XChange

public CoinoneOrderInfoResponse getOrderInfo(String orderId, CurrencyPair currencyPair)
   throws CoinoneException, IOException {
  CoinoneOrderInfoRequest request =
    new CoinoneOrderInfoRequest(
      apiKey,
      exchange.getNonceFactory().createValue(),
      orderId,
      currencyPair.base.getSymbol().toLowerCase());
  return coinone.getOrder(payloadCreator, signatureCreator, request);
 }
}

代码示例来源:origin: knowm/XChange

public CoinoneWithdrawResponse withdrawFund(
   Currency currency, BigDecimal amount, String address, String authNumber)
   throws CoinoneException, IOException {
  CoinoneWithdrawRequest request =
    new CoinoneWithdrawRequest(
      apiKey,
      exchange.getNonceFactory().createValue(),
      currency.getSymbol().toLowerCase(),
      authNumber,
      amount.doubleValue(),
      address);
  CoinoneWithdrawResponse response =
    coinone.withdrawFund(payloadCreator, signatureCreator, request);
  return response;
 }
}

代码示例来源:origin: knowm/XChange

@Override
public String placeMarketOrder(MarketOrder marketOrder) throws IOException {
 DVChainMarketResponse marketResponse = marketDataService.getMarketData();
 DVChainMarketData marketData =
   marketResponse.getMarketData().get(marketOrder.getCurrencyPair().base.getSymbol());
 List<DVChainLevel> levels = marketData.getLevels();
 String side = marketOrder.getType() == Order.OrderType.BID ? "Buy" : "Sell";
 DVChainNewMarketOrder dvChainNewMarketOrder =
   new DVChainNewMarketOrder(
     side,
     getPriceForMarketOrder(levels, marketOrder),
     marketOrder.getOriginalAmount(),
     marketOrder.getCurrencyPair().base.getSymbol());
 return newDVChainMarketOrder(dvChainNewMarketOrder).toString();
}

代码示例来源:origin: knowm/XChange

@Override
public String placeLimitOrder(LimitOrder limitOrder) throws IOException {
 String side = limitOrder.getType() == Order.OrderType.BID ? "Buy" : "Sell";
 DVChainNewLimitOrder dvChainNewLimitOrder =
   new DVChainNewLimitOrder(
     side,
     limitOrder.getLimitPrice(),
     limitOrder.getOriginalAmount(),
     limitOrder.getCurrencyPair().base.getSymbol());
 return newDVChainLimitOrder(dvChainNewLimitOrder).toString();
}

代码示例来源:origin: knowm/XChange

private BitcointoyouOrderResponse createOrder(String action, LimitOrder limitOrder)
  throws IOException {
 try {
  String asset = limitOrder.getCurrencyPair().base.getSymbol();
  return bitcointoyouAuthenticated.createOrder(
    apiKey,
    exchange.getNonceFactory(),
    signatureCreator,
    asset,
    action,
    limitOrder.getOriginalAmount(),
    limitOrder.getLimitPrice());
 } catch (BitcointoyouException e) {
  throw new ExchangeException(e.getError());
 }
}

相关文章