예제 #1
0
        public decimal SellPrice(Kraken.Asset asset, decimal amount, decimal feeLinear)
        {
            if (this.IsBase(asset))
            {
                decimal result = BidPrice * amount;
                return(result.AddPercentage(-feeLinear));
            }
            else if (this.IsQuote(asset))
            {
                decimal taxfree = amount.FindValueByPercentages(100m - feeLinear, 100m);
                return(taxfree / BidPrice);
            }

            throw new Exception("Specified assed is not falid for this ticker.");
        }
예제 #2
0
 public static decimal AddPercentage(this decimal value, decimal?percentage)
 {
     return(value.AddPercentage(percentage.IsNotNull() ? percentage.Value : 0));
 }