Package java.util.concurrent.atomic

Examples of java.util.concurrent.atomic.AtomicInteger.intValue()


            t.printStackTrace();
            heapSize.set(-1);
        }

        // if the heap test fails for any reason, pick a fallback value.
        if (heapSize.intValue() > 0) {
            System.out.println("Using validated heap size of " + heapSize + "m");
        } else {
            heapSize.set(800);
            System.out.println("Could not validate heap size; using 800m");
        }
View Full Code Here


            LOG.trace("Starting to submit parallel tasks");

            while (it.hasNext()) {
                final ProcessorExchangePair pair = it.next();
                final Exchange subExchange = pair.getExchange();
                updateNewExchange(subExchange, total.intValue(), pairs, it);

                completion.submit(new Callable<Exchange>() {
                    public Exchange call() throws Exception {
                        if (!running.get()) {
                            // do not start processing the task if we are not running
View Full Code Here

            }
        },C2Element.ElementSignalId);

        assertEquals(profitTargetSignalId.toString(),3,pendingSignalIdSet.size());
        assertTrue(pendingSignalIdSet.contains(profitTargetSignalId.intValue()));
        assertTrue(pendingSignalIdSet.contains(stopLossSignalId.intValue()));

        //confirm that the target can be adjusted
        BigDecimal newTarget = new BigDecimal("10");
        Response adjClose = sentryService.stockSignal(ActionForStock.SellToClose)
                .stopOrder(newTarget).quantity(10).symbol("msft")
View Full Code Here

        //confirm that the target can be adjusted
        BigDecimal newTarget = new BigDecimal("10");
        Response adjClose = sentryService.stockSignal(ActionForStock.SellToClose)
                .stopOrder(newTarget).quantity(10).symbol("msft")
                .duration(Duration.GoodTilCancel)
                .xReplace(stopLossSignalId.intValue()).send();

        Integer newCloseSignalId = adjClose.getInteger(C2Element.ElementSignalId);

        //confirm the pending list of signals has been updated
        updateSetWithPendingSignalIds(sentryService, pendingSignalIdSet);
View Full Code Here

        }, C2Element.ElementSignalId, C2Element.ElementStopLossSignalId, C2Element.ElementProfitTaretSignalId );

        sentryService.awaitPending();
        assertTrue(signalId.intValue()>=0);
        assertTrue(profitTargetSignalId.intValue()>0);
        assertTrue(stopLossSignalId.intValue()>0);

        long timeStep = 60000l*60l*24l;
        long openTime = 0l;
        long closeTime = openTime+timeStep;

View Full Code Here

            }
        },C2Element.ElementSignalId);

        assertEquals(profitTargetSignalId.toString(),3,pendingSignalIdSet.size());
        assertTrue(pendingSignalIdSet.contains(profitTargetSignalId.intValue()));
        assertTrue(pendingSignalIdSet.contains(stopLossSignalId.intValue()));

        //confirm that the target can be adjusted
        BigDecimal newTarget = new BigDecimal("160");
        Response adjClose = sentryService.stockSignal(ActionForStock.SellToClose)
                .limitOrder(newTarget).quantity(10).symbol("msft")
View Full Code Here

            updateSetWithPendingSignalIds(sentryService, pendingSignalIdSet);

            assertTrue(pendingSignalIdSet.contains(newCloseSignalId));
            if (noOCA) {
                assertTrue(pendingSignalIdSet.contains(stopLossSignalId.intValue()));
                assertEquals(2,pendingSignalIdSet.size());
            } else {
                assertEquals(1,pendingSignalIdSet.size());
            }
            dataProvider = dataProvider.incTime(timeStep,new BigDecimal("161"));
View Full Code Here

            }
        },C2Element.ElementSignalId);

        assertEquals(profitTargetSignalId.toString(),2,pendingSignalIdSet.size());
        assertTrue(pendingSignalIdSet.contains(profitTargetSignalId.intValue()));
        assertTrue(pendingSignalIdSet.contains(stopLossSignalId.intValue()));

    }

    private void updateSetWithPendingSignalIds(C2EntryService sentryService, final Set<Integer> pendingSignalIdSet) {
        pendingSignalIdSet.clear();
View Full Code Here

        }, C2Element.ElementSignalId, C2Element.ElementStopLossSignalId, C2Element.ElementProfitTaretSignalId );

        sentryService.awaitPending();
        assertTrue(signalId.intValue()>=0);
        assertTrue(profitTargetSignalId.intValue()>0);
        assertTrue(stopLossSignalId.intValue()>0);

        long timeStep = 60000l*60l*24l;
        long openTime = 0l;
        long closeTime = openTime+timeStep;

View Full Code Here

            }
        },C2Element.ElementSignalId);

        assertEquals(profitTargetSignalId.toString(),2,pendingSignalIdSet.size());
        assertTrue(pendingSignalIdSet.contains(profitTargetSignalId.intValue()));
        assertTrue(pendingSignalIdSet.contains(stopLossSignalId.intValue()));

    }

    private void validateStartingBalances(Integer systemId, C2EntryService sentryService) {
        sentryService.sendSystemHypotheticalRequest(systemId).visitC2Elements(new C2ElementVisitor() {
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.