Examples of tick()


Examples of com.cburch.logisim.circuit.Propagator.tick()

          }
        }
      }
      prevOutputs = curOutputs;
      tickCount++;
      prop.tick();
      prop.propagate();
    }
    long elapse = System.currentTimeMillis() - start;
    if (showTty) ensureLineTerminated();
    if (showHalt || retCode != 0) {
View Full Code Here

Examples of com.cburch.logisim.circuit.Simulator.tick()

      } else if (src == reset) {
        if (sim != null) sim.requestReset();
      } else if (src == step || src == LogisimMenuBar.SIMULATE_STEP) {
        if (sim != null) sim.step();
      } else if (src == tickOnce || src == LogisimMenuBar.TICK_STEP) {
        if (sim != null) sim.tick();
      } else if (src == ticksEnabled || src == LogisimMenuBar.TICK_ENABLE) {
        if (sim != null) sim.setIsTicking(!sim.isTicking());
      } else if (src == log) {
        LogFrame frame = menubar.getProject().getLogFrame(true);
        frame.setVisible(true);
View Full Code Here

Examples of com.collective2.signalEntry.adapter.DynamicSimulationAdapter.tick()

        long time = 100000l;
        BigDecimal fixedPrice = new BigDecimal("80.43");

        DynamicSimulationMockDataProvider dataProvider = new DynamicSimulationMockDataProvider(time,fixedPrice,fixedPrice,fixedPrice,fixedPrice,time+timeStep);

        simulationAdapter.tick(dataProvider,sentryService);

        Number buyPower = sentryService.buyPower(); // 10000 - ((10 * 80.43)+10) = 10000-814.30
        assertEquals(9185.7d,buyPower.doubleValue(),DELTA);

        Number systemEquity = sentryService.systemEquity(); //10 * 80.43 = 804.30
View Full Code Here

Examples of com.collective2.signalEntry.adapter.DynamicSimulationAdapter.tick()

        /////////////////////
        long startTime = time+timeStep;
        long closeTime = startTime+timeStep;
        BigDecimal closePrice = new BigDecimal("160.86");
        dataProvider = new DynamicSimulationMockDataProvider(startTime,fixedPrice,closePrice,fixedPrice,closePrice,closeTime);
        simulationAdapter.tick(dataProvider,sentryService);

        ////////////////////
        //confirm values
        ///////////////////
        assertEquals(0, portfolio.position("msft").quantity().intValue());
View Full Code Here

Examples of com.collective2.signalEntry.adapter.DynamicSimulationAdapter.tick()

        ///////////////////////////
        //tick for limit order fail
        ////////////////////////////
        dataProvider = dataProvider.incTime(timeStep);
        simulationAdapter.tick(dataProvider,sentryService);

        ////////////////////
        //confirm unchanged values
        ///////////////////
        assertEquals(0, portfolio.position("msft").quantity().intValue());
View Full Code Here

Examples of com.collective2.signalEntry.adapter.DynamicSimulationAdapter.tick()

        ///////////////////////////
        //tick for limit order success
        ////////////////////////////
        dataProvider = dataProvider.incTime(timeStep);
        simulationAdapter.tick(dataProvider,sentryService);

        ////////////////////
        //confirm changed
        ///////////////////
        BigDecimal entryPrice = portfolio.position("msft").openPrice();
View Full Code Here

Examples of com.collective2.signalEntry.adapter.DynamicSimulationAdapter.tick()

        ///////////////////////////
        //tick for limit order fail
        ////////////////////////////
        dataProvider = dataProvider.incTime(timeStep);
        simulationAdapter.tick(dataProvider,sentryService);

        ////////////////////
        //confirm nothing changed
        ///////////////////
        entryPrice = portfolio.position("msft").openPrice();
View Full Code Here

Examples of com.collective2.signalEntry.adapter.DynamicSimulationAdapter.tick()

        ///////////////////////////
        //tick for limit order success
        ////////////////////////////
        dataProvider = dataProvider.incTime(timeStep);
        simulationAdapter.tick(dataProvider,sentryService);

        shares = new BigDecimal("0");
        assertEquals(shares.intValue(), portfolio.position("msft").quantity().intValue());

        //extra simple methods
View Full Code Here

Examples of com.collective2.signalEntry.adapter.DynamicSimulationAdapter.tick()

        //this however has the quantity because QuantityComputableFixed is used above
        assertEquals(Integer.valueOf(10),sentryService.sendSignalStatusRequest(newCloseSignalId,true).getInteger(C2Element.ElementQuant));

        //send tick data to force open position if its still in force
        dataProvider = dataProvider.incTime(timeStep,new BigDecimal("13"));
        simulationAdapter.tick(dataProvider,sentryService);

        updateSetWithPendingSignalIds(sentryService, pendingSignalIdSet);

        assertEquals(10, portfolio.position("msft").quantity().intValue());
View Full Code Here

Examples of com.collective2.signalEntry.adapter.DynamicSimulationAdapter.tick()

        } else {
            assertEquals(1,pendingSignalIdSet.size());
        }

        dataProvider = dataProvider.incTime(timeStep,new BigDecimal("9"));
        simulationAdapter.tick(dataProvider,sentryService);
        assertEquals(0, portfolio.position("msft").quantity().intValue());

        //for oca orders the other order will get cancelled when the first is triggered.
        //for non oca orders there will be one closing order however it should not be valid
        //because its a close against something closed.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.