use of org.ta4j.core.BaseTimeSeries in project crypto-bot by jnidzwetzki.
the class HistoricalCandlesHelper method requestHistoricalCandles.
/**
* Request historical candles
*
* @param bitfinexApiBroker
* @param timeframe
* @param tradedCurrencies
* @return
* @throws InterruptedException
* @throws APIException
*/
public static Map<BitfinexCandlestickSymbol, TimeSeries> requestHistoricalCandles(final BitfinexApiBroker bitfinexApiBroker, final Timeframe timeframe, final List<BitfinexCurrencyPair> tradedCurrencies) throws InterruptedException, APIException {
logger.info("Request historical candles");
final Map<BitfinexCandlestickSymbol, TimeSeries> timeSeries = new HashMap<>();
for (final BitfinexCurrencyPair currency : tradedCurrencies) {
final String bitfinexString = currency.toBitfinexString();
final BaseTimeSeries currencyTimeSeries = new BaseTimeSeries(bitfinexString);
final BitfinexCandlestickSymbol barSymbol = new BitfinexCandlestickSymbol(currency, timeframe);
timeSeries.put(barSymbol, currencyTimeSeries);
final CountDownLatch tickCountdown = new CountDownLatch(100);
// Add bars to timeseries callback
final BiConsumer<BitfinexCandlestickSymbol, BitfinexTick> callback = (channelSymbol, tick) -> {
final TimeSeries timeSeriesToAdd = timeSeries.get(channelSymbol);
final Bar bar = BarConverter.convertBitfinexTick(tick);
try {
timeSeriesToAdd.addBar(bar);
tickCountdown.countDown();
} catch (IllegalArgumentException e) {
logger.error("Unable to add tick {} to time series, last tick is {}", bar, timeSeriesToAdd.getLastBar());
}
};
bitfinexApiBroker.getQuoteManager().registerCandlestickCallback(barSymbol, callback);
bitfinexApiBroker.getQuoteManager().subscribeCandles(barSymbol);
// Wait for 100 bars or 10 seconds. All snapshot ticks are handled in
// a synchronized block, so we receive the full snapshot even if we
// call removeTickCallback.
tickCountdown.await(10, TimeUnit.SECONDS);
bitfinexApiBroker.getQuoteManager().registerCandlestickCallback(barSymbol, callback);
bitfinexApiBroker.getQuoteManager().unsubscribeCandles(barSymbol);
logger.info("Loaded ticks for symbol {} {}", bitfinexString, +timeSeries.get(barSymbol).getEndIndex());
}
return timeSeries;
}
use of org.ta4j.core.BaseTimeSeries in project ta4j by ta4j.
the class PivotPointIndicatorTest method initDataForMonthlyTimeFrame.
@Before
public void initDataForMonthlyTimeFrame() {
String rawData_1_days = "2017/08/18,167.4100,15065590.0000,166.8400,168.6700,166.2100\n" + "2017/08/17,166.9100,17009420.0000,169.3400,169.8600,166.8500\n" + "2017/08/16,170.0000,15732840.0000,171.2500,171.3800,169.2400\n" + "2017/08/15,171.0000,8713651.0000,171.4900,171.5000,170.0100\n" + "2017/08/14,170.7500,12940140.0000,170.0900,171.0800,169.2900\n" + "2017/08/11,168.0800,13778190.0000,167.9500,168.8200,166.8500\n" + "2017/08/10,167.4000,20551720.0000,170.0600,170.5900,166.8500\n" + "2017/08/09,171.1800,10800730.0000,169.9800,171.4500,169.5600\n" + "2017/08/08,171.2300,14317200.0000,171.8800,173.0500,170.6200\n" + "2017/08/07,171.9800,12765230.0000,169.9500,172.0600,169.6600\n" + "2017/08/04,169.6200,10505980.0000,168.9700,170.0600,168.6900\n" + "2017/08/03,168.5900,10519470.0000,169.3000,169.7000,168.2500\n" + "2017/08/02,169.3000,17181110.0000,170.3000,170.5500,166.9100\n" + "2017/08/01,169.8600,14286110.0000,169.8200,170.4700,169.0500\n" + "2017/07/31,169.2500,25429310.0000,172.0000,172.7200,168.5500\n" + "2017/07/28,172.4500,24546680.0000,169.0700,173.4300,169.0500\n" + "2017/07/27,170.4400,68454830.0000,174.7000,175.4900,167.5000\n" + "2017/07/26,165.6100,32989200.0000,166.0100,166.0100,164.1000\n" + "2017/07/25,165.2800,15309000.0000,165.0100,165.5400,163.8619\n" + "2017/07/24,166.0000,17208500.0000,164.6400,166.1700,164.3100\n" + "2017/07/21,164.4300,14712450.0000,164.1600,165.0500,163.7500\n" + "2017/07/20,164.5300,18409730.0000,164.8000,165.0000,162.8100\n" + "2017/07/19,164.1400,26144510.0000,163.5900,165.7000,163.1700\n" + "2017/07/18,162.8600,23686800.0000,159.6600,163.7300,159.4200\n" + "2017/07/17,159.7300,12757430.0000,160.2500,160.7800,158.8100\n" + "2017/07/14,159.9700,16305570.0000,160.1300,160.3200,159.3254\n" + "2017/07/13,159.2600,13912150.0000,158.7400,159.7800,158.4227\n" + "2017/07/12,158.9000,22710090.0000,156.4900,159.1600,156.2000\n" + "2017/07/11,155.2700,13652540.0000,153.3700,155.4225,152.9100\n" + "2017/07/10,153.5000,13326410.0000,151.6900,153.9800,151.5100\n" + "2017/07/07,151.4400,13249750.0000,149.2500,151.9900,149.1900\n" + "2017/07/06,148.8200,14934450.0000,149.0300,150.0400,148.0000\n" + "2017/07/05,150.3400,14321330.0000,149.0000,150.8500,148.1300\n" + "2017/07/03,148.4300,13862740.0000,151.7200,152.1500,147.8000\n" + "2017/06/30,150.9800,14909670.0000,151.9000,151.9200,150.0600\n" + "2017/06/29,151.0400,23948630.0000,152.2800,152.5000,148.9175\n" + "2017/06/28,153.2400,16696230.0000,150.9200,153.4700,149.8600\n" + "2017/06/27,150.5800,19351560.0000,152.8400,153.3100,150.3900\n" + "2017/06/26,153.5900,18030200.0000,156.2500,156.5000,153.1954\n" + "2017/06/23,155.0700,17897280.0000,152.7200,155.2000,152.6500\n" + "2017/06/22,153.4000,12835380.0000,153.0100,154.5500,152.9100\n" + "2017/06/21,153.9100,14943770.0000,152.3600,154.0800,151.8800\n" + "2017/06/20,152.2500,14733590.0000,152.8800,153.8400,152.2100\n" + "2017/06/19,152.8700,18944190.0000,151.7100,153.5700,151.7100\n" + "2017/06/16,150.6400,22843010.0000,149.5900,150.8300,148.6000\n" + "2017/06/15,149.8000,18956910.0000,147.6700,150.0366,146.3747\n" + "2017/06/14,150.2500,20774910.0000,151.2600,152.4000,149.0500\n" + "2017/06/13,150.6800,20474720.0000,150.1500,151.1800,148.9000\n" + "2017/06/12,148.4400,33150610.0000,148.1700,149.1950,144.5600\n" + "2017/06/09,149.6000,35541670.0000,154.7700,155.5900,146.6100\n" + "2017/06/08,154.7100,17795860.0000,154.0800,154.7300,153.1000\n" + "2017/06/07,153.1200,12040430.0000,153.2700,153.7500,152.3400\n" + "2017/06/06,152.8100,13443610.0000,153.4100,154.5200,152.4800\n" + "2017/06/05,153.6300,12504820.0000,153.6400,154.7088,153.4100\n" + "2017/06/02,153.6100,16838650.0000,151.8500,153.6300,151.3000\n" + "2017/06/01,151.5300,14511530.0000,151.7500,152.2900,150.3000\n" + "2017/05/31,151.4600,18001140.0000,152.7000,153.3500,151.0900\n" + "2017/05/30,152.3800,13213700.0000,151.9700,152.9000,151.6400\n" + "2017/05/26,152.1300,14984540.0000,152.2300,152.2500,151.1500\n" + "2017/05/25,151.9600,19827210.0000,150.3000,152.5900,149.9500\n" + "2017/05/24,150.0400,17914740.0000,148.5100,150.2300,148.4200\n" + "2017/05/23,148.0700,12807840.0000,148.5200,148.8100,147.2500\n" + "2017/05/22,148.2400,12578390.0000,148.0800,148.5900,147.6900\n" + "2017/05/19,148.0600,16165160.0000,148.4450,149.3900,147.9600\n" + "2017/05/18,147.6600,22778870.0000,144.7200,148.1500,144.5100\n" + "2017/05/17,144.8500,28232610.0000,148.0000,148.6700,144.4216\n" + "2017/05/16,149.7800,14506870.0000,150.1100,150.2100,149.0300\n" + "2017/05/15,150.1900,14952950.0000,150.1700,151.4800,149.7700\n" + "2017/05/12,150.3300,9584769.0000,150.4000,150.4600,149.6300\n" + "2017/05/11,150.0400,11832750.0000,150.3100,150.6500,149.4100\n" + "2017/05/10,150.2900,11994140.0000,150.2300,150.5200,148.8600\n" + "2017/05/09,150.4800,17381800.0000,151.4900,152.5900,150.2100\n" + "2017/05/08,151.0600,15813350.0000,150.7100,151.0800,149.7400\n" + "2017/05/05,150.2400,17104730.0000,151.4500,151.6300,149.7900\n" + "2017/05/04,150.8500,36185180.0000,150.1700,151.5200,148.7200\n" + "2017/05/03,151.8000,28301550.0000,153.6000,153.6000,151.3400\n" + "2017/05/02,152.7800,21617190.0000,153.3400,153.4400,151.6600\n" + "2017/05/01,152.4600,25170200.0000,151.7400,152.5700,151.4200\n" + "2017/04/28,150.2500,30607510.0000,149.5000,151.5300,149.0700\n" + "2017/04/27,147.7000,11072600.0000,146.6700,147.7500,146.1400\n" + "2017/04/26,146.5600,12388100.0000,147.0900,147.5900,146.0900\n" + "2017/04/25,146.4900,17718030.0000,145.7900,147.1500,145.7898\n" + "2017/04/24,145.4700,14397480.0000,144.9600,145.6738,144.3400\n" + "2017/04/21,143.6800,12172640.0000,143.9000,144.1700,142.2700\n" + "2017/04/20,143.8000,15948700.0000,142.9500,144.2500,142.6890\n" + "2017/04/19,142.2700,15544500.0000,141.3500,143.0400,141.2700\n" + "2017/04/18,140.9600,14795020.0000,141.2700,141.9050,140.6100\n" + "2017/04/17,141.4200,11488510.0000,139.7600,141.5500,139.7500\n" + "2017/04/13,139.3900,10939950.0000,139.6200,140.5800,139.3300\n" + "2017/04/12,139.5800,11600930.0000,139.7200,140.4000,139.4400\n" + "2017/04/11,139.9200,16627940.0000,140.8000,141.0299,138.8100\n" + "2017/04/10,141.0400,9033921.0000,141.0000,141.4300,140.6300\n" + "2017/04/07,140.7800,11811450.0000,141.2000,141.5500,140.2400\n" + "2017/04/06,141.1700,15089610.0000,142.1100,142.2200,140.9100\n" + "2017/04/05,141.8500,17132150.0000,142.2600,143.4400,141.2900\n" + "2017/04/04,141.7300,11934110.0000,141.8600,142.0900,141.2700\n" + "2017/04/03,142.2800,13552550.0000,141.9300,142.4700,140.8200\n" + "2017/03/31,142.0500,11366390.0000,142.3100,142.6300,141.8900\n" + "2017/03/30,142.4100,12393610.0000,142.4000,142.9500,141.8500\n" + "2017/03/29,142.6500,16504590.0000,141.9900,142.8600,141.4300\n" + "2017/03/28,141.7600,14660670.0000,140.3600,141.9500,140.0100\n" + "2017/03/27,140.3200,12791820.0000,139.0500,140.6500,138.7700\n" + "2017/03/24,140.3400,16636900.0000,140.0800,141.0244,139.7600\n" + "2017/03/23,139.5300,12992700.0000,139.4800,140.3900,139.0900\n" + "2017/03/22,139.5900,17020610.0000,137.9300,139.7900,137.6000\n" + "2017/03/21,138.5100,29855980.0000,141.1500,142.3082,138.4000\n" + "2017/03/20,139.9400,12002150.0000,139.7100,140.1900,139.2500\n" + "2017/03/17,139.8400,20487730.0000,140.3400,140.3400,139.7000\n" + "2017/03/16,139.9900,13604260.0000,140.2000,140.2500,139.7300\n" + "2017/03/15,139.7200,19315340.0000,139.2900,140.1000,138.4900\n" + "2017/03/14,139.3200,12935370.0000,139.4600,139.4600,138.5200\n" + "2017/03/13,139.6000,10949000.0000,138.7100,139.6800,138.6729\n" + "2017/03/10,138.7900,16299220.0000,138.9100,139.4900,138.2200\n" + "2017/03/09,138.2400,15523900.0000,137.7200,138.5700,137.4000\n" + "2017/03/08,137.7200,10174840.0000,137.1500,137.9900,137.0516\n" + "2017/03/07,137.3000,13517880.0000,137.0300,138.3700,136.9900\n" + "2017/03/06,137.4200,12562040.0000,136.8800,137.8300,136.5100\n" + "2017/03/03,137.1700,11154380.0000,136.6300,137.3300,136.0800\n" + "2017/03/02,136.7600,12278560.0000,137.0900,137.8200,136.3100\n" + "2017/03/01,137.4200,16241330.0000,136.4700,137.4800,136.3000\n" + "2017/02/28,135.5400,16096310.0000,136.7900,136.8050,134.7500\n" + "2017/02/27,136.4100,14300970.0000,135.2600,137.1846,135.0200\n" + "2017/02/24,135.4400,12617180.0000,134.1600,135.6200,134.1600\n" + "2017/02/23,135.3600,18408460.0000,135.8900,136.1200,134.3300\n" + "2017/02/22,136.1200,27331930.0000,133.6000,136.7900,133.4600\n" + "2017/02/21,133.7200,14735860.0000,133.5000,133.9100,132.9000\n" + "2017/02/17,133.5300,12265480.0000,133.5000,134.0912,133.1700\n" + "2017/02/16,133.8400,12816260.0000,133.0700,133.8700,133.0220\n" + "2017/02/15,133.4400,13215470.0000,133.4500,133.7000,132.6600\n" + "2017/02/14,133.8500,14346090.0000,134.1000,134.2300,132.5500\n" + "2017/02/13,134.0500,13511640.0000,134.6975,134.6975,133.7000\n" + "2017/02/10,134.1900,15050270.0000,134.1000,134.9400,133.6800\n" + "2017/02/09,134.1400,16454060.0000,134.4900,134.5000,133.3100\n" + "2017/02/08,134.2000,22370760.0000,132.6000,134.4400,132.4400\n" + "2017/02/07,131.8400,14585030.0000,132.2400,133.0000,131.6610\n" + "2017/02/06,132.0600,17015610.0000,130.9800,132.0600,130.3000\n" + "2017/02/03,130.9800,24776070.0000,131.2400,132.8500,130.7600\n" + "2017/02/02,130.8400,54281800.0000,133.2200,135.4900,130.4000\n" + "2017/02/01,133.2300,47329480.0000,132.2500,133.4900,130.6800\n" + "2017/01/31,130.3200,19642550.0000,130.1700,130.6600,129.5157\n" + "2017/01/30,130.9800,18919750.0000,131.5800,131.5800,129.6000\n" + "2017/01/27,132.1800,19505970.0000,132.6800,132.9500,131.0800\n" + "2017/01/26,132.7800,19964800.0000,131.6300,133.1400,131.4401\n" + "2017/01/25,131.4800,18745640.0000,130.0000,131.7400,129.7700\n" + "2017/01/24,129.3700,15140910.0000,129.3800,129.9000,128.3800\n" + "2017/01/23,128.9300,16566300.0000,127.3100,129.2500,126.9500\n" + "2017/01/20,127.0400,19068380.0000,128.1000,128.4800,126.7800\n" + "2017/01/19,127.5500,12171270.0000,128.2300,128.3500,127.4500\n" + "2017/01/18,127.9200,13107440.0000,128.4100,128.4300,126.8400\n" + "2017/01/17,127.8700,15279990.0000,128.0400,128.3400,127.4000\n" + "2017/01/13,128.3400,24857410.0000,127.4900,129.2700,127.3700\n" + "2017/01/12,126.6200,18596580.0000,125.6100,126.7300,124.8000\n" + "2017/01/11,126.0900,18334560.0000,124.3500,126.1200,124.0600\n" + "2017/01/10,124.3500,17299590.0000,124.8200,125.5000,124.2800\n" + "2017/01/09,124.9000,22874170.0000,123.5500,125.4300,123.0400\n" + "2017/01/06,123.4100,28525570.0000,120.9800,123.8800,120.0300\n" + "2017/01/05,120.6700,19459380.0000,118.8600,120.9500,118.3209\n" + "2017/01/04,118.6900,19594560.0000,117.5500,119.6600,117.2900\n" + "2017/01/03,116.8600,20635600.0000,116.0300,117.8400,115.5100";
String[] dataLine = rawData_1_days.split("\n");
List<Bar> bars = new ArrayList<>();
for (int i = dataLine.length - 1; i >= 0; i--) {
String[] barData = dataLine[i].split(",");
ZonedDateTime date = LocalDate.parse(barData[0], DateTimeFormatter.ofPattern("yyyy/MM/dd")).atStartOfDay(ZoneId.systemDefault());
double close = Double.parseDouble(barData[1]);
double volume = Double.parseDouble(barData[2]);
double open = Double.parseDouble(barData[3]);
double high = Double.parseDouble(barData[4]);
double low = Double.parseDouble(barData[5]);
bars.add(new BaseBar(date, open, high, low, close, volume));
}
series_1_days = new BaseTimeSeries("FB_daily", bars);
}
use of org.ta4j.core.BaseTimeSeries in project ta4j by ta4j.
the class PivotPointIndicatorTest method initDataForYearlyTimeFrame.
@Before
public void initDataForYearlyTimeFrame() {
String rawData_1_week = "2012-05-14,42.049999,45.000000,38.000000,38.230000,38.230000,573576400\n" + "2012-05-21,36.529999,36.660000,30.940001,31.910000,31.910000,430966300\n" + "2012-05-28,31.480000,31.690001,26.830000,27.719999,27.719999,288826000\n" + "2012-06-04,27.200001,27.760000,25.520000,27.100000,27.100000,203386400\n" + "2012-06-11,27.180000,30.100000,26.840000,30.010000,30.010000,121558000\n" + "2012-06-18,29.959999,33.450001,29.410000,33.049999,33.049999,186090800\n" + "2012-06-25,32.860001,33.439999,30.760000,31.100000,31.100000,115019800\n" + "2012-07-02,31.250000,31.900000,30.549999,31.730000,31.730000,43863300\n" + "2012-07-09,32.099998,32.880001,30.549999,30.719999,30.719999,64494000\n" + "2012-07-16,30.500000,30.500000,27.150000,28.760000,28.760000,97506700\n" + "2012-07-23,28.120001,29.490000,22.280001,23.709999,23.709999,228860400\n" + "2012-07-30,24.000000,24.040001,19.820000,21.090000,21.090000,267091200\n" + "2012-08-06,21.389999,22.450001,20.219999,21.809999,21.809999,135504600\n" + "2012-08-13,22.150000,22.450001,19.000000,19.049999,19.049999,399001700\n" + "2012-08-20,19.049999,20.129999,18.750000,19.410000,19.410000,284155300\n" + "2012-08-27,19.490000,19.530001,18.030001,18.059999,18.059999,151657400\n" + "2012-09-03,18.080000,19.420000,17.549999,18.980000,18.980000,189842400\n" + "2012-09-10,19.059999,22.080000,18.549999,22.000000,22.000000,334751400\n" + "2012-09-17,22.670000,23.370001,21.370001,22.860001,22.860001,274677900\n" + "2012-09-24,21.780001,21.980000,19.799999,21.660000,21.660000,259372000\n" + "2012-10-01,22.080000,22.590000,20.879999,20.910000,20.910000,200025600\n" + "2012-10-08,20.400000,20.750000,19.450001,19.520000,19.520000,139347000\n" + "2012-10-15,19.680000,20.480000,18.799999,19.000000,19.000000,173091300\n" + "2012-10-22,19.200001,24.250000,19.049999,21.940001,21.940001,489096200\n" + "2012-10-29,20.820000,21.690001,20.730000,21.180000,21.180000,175436500\n" + "2012-11-05,21.100000,21.480000,19.129999,19.209999,19.209999,170816300\n" + "2012-11-12,19.150000,23.930000,18.870001,23.559999,23.559999,554915200\n" + "2012-11-19,23.959999,24.680000,22.700001,24.000000,24.000000,251059900\n" + "2012-11-26,24.940001,28.000000,24.809999,28.000000,28.000000,474640500\n" + "2012-12-03,28.000000,28.879999,26.680000,27.490000,27.490000,353125000\n" + "2012-12-10,27.170000,28.750000,26.760000,26.809999,26.809999,347095000\n" + "2012-12-17,26.770000,28.219999,26.120001,26.260000,26.260000,269775700\n" + "2012-12-24,26.500000,27.180000,25.150000,25.910000,25.910000,161462000\n" + "2012-12-31,26.200001,28.930000,26.110001,28.760000,28.760000,266076900\n" + "2013-01-07,28.690001,31.959999,28.650000,31.719999,31.719999,419355200\n" + "2013-01-14,32.080002,32.209999,29.270000,29.660000,29.660000,437356300\n" + "2013-01-21,29.750000,31.930000,29.740000,31.540001,31.540001,202351800\n" + "2013-01-28,31.879999,32.509998,28.740000,29.730000,29.730000,496942700\n" + "2013-02-04,29.059999,29.290001,28.010000,28.549999,28.549999,250935200\n" + "2013-02-11,28.610001,28.750000,27.100000,28.320000,28.320000,249749600\n" + "2013-02-18,28.230000,29.080000,26.820000,27.129999,27.129999,177487100\n" + "2013-02-25,27.160000,28.120001,26.340000,27.780001,27.780001,247676000\n" + "2013-03-04,27.760000,28.680000,27.209999,27.959999,27.959999,225294600\n" + "2013-03-11,28.010000,28.639999,26.559999,26.650000,26.650000,162075000\n" + "2013-03-18,26.370001,26.900000,25.559999,25.730000,25.730000,138706800\n" + "2013-03-25,25.750000,26.280001,24.719999,25.580000,25.580000,147039300\n" + "2013-04-01,25.629999,27.799999,25.280001,27.389999,27.389999,252181200\n" + "2013-04-08,27.190001,28.100000,26.420000,27.400000,27.400000,156582400\n" + "2013-04-15,27.160000,27.480000,25.150000,25.730000,25.730000,143521800\n" + "2013-04-22,25.809999,27.620001,25.700001,26.850000,26.850000,120777000\n" + "2013-04-29,27.160000,29.070000,26.860001,28.309999,28.309999,292777800\n" + "2013-05-06,28.330000,28.459999,26.570000,26.680000,26.680000,184157700\n" + "2013-05-13,26.600000,27.330000,25.900000,26.250000,26.250000,149260700\n" + "2013-05-20,26.180000,26.190001,24.080000,24.309999,24.309999,210369700\n" + "2013-05-27,24.540001,24.950001,23.260000,24.350000,24.350000,210975700\n" + "2013-06-03,24.270000,24.320000,22.670000,23.290001,23.290001,194274200\n" + "2013-06-10,24.059999,24.600000,23.260000,23.629999,23.629999,176591100\n" + "2013-06-17,23.910000,25.190001,23.650000,24.530001,24.530001,190763700\n" + "2013-06-24,23.950001,24.980000,23.379999,24.879999,24.879999,226702500\n" + "2013-07-01,24.969999,25.059999,24.150000,24.370001,24.370001,69610200\n" + "2013-07-08,24.469999,26.000000,24.420000,25.910000,25.910000,127489600\n" + "2013-07-15,25.930000,26.780001,25.600000,25.879999,25.879999,147916700\n" + "2013-07-22,25.990000,34.880001,25.719999,34.009998,34.009998,639870300\n" + "2013-07-29,34.070000,38.490002,34.009998,38.049999,38.049999,632255300\n" + "2013-08-05,38.430000,39.320000,37.700001,38.500000,38.500000,297633700\n" + "2013-08-12,38.200001,38.500000,36.020000,37.080002,37.080002,247326000\n" + "2013-08-19,37.430000,40.630001,37.139999,40.549999,40.549999,270095200\n" + "2013-08-26,40.900002,42.259998,39.419998,41.290001,41.290001,350814200\n" + "2013-09-02,41.840000,44.610001,41.439999,43.950001,43.950001,258927900\n" + "2013-09-09,44.360001,45.619999,43.110001,44.310001,44.310001,323500900\n" + "2013-09-16,44.849998,47.599998,42.430000,47.490002,47.490002,421156600\n" + "2013-09-23,47.279999,51.279999,46.290001,51.240002,51.240002,479403400\n" + "2013-09-30,50.139999,51.599998,49.060001,51.040001,51.040001,417535000\n" + "2013-10-07,50.730000,51.290001,45.259998,49.110001,49.110001,498784000\n" + "2013-10-14,48.310001,54.830002,47.910000,54.220001,54.220001,374408000\n" + "2013-10-21,54.680000,54.810001,51.130001,51.950001,51.950001,290506000\n" + "2013-10-28,51.540001,52.090000,46.500000,49.750000,49.750000,646530000\n" + "2013-11-04,49.369999,50.450001,47.250000,47.529999,47.529999,392954000\n" + "2013-11-11,47.040001,49.570000,45.730000,49.009998,49.009998,345921000\n" + "2013-11-18,48.470001,48.840000,45.720001,46.230000,46.230000,290876000\n" + "2013-11-25,46.360001,47.209999,43.549999,47.009998,47.009998,232527900\n" + "2013-12-02,46.900002,49.389999,46.259998,47.939999,47.939999,230543000\n" + "2013-12-09,48.090000,53.500000,47.740002,53.320000,53.320000,345675000\n" + "2013-12-16,53.250000,55.889999,52.910000,55.119999,55.119999,569450200\n" + "2013-12-23,55.500000,58.580002,55.250000,55.439999,55.439999,260481800\n" + "2013-12-30,54.930000,55.650002,53.430000,54.560001,54.560001,192824900\n" + "2014-01-06,54.419998,58.959999,54.049999,57.939999,57.939999,337445200\n" + "2014-01-13,57.910000,58.570000,55.380001,56.299999,56.299999,209568900\n" + "2014-01-20,56.599998,59.310001,54.400002,54.450001,54.450001,213174600\n" + "2014-01-27,54.730000,63.369999,51.849998,62.570000,62.570000,453084400\n" + "2014-02-03,63.029999,64.570000,60.700001,64.320000,64.320000,275328000\n" + "2014-02-10,64.300003,67.580002,63.349998,67.089996,67.089996,235230400\n" + "2014-02-17,66.940002,70.110001,65.730003,68.589996,68.589996,307758300\n" + "2014-02-24,68.739998,71.440002,67.379997,68.459999,68.459999,292457400\n" + "2014-03-03,66.959999,71.970001,66.510002,69.800003,69.800003,258358800\n" + "2014-03-10,70.769997,72.589996,67.459999,67.720001,67.720001,270938400\n" + "2014-03-17,68.180000,69.599998,66.180000,67.239998,67.239998,241443900\n" + "2014-03-24,67.190002,67.360001,57.980000,60.009998,60.009998,431687900\n" + "2014-03-31,60.779999,63.910000,56.320000,56.750000,56.750000,387652400\n" + "2014-04-07,55.900002,63.180000,55.439999,58.529999,58.529999,493979000\n" + "2014-04-14,60.090000,60.580002,55.880001,58.939999,58.939999,347762000\n" + "2014-04-21,59.459999,63.650002,57.570000,57.709999,57.709999,448174700\n" + "2014-04-28,58.049999,62.279999,54.660000,60.459999,60.459999,396026000\n" + "2014-05-05,59.669998,61.349998,56.259998,57.240002,57.240002,294380000\n" + "2014-05-12,57.980000,60.889999,57.310001,58.020000,58.020000,249276000\n" + "2014-05-19,57.889999,61.480000,57.570000,61.349998,61.349998,248451000\n" + "2014-05-26,61.619999,64.300003,61.570000,63.299999,63.299999,191430500\n" + "2014-06-02,63.230000,64.360001,62.049999,62.500000,62.500000,194521000\n" + "2014-06-09,62.400002,66.470001,61.790001,64.500000,64.500000,236346000\n" + "2014-06-16,64.160004,65.750000,63.349998,64.500000,64.500000,175042000\n" + "2014-06-23,64.320000,68.000000,64.220001,67.599998,67.599998,230378000\n" + "2014-06-30,67.459999,68.440002,65.760002,66.290001,66.290001,127444000\n" + "2014-07-07,66.300003,66.589996,62.209999,66.339996,66.339996,232737000\n" + "2014-07-14,67.129997,68.459999,66.040001,68.419998,68.419998,192935800\n" + "2014-07-21,68.809998,76.739998,68.500000,75.190002,75.190002,338457000\n" + "2014-07-28,75.169998,75.500000,71.550003,72.360001,72.360001,207429000\n" + "2014-08-04,72.360001,74.000000,71.790001,73.059998,73.059998,162092000\n" + "2014-08-11,73.459999,74.650002,72.220001,73.629997,73.629997,142329600\n" + "2014-08-18,74.000000,75.580002,73.570000,74.570000,74.570000,114569000\n" + "2014-08-25,74.940002,75.989998,73.730003,74.820000,74.820000,128238000\n" + "2014-09-01,75.010002,77.480003,74.820000,77.260002,77.260002,123520000\n" + "2014-09-08,77.260002,78.360001,76.199997,77.480003,77.480003,145869800\n" + "2014-09-15,77.150002,78.300003,73.070000,77.910004,77.910004,215816000\n" + "2014-09-22,77.000000,78.940002,75.949997,78.790001,78.790001,165860000\n" + "2014-09-29,78.120003,79.709999,75.639999,77.440002,77.440002,184848000\n" + "2014-10-06,77.190002,77.949997,72.760002,72.910004,72.910004,168655000\n" + "2014-10-13,73.230003,76.000000,70.320000,75.949997,75.949997,285636000\n" + "2014-10-20,75.599998,80.820000,75.379997,80.669998,80.669998,176119000\n" + "2014-10-27,80.739998,81.160004,72.900002,74.989998,74.989998,338315000\n" + "2014-11-03,75.470001,76.800003,73.650002,75.599998,75.599998,158123000\n" + "2014-11-10,75.360001,75.480003,73.540001,74.879997,74.879997,112752800\n" + "2014-11-17,74.879997,75.660004,72.510002,73.750000,73.750000,117048200\n" + "2014-11-24,73.540001,78.269997,73.349998,77.699997,77.699997,103041300\n" + "2014-12-01,77.260002,77.309998,74.400002,76.360001,76.360001,103922900\n" + "2014-12-08,76.180000,78.879997,74.779999,77.830002,77.830002,144856700\n" + "2014-12-15,78.459999,80.000000,74.589996,79.879997,79.879997,167712100\n" + "2014-12-22,80.080002,82.169998,80.000000,80.779999,80.779999,69594500\n" + "2014-12-29,80.489998,80.959999,77.699997,78.449997,78.449997,66723400\n" + "2015-01-05,77.980003,79.250000,75.360001,77.739998,77.739998,120996500\n" + "2015-01-12,77.839996,78.080002,73.540001,75.180000,75.180000,126213900\n" + "2015-01-19,75.720001,78.190002,74.820000,77.830002,77.830002,83690100\n" + "2015-01-26,77.980003,78.470001,74.209999,75.910004,75.910004,196620200\n" + "2015-02-02,76.110001,76.349998,73.750000,74.470001,74.470001,125159500\n" + "2015-02-09,74.050003,76.870003,73.449997,75.739998,75.739998,88739900\n" + "2015-02-16,75.300003,80.339996,75.080002,79.900002,79.900002,130371900\n" + "2015-02-23,79.959999,81.370003,78.099998,78.970001,78.970001,130449000\n" + "2015-03-02,79.000000,81.989998,78.519997,80.010002,80.010002,120626300\n" + "2015-03-09,79.680000,79.910004,77.260002,78.050003,78.050003,96623700\n" + "2015-03-16,77.959999,84.599998,77.360001,83.800003,83.800003,164584900\n" + "2015-03-23,83.919998,86.070000,82.139999,83.300003,83.300003,148126900\n" + "2015-03-30,83.809998,84.339996,80.870003,81.559998,81.559998,85910200\n" + "2015-04-06,80.800003,83.419998,80.800003,82.040001,82.040001,83953600\n" + "2015-04-13,81.930000,83.940002,80.370003,80.779999,80.779999,106702600\n" + "2015-04-20,81.540001,85.589996,81.239998,81.529999,81.529999,204786400\n" + "2015-04-27,81.870003,82.930000,78.110001,78.989998,78.989998,128787000\n" + "2015-05-04,79.330002,79.690002,77.050003,78.510002,78.510002,105359300\n" + "2015-05-11,78.480003,81.849998,76.790001,80.419998,80.419998,138179600\n" + "2015-05-18,80.330002,81.690002,79.459999,80.540001,80.540001,95060100\n" + "2015-05-25,80.430000,81.070000,78.879997,79.190002,79.190002,58548100\n" + "2015-06-01,79.300003,82.949997,78.660004,82.139999,82.139999,105794700\n" + "2015-06-08,81.820000,82.900002,79.320000,81.529999,81.529999,84975000\n" + "2015-06-15,80.550003,83.190002,80.070000,82.510002,82.510002,100984900\n" + "2015-06-22,83.410004,89.400002,83.309998,88.010002,88.010002,186937800\n" + "2015-06-29,86.610001,87.949997,85.570000,87.290001,87.290001,101359900\n" + "2015-07-06,86.489998,88.220001,85.230003,87.949997,87.949997,128648400\n" + "2015-07-13,88.660004,95.389999,88.419998,94.970001,94.970001,163296800\n" + "2015-07-20,95.849998,99.239998,94.809998,96.949997,96.949997,185477000\n" + "2015-07-27,96.580002,97.279999,91.800003,94.010002,94.010002,271190000\n" + "2015-08-03,93.529999,98.739998,92.800003,94.300003,94.300003,144762700\n" + "2015-08-10,95.680000,95.900002,91.190002,94.419998,94.419998,103377900\n" + "2015-08-17,94.419998,96.099998,85.610001,86.059998,86.059998,171220500\n" + "2015-08-24,77.029999,91.480003,72.000000,91.010002,91.010002,256503500\n" + "2015-08-31,90.599998,91.050003,86.500000,88.260002,88.260002,149671500\n" + "2015-09-07,89.690002,92.080002,88.830002,92.050003,92.050003,107073900\n" + "2015-09-14,92.309998,95.510002,91.599998,94.400002,94.400002,144827900\n" + "2015-09-21,94.620003,96.489998,91.919998,92.769997,92.769997,145447900\n" + "2015-09-28,92.080002,92.290001,85.720001,92.070000,92.070000,186677400\n" + "2015-10-05,92.940002,94.269997,90.470001,93.239998,93.239998,120898000\n" + "2015-10-12,93.320000,97.589996,92.669998,97.540001,97.540001,110153700\n" + "2015-10-19,97.180000,102.849998,96.470001,102.190002,102.190002,145550000\n" + "2015-10-26,102.199997,105.120003,101.550003,101.970001,101.970001,127425200\n" + "2015-11-02,101.720001,110.650002,101.180000,107.099998,107.099998,182169800\n" + "2015-11-09,107.000000,109.870003,103.830002,103.949997,103.949997,127675400\n" + "2015-11-16,103.320000,107.879997,100.470001,107.320000,107.320000,147603100\n" + "2015-11-23,107.190002,107.470001,104.389999,105.449997,105.449997,64538400\n" + "2015-11-30,105.839996,107.919998,103.349998,106.180000,106.180000,112055400\n" + "2015-12-07,106.480003,106.910004,101.910004,102.120003,102.120003,103236200\n" + "2015-12-14,102.290001,107.750000,101.459999,104.040001,104.040001,126762800\n" + "2015-12-21,104.910004,106.110001,103.599998,105.019997,105.019997,56671200\n" + "2015-12-28,105.019997,107.739998,104.529999,104.660004,104.660004,61717200\n" + "2016-01-04,101.949997,103.769997,97.029999,97.330002,97.330002,166842000\n" + "2016-01-11,97.910004,100.580002,92.449997,94.970001,94.970001,186470500\n" + "2016-01-18,96.529999,98.070000,89.370003,97.940002,97.940002,151064000\n" + "2016-01-25,98.720001,112.839996,94.230003,112.209999,112.209999,288033600\n" + "2016-02-01,112.269997,117.589996,103.180000,104.070000,104.070000,278373800\n" + "2016-02-08,100.410004,105.110001,96.820000,102.010002,102.010002,258836600\n" + "2016-02-15,103.800003,106.000000,100.239998,104.570000,104.570000,151758600\n" + "2016-02-22,105.489998,109.449997,102.739998,107.919998,107.919998,151923800\n" + "2016-02-29,107.599998,110.550003,106.750000,108.389999,108.389999,131538900\n" + "2016-03-07,108.070000,109.419998,104.400002,109.410004,109.410004,123025000\n" + "2016-03-14,109.279999,112.690002,108.769997,111.449997,111.449997,120110800\n" + "2016-03-21,111.660004,113.190002,111.029999,113.050003,113.050003,73850200\n" + "2016-03-28,113.320000,116.989998,112.949997,116.059998,116.059998,130320800\n" + "2016-04-04,114.070000,114.889999,109.900002,110.629997,110.629997,161185000\n" + "2016-04-11,110.699997,112.650002,106.519997,109.639999,109.639999,203519300\n" + "2016-04-18,109.739998,114.040001,109.010002,110.559998,110.559998,131664500\n" + "2016-04-25,109.870003,120.790001,106.309998,117.580002,117.580002,220003200\n" + "2016-05-02,117.830002,119.639999,116.570000,119.489998,119.489998,124045200\n" + "2016-05-09,119.540001,121.080002,118.900002,119.809998,119.809998,106140000\n" + "2016-05-16,119.379997,119.610001,115.879997,117.349998,117.349998,113707600\n" + "2016-05-23,117.419998,119.849998,115.940002,119.379997,119.379997,92255900\n" + "2016-05-30,119.459999,120.099998,117.820000,118.470001,118.470001,65902100\n" + "2016-06-06,118.620003,119.430000,116.260002,116.620003,116.620003,76723300\n" + "2016-06-13,115.000000,115.480003,112.559998,113.019997,113.019997,113036700\n" + "2016-06-20,113.769997,115.209999,111.000000,112.080002,112.080002,111618000\n" + "2016-06-27,111.570000,115.180000,108.230003,114.190002,114.190002,122085200\n" + "2016-07-04,113.940002,117.500000,112.970001,117.239998,117.239998,73287800\n" + "2016-07-11,117.709999,118.720001,116.580002,116.860001,116.860001,80362700\n" + "2016-07-18,117.320000,122.199997,116.889999,121.000000,121.000000,98680300\n" + "2016-07-25,121.389999,128.330002,117.779999,123.940002,123.940002,196787900\n" + "2016-08-01,123.849998,125.839996,122.070000,125.150002,125.150002,108722600\n" + "2016-08-08,125.250000,126.089996,124.180000,124.879997,124.879997,69341500\n" + "2016-08-15,124.910004,124.919998,122.779999,123.559998,123.559998,71400800\n" + "2016-08-22,123.330002,125.190002,123.089996,124.959999,124.959999,68175200\n" + "2016-08-29,124.349998,126.860001,124.349998,126.510002,126.510002,73475400\n" + "2016-09-05,126.669998,131.979996,126.470001,127.099998,127.099998,96923100\n" + "2016-09-12,125.959999,129.179993,125.750000,129.070007,129.070007,94156500\n" + "2016-09-19,129.910004,130.729996,127.300003,127.959999,127.959999,83936500\n" + "2016-09-26,127.370003,129.470001,126.800003,128.270004,128.270004,75684700\n" + "2016-10-03,128.380005,129.279999,127.550003,128.990005,128.990005,64338300\n" + "2016-10-10,129.679993,130.699997,126.750000,127.879997,127.879997,74196900\n" + "2016-10-17,128.199997,132.130005,127.320000,132.070007,132.070007,73817500\n" + "2016-10-24,132.720001,133.500000,129.270004,131.289993,131.289993,85178600\n" + "2016-10-31,132.009995,132.119995,119.250000,120.750000,120.750000,171699500\n" + "2016-11-07,122.830002,124.610001,115.269997,119.019997,119.019997,174979500\n" + "2016-11-14,119.129997,119.129997,113.550003,117.019997,117.019997,159751300\n" + "2016-11-21,118.199997,122.980003,117.800003,120.379997,120.379997,85755600\n" + "2016-11-28,120.120003,122.099998,114.000000,115.400002,115.400002,135528600\n" + "2016-12-05,115.949997,119.940002,115.070000,119.680000,119.680000,101153900\n" + "2016-12-12,119.220001,122.500000,117.610001,119.870003,119.870003,118800800\n" + "2016-12-19,119.849998,120.360001,116.300003,117.269997,117.269997,67506000\n" + "2016-12-26,116.959999,118.680000,114.769997,115.050003,115.050003,52744400\n" + "2017-01-02,116.029999,123.879997,115.510002,123.410004,123.410004,88332300\n" + "2017-01-09,123.550003,129.270004,123.040001,128.339996,128.339996,101988300\n" + "2017-01-16,128.039993,128.479996,126.779999,127.040001,127.040001,59628200\n" + "2017-01-23,127.309998,133.139999,126.949997,132.179993,132.179993,90001600\n" + "2017-01-30,131.580002,135.490005,129.520004,130.979996,130.979996,168057700\n" + "2017-02-06,130.979996,134.940002,130.300003,134.190002,134.190002,85549000\n" + "2017-02-13,134.699997,134.699997,132.550003,133.529999,133.529999,66200400\n" + "2017-02-20,133.500000,136.789993,132.899994,135.440002,135.440002,73120200\n" + "2017-02-27,135.259995,137.820007,134.750000,137.169998,137.169998,70100900\n" + "2017-03-06,136.880005,139.490005,136.509995,138.789993,138.789993,68309200\n" + "2017-03-13,138.710007,140.339996,138.490005,139.839996,139.839996,77450000\n" + "2017-03-20,139.710007,142.309998,137.600006,140.339996,140.339996,88737200\n" + "2017-03-27,139.050003,142.949997,138.770004,142.050003,142.050003,67889800\n" + "2017-04-03,141.929993,143.440002,140.240005,140.779999,140.779999,70592400\n" + "2017-04-10,141.000000,141.429993,138.809998,139.389999,139.389999,48255600\n" + "2017-04-17,139.759995,144.250000,139.750000,143.679993,143.679993,70241300\n" + "2017-04-24,144.960007,151.529999,144.339996,150.250000,150.250000,86497000\n" + "2017-05-01,151.740005,153.600006,148.720001,150.240005,150.240005,130245200\n" + "2017-05-08,150.710007,152.589996,148.860001,150.330002,150.330002,66802200\n" + "2017-05-15,150.169998,151.479996,144.419998,148.059998,148.059998,97135100\n" + "2017-05-22,148.080002,152.589996,147.250000,152.130005,152.130005,78129100\n" + "2017-05-29,151.970001,153.630005,150.300003,153.610001,153.610001,62634900\n" + "2017-06-05,153.639999,155.589996,146.610001,149.600006,149.600006,91421300\n" + "2017-06-12,148.169998,152.399994,144.559998,150.639999,150.639999,116339000\n" + "2017-06-19,151.710007,155.199997,151.710007,155.070007,155.070007,79842700\n" + "2017-06-26,156.250000,156.500000,148.919998,150.979996,150.979996,92968600\n" + "2017-07-03,151.720001,152.149994,147.800003,151.440002,151.440002,56679800\n" + "2017-07-10,151.690002,160.320007,151.509995,159.970001,159.970001,80086200\n" + "2017-07-17,160.250000,165.699997,158.809998,164.429993,164.429993,96122400\n" + "2017-07-24,164.639999,175.490005,163.860001,172.449997,172.449997,161455400\n" + "2017-07-31,172.000000,172.720001,166.910004,169.619995,169.619995,78869200\n" + "2017-08-07,169.949997,173.050003,166.850006,168.080002,168.080002,72620200\n" + "2017-08-14,170.089996,171.500000,166.210007,167.410004,167.410004,69772900\n" + "2017-08-21,167.160004,169.869995,165.820007,166.320007,166.320007,59799900\n" + "2017-08-28,166.910004,172.919998,165.000000,172.020004,172.020004,59717100\n" + "2017-09-04,171.270004,173.490005,169.550003,170.949997,170.949997,56165200\n" + "2017-09-11,172.399994,174.000000,170.259995,171.639999,171.639999,63953800\n" + "2017-09-18,171.990005,173.050003,169.220001,170.539993,170.539993,61645200\n" + "2017-09-25,169.240005,171.660004,161.559998,170.869995,170.869995,111376500\n" + "2017-10-02,171.389999,172.369995,168.289993,172.229996,172.229996,60993900";
String[] dataLine = rawData_1_week.split("\n");
List<Bar> bars = new ArrayList<>();
for (int i = 0; i < dataLine.length; i++) {
String[] barData = dataLine[i].split(",");
ZonedDateTime date = LocalDate.parse(barData[0], DateTimeFormatter.ofPattern("yyyy-MM-dd")).atStartOfDay(ZoneId.systemDefault());
double open = Double.parseDouble(barData[1]);
double high = Double.parseDouble(barData[2]);
double low = Double.parseDouble(barData[3]);
double close = Double.parseDouble(barData[4]);
double volume = Double.parseDouble(barData[6]);
bars.add(new BaseBar(date, open, high, low, close, volume));
}
series_1_weeks = new BaseTimeSeries("FB_daily", bars);
}
use of org.ta4j.core.BaseTimeSeries in project ta4j by ta4j.
the class CsvBarsLoader method loadAppleIncSeries.
/**
* @return a time series from Apple Inc. bars.
*/
public static TimeSeries loadAppleIncSeries() {
InputStream stream = CsvBarsLoader.class.getClassLoader().getResourceAsStream("appleinc_bars_from_20130101_usd.csv");
List<Bar> bars = new ArrayList<>();
CSVReader csvReader = new CSVReader(new InputStreamReader(stream, Charset.forName("UTF-8")), ',', '"', 1);
try {
String[] line;
while ((line = csvReader.readNext()) != null) {
ZonedDateTime date = LocalDate.parse(line[0], DATE_FORMAT).atStartOfDay(ZoneId.systemDefault());
double open = Double.parseDouble(line[1]);
double high = Double.parseDouble(line[2]);
double low = Double.parseDouble(line[3]);
double close = Double.parseDouble(line[4]);
double volume = Double.parseDouble(line[5]);
bars.add(new BaseBar(date, open, high, low, close, volume));
}
} catch (IOException ioe) {
Logger.getLogger(CsvBarsLoader.class.getName()).log(Level.SEVERE, "Unable to load bars from CSV", ioe);
} catch (NumberFormatException nfe) {
Logger.getLogger(CsvBarsLoader.class.getName()).log(Level.SEVERE, "Error while parsing value", nfe);
}
return new BaseTimeSeries("apple_bars", bars);
}
use of org.ta4j.core.BaseTimeSeries in project ta4j by ta4j.
the class CsvTradesLoader method loadBitstampSeries.
/**
* @return a time series from Bitstamp (bitcoin exchange) trades
*/
public static TimeSeries loadBitstampSeries() {
// Reading all lines of the CSV file
InputStream stream = CsvTradesLoader.class.getClassLoader().getResourceAsStream("bitstamp_trades_from_20131125_usd.csv");
CSVReader csvReader = null;
List<String[]> lines = null;
try {
csvReader = new CSVReader(new InputStreamReader(stream, Charset.forName("UTF-8")), ',');
lines = csvReader.readAll();
// Removing header line
lines.remove(0);
} catch (IOException ioe) {
Logger.getLogger(CsvTradesLoader.class.getName()).log(Level.SEVERE, "Unable to load trades from CSV", ioe);
} finally {
if (csvReader != null) {
try {
csvReader.close();
} catch (IOException ioe) {
ioe.printStackTrace();
}
}
}
List<Bar> bars = null;
if ((lines != null) && !lines.isEmpty()) {
// Getting the first and last trades timestamps
ZonedDateTime beginTime = ZonedDateTime.ofInstant(Instant.ofEpochMilli(Long.parseLong(lines.get(0)[0]) * 1000), ZoneId.systemDefault());
ZonedDateTime endTime = ZonedDateTime.ofInstant(Instant.ofEpochMilli(Long.parseLong(lines.get(lines.size() - 1)[0]) * 1000), ZoneId.systemDefault());
if (beginTime.isAfter(endTime)) {
Instant beginInstant = beginTime.toInstant();
Instant endInstant = endTime.toInstant();
beginTime = ZonedDateTime.ofInstant(endInstant, ZoneId.systemDefault());
endTime = ZonedDateTime.ofInstant(beginInstant, ZoneId.systemDefault());
// Since the CSV file has the most recent trades at the top of the file, we'll reverse the list to feed the List<Bar> correctly.
Collections.reverse(lines);
}
// build the list of populated bars
bars = buildBars(beginTime, endTime, 300, lines);
}
return new BaseTimeSeries("bitstamp_trades", bars);
}
Aggregations