@Override public void actionPerformed(ActionEvent e) { try { stop(); } catch (Exception ex) { ex.printStackTrace(); } } });
VisualBacktester bt = new VisualBacktester(archiveFactory, transport, idf, virtEx, new ITradingSystem[]{tradSys}, streamIters, btConfig, false); bt.setSysExit(false); bt.execute(); sr = bt.stop();
public void backtest(BacktestConfiguration bc, ITradingSystem[] its, List<StreamEventIterator> listOfStreams) throws Exception { // // // ApplicationContext appContext = new ClassPathXmlApplicationContext("fwspring.xml"); IDaoFactory idf = (IDaoFactory) appContext.getBean("ibatisDao"); IArchiveFactory archiveFactory = (IArchiveFactory) appContext.getBean("archiveFactory"); //d // // initialize transport layer and VirtEX ITransportFactory transport = new InMemoryTransportFactory(); VirtualExchange virtEx = new VirtualExchange(transport); // // // initialize the backtester VisualBacktester bt = new VisualBacktester(archiveFactory, transport, idf, virtEx, its, listOfStreams.toArray(new StreamEventIterator[] {}), bc); // set the backtest config, for later reporting. // // // ok, now that we have all initialized ... execute the backtest. bt.execute(); // }