public FxTradingOrderModel(FxTradingOrderType orderType, FxTradeSide side, decimal price, decimal size) { OrderId = Guid.NewGuid(); OrderType = orderType; OrderPrice = price; OrderSize = side == FxTradeSide.Buy ? size : -size; }
public static FxTradeSide Opposite(this FxTradeSide side) { switch (side) { case FxTradeSide.Buy: return(FxTradeSide.Sell); case FxTradeSide.Sell: return(FxTradeSide.Buy); default: throw new InvalidOperationException(); } }
public virtual IFxTradingSimpleOrder CreateLimitPriceOrder(FxTradeSide side, decimal price, decimal size) { throw new NotSupportedException(); }
public override IFxTradingSimpleOrder CreateMarketPriceOrder(FxTradeSide side, decimal size) { return(new FxTradingOrderModel(FxTradingOrderType.Market, side, size)); }