39 var maxOrderSize = maximumPercentCurrentVolume * security.
Volume;
40 var orderSize = Math.Min(maxOrderSize, Math.Abs(desiredOrderSize));
42 return Math.Sign(desiredOrderSize) *
AdjustByLotSize(security, orderSize);
54 var priceInAccountCurrency = security.
Price
58 if (priceInAccountCurrency == 0m)
63 var maxOrderSize = maximumOrderValueInAccountCurrency / priceInAccountCurrency;
64 var orderSize = Math.Min(maxOrderSize, Math.Abs(desiredOrderSize));
66 return Math.Sign(desiredOrderSize) *
AdjustByLotSize(security, orderSize);
95 .Aggregate(0m, (d, t) => d + t.Quantity - t.QuantityFilled);
96 var quantity = target.
Quantity - holdings - openOrderQuantity;
102 var baseCurrency = ((
Crypto)security).BaseCurrency.Symbol;
103 if (baseCurrency == orderFee.Currency)
105 quantity += orderFee.
Amount;
123 var absQuantity = Math.Abs(quantity);
133 absQuantity -= remainder;
135 return absQuantity * Math.Sign(quantity);