@Test public void test_price(){ SimulatorConfig config = new SimulatorConfig(); config.fillOnBarMode = SimulatorConfig.FillOnBarMode.LastBarClose; assertEquals(bar.close, processor.getPrice(order, bar, config), 0.0); config.fillOnBarMode = SimulatorConfig.FillOnBarMode.NextBarOpen; assertEquals(bar.open, processor.getPrice(order, bar, config), 0.0); config.fillOnBarMode = SimulatorConfig.FillOnBarMode.NextBarClose; assertEquals(bar.close, processor.getPrice(order, bar, config), 0.0); }
public double getPrice(Order order, Bar bar, SimulatorConfig config) { if (bar != null) switch (config.fillOnBarMode) { case LastBarClose: case NextBarClose: return bar.close; case NextBarOpen: return bar.open; } return 0.0; }
BarProcessor extends MarketDataProcessor<Bar> { public double getPrice(Order order, Bar bar, SimulatorConfig config) { if (bar != null) switch (config.fillOnBarMode) { case LastBarClose: case NextBarClose: return bar.close; case NextBarOpen: return bar.open; } return 0.0; } }
BarProcessor extends MarketDataProcessor<Bar> { public double getPrice(Order order, Bar bar, SimulatorConfig config) { if (bar != null) switch (config.fillOnBarMode) { case LastBarClose: case NextBarClose: return bar.close; case NextBarOpen: return bar.open; } return 0.0; }  }
BarProcessor extends MarketDataProcessor<Bar> { public double getPrice(Order order, Bar bar, SimulatorConfig config) { if (bar != null) switch (config.fillOnBarMode) { case LastBarClose: case NextBarClose: return bar.close; case NextBarOpen: return bar.open; } return 0.0; }  double getPrice(Order order, Bar bar, SimulatorConfig config); double getQty(Order order, Bar bar, SimulatorConfig config); }
BarProcessor extends MarketDataProcessor<Bar> { public double getPrice(Order order, Bar bar, SimulatorConfig config) { if (bar != null) switch (config.fillOnBarMode) { case LastBarClose: case NextBarClose: return bar.close; case NextBarOpen: return bar.open; } return 0.0; }  double getPrice(Order order, Bar bar, SimulatorConfig config); double getQty(Order order, Bar bar, SimulatorConfig config);  }