예제 #1
0
        public void testCanRunOneBar()
        {
            var args      = arguments(O.list(SYMBOL), LIVE_SYSTEM, RunMode.RIGHTEDGE, typeof(ExampleSymbolSystem));
            var simulator = makeSimulator(args);

            O.zeroTo(6, i => {
                simulator.nextBar();
                noOrders(simulator);
            });

            simulator.nextBar();
            hasOrders(simulator); // entry

            simulator.nextBar();
            noOrders(simulator);
            hasPosition(simulator);

            simulator.nextBar();
            hasOrders(simulator); // exit

            simulator.writeCurveFiles(curvesDirectory);
            var written = curvesDirectory.file(LIVE_SYSTEM.liveMarket(SYMBOL.name).fileName() + ".bin");

            AreEqual(9 * 3 * 8, written.size());
        }