@Override
    public void execute(JobExecutionContext jec) throws JobExecutionException {
        Bar[] bars = getBar();

        List<BigDecimal> close = Arrays.asList(bars).stream().map(c -> c.getClose()).collect(Collectors.toList());
        List<BigDecimal> high = Arrays.asList(bars).stream().map(c -> c.getHigh()).collect(Collectors.toList());
        List<BigDecimal> low = Arrays.asList(bars).stream().map(c -> c.getLow()).collect(Collectors.toList());

        double[] closeArray = close.stream().mapToDouble(BigDecimal::doubleValue).toArray();
        double[] highArray = high.stream().mapToDouble(BigDecimal::doubleValue).toArray();
        double[] lowArray = low.stream().mapToDouble(BigDecimal::doubleValue).toArray();

        double[] macd = new double[close.size() - 33];
        double[] signal = new double[close.size() - 33];
        double[] histogram = new double[close.size() - 33];

        double[] ma50 = new double[close.size() - 49];
        double[] ema5 = new double[close.size() - 4];
        double[] ema100 = new double[close.size() - 99];
        double[] sar = new double[close.size() - 1];
        double[] slowK = new double[close.size() - 8];
        double[] slowD = new double[close.size() - 8];

        Core c = new Core();
        c.macd(0, close.size() - 1, closeArray, 12, 26, 9, new MInteger(), new MInteger(), macd, signal, histogram);
        c.sma(0, close.size() - 1, closeArray, 50, new MInteger(), new MInteger(), ma50);
        c.ema(0, close.size() - 1, closeArray, 5, new MInteger(), new MInteger(), ema5);
        c.ema(0, close.size() - 1, closeArray, 100, new MInteger(), new MInteger(), ema100);
        c.sar(0, close.size() - 1, highArray, lowArray, 0.02, 0.2, new MInteger(), new MInteger(), sar);
        c.stoch(0, close.size() - 1, highArray, lowArray, closeArray, 5, 3, MAType.Ema, 3, MAType.Ema, new MInteger(), new MInteger(), slowK, slowD);

        macd = shiftList(macd, close.size());
        signal = shiftList(signal, close.size());
        histogram = shiftList(histogram, close.size());
        ma50 = shiftList(ma50, close.size());
        ema5 = shiftList(ema5, close.size());
        ema100 = shiftList(ema100, close.size());
        sar = shiftList(sar, close.size());
        slowK = shiftList(slowK, close.size());
        slowD = shiftList(slowD, close.size());

        int i = close.size() - 1;

        boolean closePriceWithSMA50 = trackCut(closeArray, ma50, i, 5);
        boolean ema5WithSMA50 = trackCut(ema5, ma50, i, 5);
        boolean ema100Trend = trackTrend(ema100, i);
        boolean sarWithClosePrice = sar[i] < closeArray[i];
        boolean macdWithSignal = trackCut(macd, signal, i, 5);
        boolean macdHist = histogram[i] > 0;
        boolean stocha = trackCut(slowD, slowK, i, 2);
        
        // Check Position Status
        checkPosition();

        System.out.println(bars[i].getBarDateTime().getTime() + " " + closePriceWithSMA50 + " " + ema5WithSMA50 + " " + ema100Trend + " " + sarWithClosePrice + " " + macdWithSignal + " " + macdHist);

        int sum = booleanToInt(closePriceWithSMA50) + booleanToInt(ema5WithSMA50) + booleanToInt(ema100Trend) + booleanToInt(sarWithClosePrice) + booleanToInt(macdWithSignal) + booleanToInt(macdHist);

        BigDecimal subtract = bars[i].getClose().subtract(price);
        if (!state && sum >= 4) {
            
            // BUY IT!!!
            buy();
            
            log.info(i + " " + bars[i].getBarDateTime().getTime() + " BUY " + bars[i].getClose());
            price = bars[i].getClose();
            state = !state;
        } else if (state && stocha && subtract.compareTo(new BigDecimal(0.0001).setScale(4, RoundingMode.DOWN)) >= 0) {
            
            //Stop Position HERE!!!
            stopPosition();
            
            log.info(i + " " + bars[i].getBarDateTime().getTime() + " SELL " + bars[i].getClose() + " GET " + subtract);
            state = !state;
        }
    }