I feel it can't hurt to repeat: I'm muddling my way through this, I am not the original developer, nor am I well-versed in Java.
Ditto!
From looking at this a bit more I think the weighted decision to buy is based on the MaxLoss setting in the config file i.e. a percentage of balance.
I now think the values and currencies used in the trade are correct but the log output is not.
Maybe the only code change needed is from:
log.info("Attempting to buy "+qtyToBuy.toPlainString()+" BTC");
to:
log.info("Attempting to buy "+qtyToBuy.divide(currentAsk).toPlainString()+" BTC");
and maybe clarify things by adding a currency code to the log:
log.info("Attempting to buy "+qtyToBuy.divide(currentAsk).toPlainString()+" BTC");
if(maxLocal != null){
if(qtyToBuy.compareTo(maxLocal) > 0){
log.info(qtyToBuy.toPlainString() + " " + localCurrency.getCurrencyCode() + " was more than the configured maximum of "+maxLocal.toPlainString()+ " " + localCurrency.getCurrencyCode() +"\nReducing order size to "+maxLocal.toPlainString()+ " " + localCurrency.getCurrencyCode());
qtyToBuy = maxLocal;
}
if(qtyToBuy.compareTo(minLocal) < 0){
log.info(qtyToBuy.toPlainString() + " " + localCurrency.getCurrencyCode() + " was less than the configured minimum of "+minLocal.toPlainString()+ " " + localCurrency.getCurrencyCode() +"\nThere just isn't enough momentum to trade at this time.");
return;
}
}
This can then be easily checked by comparing the actual trades in MtGOX Account history to log output.