/** * Checks if this monetary value is greater than another. * <p> * This allows {@code Money} to be compared to any {@code BigMoneyProvider}. * Scale is ignored in the comparison. * The compared values must be in the same currency. * * @param other the other monetary value, not null * @return true is this is greater than the specified monetary value * @throws CurrencyMismatchException if the currencies differ */ public boolean isGreaterThan(BigMoneyProvider other) { return money.isGreaterThan(other); }
public String addOrder(Order.OrderType orderType, BigMoney price, BigDecimal amount) throws UnsupportedEncodingException, JsonProcessingException { String typeStr = Order.OrderType.ASK == orderType ? "ask" : "bid"; String priceStr = MtGoxUtils.getPriceString(price); String amountStr = MtGoxUtils.getAmountString(amount); HashMap<String, String> params = new HashMap<String, String>(3); params.put("type", typeStr); params.put("amount_int", amountStr); // if price <= 0, it's a market order if (price.isGreaterThan(BigMoney.zero(price.getCurrencyUnit()))) { params.put("price_int", priceStr); } String reqId = String.format("order_add:%s:%s:%s", typeStr, priceStr, amountStr); return signedCall("order/add", params, reqId); }
str.append(localCurrency.getCode()); str.append(" market is trending"); if(emaShort.isGreaterThan(emaLong)) { str.append(localCurrency.getCode()); str.append(" market is trending"); if(smaShort.isGreaterThan(smaLong)) { str.append(" market is trending"); if (currentBid.isGreaterThan(vwap)) { tradeIndicator.put("VWAPCross_Up",true); log.debug(exchangeName + "Current bid price of {} is above the VWAP of {}",currentBid.toString(),vwap.toString()); str.append(localCurrency.getCode()); str.append(" market is trending"); if(macdShort.isGreaterThan(macdLong)) { str.append(localCurrency.getCode()); str.append(" MACD Line is "); if(macdLine.isGreaterThan(macdSigLine)) {
if(qtyToSell.isGreaterThan(maxBTC)) { log.info("{} was more than the configured limit of {}",qtyToSell.withScale(8,RoundingMode.HALF_EVEN).toString(),maxBTC.toString()); log.info("Reducing {} order size to {}",exchangeName,maxBTC.toString());
if(qtyToBuy.isGreaterThan(maxLocal)){ log.info(qtyToBuy.withScale(8,RoundingMode.HALF_EVEN).toString() +" was more than the configured maximum of "+maxLocal.toString()+". Reducing " + exchangeName + "order size to "+maxLocal.toString()); qtyToBuy = maxLocal;
newAsk = tick.getAsk(); if(newPrice.isGreaterThan(high.getLast())){ high = tick; }else if(newPrice.isLessThan(low.getLast())){ if(newPrice.isGreaterThan(oldPrice)){ trendArrow++; }else if(newPrice.isLessThan(oldPrice)){ if(newBid.isGreaterThan(oldBid)){ bidArrow++; }else if(newBid.isLessThan(oldBid)){ if(newAsk.isGreaterThan(oldAsk)){ askArrow++; }else if(newAsk.isLessThan(oldAsk)){