38 private readonly decimal _makerFee;
39 private readonly decimal _takerFee;
58 public override OrderFee
GetOrderFee(OrderFeeParameters parameters)
60 var security = parameters.Security;
61 var order = parameters.Order;
65 if(security.Symbol.ID.SecurityType == SecurityType.CryptoFuture)
67 var positionValue = security.Holdings.GetQuantityValue(order.AbsoluteQuantity, security.Price);
68 return new OrderFee(
new CashAmount(positionValue.Amount * fee, positionValue.Cash.Symbol));
71 if (order.Direction == OrderDirection.Buy)
75 return new OrderFee(
new CashAmount(order.AbsoluteQuantity * fee, baseCurrency));
79 var unitPrice = security.BidPrice;
80 if (order.Type == OrderType.Limit)
83 unitPrice = ((LimitOrder)order).LimitPrice;
86 unitPrice *= security.SymbolProperties.ContractMultiplier;
89 unitPrice * order.AbsoluteQuantity * fee,
90 security.QuoteCurrency.Symbol));
98 protected virtual decimal
GetFee(Order order)
100 return GetFee(order, _makerFee, _takerFee);
103 private static decimal
GetFee(Order order, decimal makerFee, decimal takerFee)
109 if (order.Type == OrderType.Limit && ((props !=
null && props.PostOnly) || !order.IsMarketable))