@Test public void test_qty(){ SimulatorConfig config = new SimulatorConfig(); config.partialFills = false; assertEquals(order.ordQty, processor.getQty(order, quote, config), 0.0); config.partialFills = true; assertEquals(quote.askSize, processor.getQty(order, quote, config), 0.0); order.side = Side.Sell; assertEquals(quote.bidSize, processor.getQty(order, quote, config), 0.0); }
public double getQty(Order order, Quote quote, SimulatorConfig config) { if (quote != null && config.partialFills) { switch (order.side) { case Buy: if (quote.askSize > 0) return quote.askSize; break; case Sell: case SellShort: if (quote.bidSize > 0) return quote.bidSize; break; default: return order.ordQty; } } return order.ordQty; }
QuoteProcessor extends MarketDataProcessor<Quote> { public double getQty(Order order, Quote quote, SimulatorConfig config) { if (quote != null && config.partialFills) { switch (order.side) { case Buy: if (quote.askSize > 0) return quote.askSize; break; case Sell: case SellShort: if (quote.bidSize > 0) return quote.bidSize; break; default: return order.ordQty; } } return order.ordQty; } }
QuoteProcessor extends MarketDataProcessor<Quote> { public double getQty(Order order, Quote quote, SimulatorConfig config) { if (quote != null && config.partialFills) { switch (order.side) { case Buy: if (quote.askSize > 0) return quote.askSize; break; case Sell: case SellShort: if (quote.bidSize > 0) return quote.bidSize; break; default: return order.ordQty; } } return order.ordQty; }  }
QuoteProcessor extends MarketDataProcessor<Quote> { public double getQty(Order order, Quote quote, SimulatorConfig config) { if (quote != null && config.partialFills) { switch (order.side) { case Buy: if (quote.askSize > 0) return quote.askSize; break; case Sell: case SellShort: if (quote.bidSize > 0) return quote.bidSize; break; default: return order.ordQty; } } return order.ordQty; }  double getPrice(Order order, Quote quote, SimulatorConfig config); double getQty(Order order, Quote quote, SimulatorConfig config); }
QuoteProcessor extends MarketDataProcessor<Quote> { public double getQty(Order order, Quote quote, SimulatorConfig config) { if (quote != null && config.partialFills) { switch (order.side) { case Buy: if (quote.askSize > 0) return quote.askSize; break; case Sell: case SellShort: if (quote.bidSize > 0) return quote.bidSize; break; default: return order.ordQty; } } return order.ordQty; }  double getPrice(Order order, Quote quote, SimulatorConfig config); double getQty(Order order, Quote quote, SimulatorConfig config);  }