package roart.talib;

import java.time.LocalDate;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.apache.commons.lang3.tuple.Pair;
import org.jfree.data.category.DefaultCategoryDataset;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.ta4j.core.BaseTimeSeries;
import org.ta4j.core.TimeSeries;
import org.ta4j.core.indicators.EMAIndicator;
import org.ta4j.core.indicators.MACDIndicator;
import org.ta4j.core.indicators.StochasticRSIIndicator;
import org.ta4j.core.indicators.helpers.ClosePriceIndicator;
import org.ta4j.core.num.DoubleNum;
import org.ta4j.core.num.Num;
import org.ta4j.core.num.PrecisionNum;

import com.tictactec.ta.lib.Core;
import com.tictactec.ta.lib.MAType;
import com.tictactec.ta.lib.MInteger;

import roart.common.constants.Constants;
import roart.common.util.ArraysUtil;
import roart.model.StockItem;
import roart.model.data.MarketData;
import roart.model.data.PeriodData;
import roart.stockutil.StockDao;
import roart.stockutil.StockUtil;

public abstract class Ta4j extends Ta {

    protected TimeSeries getClosedSeries(double[] values, int size) {
        LocalDate date = LocalDate.now();
        TimeSeries series = new BaseTimeSeries();
        for (int i = 0; i < size; i++) {
            Num open = null;
            Num high = null;
            Num low = null;
            Num close = PrecisionNum.valueOf(values[i]);
            Num volume = null;
            LocalDate aDate = date.minusDays(size - 1 - i);
            ZonedDateTime endTime = aDate.atStartOfDay(ZoneOffset.UTC);
            series.addBar(endTime, open, high, low, close, volume);
        }
        return series;
    }



}

@@ -1787,12 +1787,706 @@
 %0A    %7D%0A%0A
+    protected TimeSeries getThreeSeries(double%5B%5D values, double low%5B%5D, double high%5B%5D, int size) %7B%0A        LocalDate date = LocalDate.now();%0A        TimeSeries series = new BaseTimeSeries();%0A        for (int i = 0; i %3C size; i++) %7B%0A            Num open = null;%0A            Num high = PrecisionNum.valueOf(high%5Bi%5D);%0A            Num low = PrecisionNum.valueOf(low%5Bi%5D);%0A            Num close = PrecisionNum.valueOf(values%5Bi%5D);%0A            Num volume = null;%0A            LocalDate aDate = date.minusDays(size - 1 - i);%0A            ZonedDateTime endTime = aDate.atStartOfDay(ZoneOffset.UTC);%0A            series.addBar(endTime, open, high, low, close, volume);%0A        %7D%0A        return series;%0A    %7D%0A%0A
 %0A%0A%7D%0A

Add new TA lib (I67).