Example #1
0
 public ApiLimitOrder(ApiMarketWay way, int quantity, decimal price, bool allowPartialExecution)
 {
     this.Quantity = quantity;
     this.Price    = price;
     this.AllowPartialExecution = allowPartialExecution;
     this.Way = way;
 }
Example #2
0
        public IOrder CreateLimitOrder(OrderDescription orderDescription)
        {
            var           marketGateway = this.gateways[orderDescription.TargetMarketName];
            ApiMarketWay  apiMarketWay  = (orderDescription.OrderWay == Way.Sell) ? ApiMarketWay.Sell : ApiMarketWay.Buy;
            ApiLimitOrder apiLimitOrder = marketGateway.CreateLimitOrder(apiMarketWay, orderDescription.Quantity, orderDescription.OrderPrice, orderDescription.AllowPartialExecution);

            return(new LimitOrderAdapter(marketGateway, apiLimitOrder));
        }
Example #3
0
        public IOrder CreateMarketOrder(OrderDescription orderDescription)
        {
            // Adapts from the SOR model to the external market gateway one
            var marketGateway = this.gateways[orderDescription.TargetMarketName];

            ApiMarketWay   apiMarketWay   = (orderDescription.OrderWay == Way.Sell) ? ApiMarketWay.Sell : ApiMarketWay.Buy;
            ApiMarketOrder apiMarketOrder = marketGateway.CreateMarketOrder(apiMarketWay, orderDescription.Quantity);

            return(new MarketOrderAdapter(marketGateway, apiMarketOrder));
        }
Example #4
0
 public ApiLimitOrder CreateLimitOrder(ApiMarketWay apiMarketWay, int quantity, decimal price, bool allowPartial)
 {
     return(new ApiLimitOrder(apiMarketWay, quantity, price, allowPartial));
 }
Example #5
0
 public ApiMarketOrder CreateMarketOrder(ApiMarketWay way, int quantity)
 {
     return(new ApiMarketOrder(way, quantity));
 }
 public ApiMarketOrder(ApiMarketWay way, int quantity)
 {
     this.Quantity = quantity;
     this.Way      = way;
 }