Search in sources :

Example 11 with BaseTimeSeries

use of org.ta4j.core.BaseTimeSeries in project ta4j by ta4j.

the class ChandelierExitLongIndicatorTest method setUp.

@Before
public void setUp() {
    List<Bar> bars = new ArrayList<Bar>();
    // open, close, high, low
    bars.add(new MockBar(44.98, 45.05, 45.17, 44.96));
    bars.add(new MockBar(45.05, 45.10, 45.15, 44.99));
    bars.add(new MockBar(45.11, 45.19, 45.32, 45.11));
    bars.add(new MockBar(45.19, 45.14, 45.25, 45.04));
    bars.add(new MockBar(45.12, 45.15, 45.20, 45.10));
    bars.add(new MockBar(45.15, 45.14, 45.20, 45.10));
    bars.add(new MockBar(45.13, 45.10, 45.16, 45.07));
    bars.add(new MockBar(45.12, 45.15, 45.22, 45.10));
    bars.add(new MockBar(45.15, 45.22, 45.27, 45.14));
    bars.add(new MockBar(45.24, 45.43, 45.45, 45.20));
    bars.add(new MockBar(45.43, 45.44, 45.50, 45.39));
    bars.add(new MockBar(45.43, 45.55, 45.60, 45.35));
    bars.add(new MockBar(45.58, 45.55, 45.61, 45.39));
    bars.add(new MockBar(45.45, 45.01, 45.55, 44.80));
    bars.add(new MockBar(45.03, 44.23, 45.04, 44.17));
    data = new BaseTimeSeries(bars);
}
Also used : MockBar(org.ta4j.core.mocks.MockBar) Bar(org.ta4j.core.Bar) MockBar(org.ta4j.core.mocks.MockBar) BaseTimeSeries(org.ta4j.core.BaseTimeSeries) ArrayList(java.util.ArrayList) Before(org.junit.Before)

Example 12 with BaseTimeSeries

use of org.ta4j.core.BaseTimeSeries in project ta4j by ta4j.

the class ChandelierExitShortIndicatorTest method setUp.

@Before
public void setUp() {
    List<Bar> bars = new ArrayList<Bar>();
    // open, close, high, low
    bars.add(new MockBar(44.98, 45.05, 45.17, 44.96));
    bars.add(new MockBar(45.05, 45.10, 45.15, 44.99));
    bars.add(new MockBar(45.11, 45.19, 45.32, 45.11));
    bars.add(new MockBar(45.19, 45.14, 45.25, 45.04));
    bars.add(new MockBar(45.12, 45.15, 45.20, 45.10));
    bars.add(new MockBar(45.15, 45.14, 45.20, 45.10));
    bars.add(new MockBar(45.13, 45.10, 45.16, 45.07));
    bars.add(new MockBar(45.12, 45.15, 45.22, 45.10));
    bars.add(new MockBar(45.15, 45.22, 45.27, 45.14));
    bars.add(new MockBar(45.24, 45.43, 45.45, 45.20));
    bars.add(new MockBar(45.43, 45.44, 45.50, 45.39));
    bars.add(new MockBar(45.43, 45.55, 45.60, 45.35));
    bars.add(new MockBar(45.58, 45.55, 45.61, 45.39));
    bars.add(new MockBar(45.45, 45.01, 45.55, 44.80));
    bars.add(new MockBar(45.03, 44.23, 45.04, 44.17));
    data = new BaseTimeSeries(bars);
}
Also used : MockBar(org.ta4j.core.mocks.MockBar) Bar(org.ta4j.core.Bar) MockBar(org.ta4j.core.mocks.MockBar) BaseTimeSeries(org.ta4j.core.BaseTimeSeries) ArrayList(java.util.ArrayList) Before(org.junit.Before)

Example 13 with BaseTimeSeries

use of org.ta4j.core.BaseTimeSeries in project ta4j by ta4j.

the class MassIndexIndicatorTest method setUp.

@Before
public void setUp() {
    List<Bar> bars = new ArrayList<Bar>();
    // open, close, high, low
    bars.add(new MockBar(44.98, 45.05, 45.17, 44.96));
    bars.add(new MockBar(45.05, 45.10, 45.15, 44.99));
    bars.add(new MockBar(45.11, 45.19, 45.32, 45.11));
    bars.add(new MockBar(45.19, 45.14, 45.25, 45.04));
    bars.add(new MockBar(45.12, 45.15, 45.20, 45.10));
    bars.add(new MockBar(45.15, 45.14, 45.20, 45.10));
    bars.add(new MockBar(45.13, 45.10, 45.16, 45.07));
    bars.add(new MockBar(45.12, 45.15, 45.22, 45.10));
    bars.add(new MockBar(45.15, 45.22, 45.27, 45.14));
    bars.add(new MockBar(45.24, 45.43, 45.45, 45.20));
    bars.add(new MockBar(45.43, 45.44, 45.50, 45.39));
    bars.add(new MockBar(45.43, 45.55, 45.60, 45.35));
    bars.add(new MockBar(45.58, 45.55, 45.61, 45.39));
    bars.add(new MockBar(45.45, 45.01, 45.55, 44.80));
    bars.add(new MockBar(45.03, 44.23, 45.04, 44.17));
    bars.add(new MockBar(44.23, 43.95, 44.29, 43.81));
    bars.add(new MockBar(43.91, 43.08, 43.99, 43.08));
    bars.add(new MockBar(43.07, 43.55, 43.65, 43.06));
    bars.add(new MockBar(43.56, 43.95, 43.99, 43.53));
    bars.add(new MockBar(43.93, 44.47, 44.58, 43.93));
    data = new BaseTimeSeries(bars);
}
Also used : MockBar(org.ta4j.core.mocks.MockBar) Bar(org.ta4j.core.Bar) MockBar(org.ta4j.core.mocks.MockBar) BaseTimeSeries(org.ta4j.core.BaseTimeSeries) ArrayList(java.util.ArrayList) Before(org.junit.Before)

Example 14 with BaseTimeSeries

use of org.ta4j.core.BaseTimeSeries in project ta4j by ta4j.

the class PivotPointIndicatorTest method initDataForDailyTimeFrame.

@Before
public void initDataForDailyTimeFrame() {
    String rawData_5_minutes = "2017-09-27,22:00:00,167.86,167.949,167.63,167.68,1746768,0\n" + "2017-09-28,15:35:00,167.94,168.37,167.6,168.24,706119,0\n" + "2017-09-28,15:40:00,168.27,168.399,167.16,167.34,501414,0\n" + "2017-09-28,15:45:00,167.39,168.31,167.39,168.29,332450,0\n" + "2017-09-28,15:50:00,168.2601,168.31,167.76,167.84,253173,0\n" + "2017-09-28,15:55:00,167.83,168.02,167.76,167.9,169481,0\n" + "2017-09-28,16:00:00,167.89,168.25,167.64,168.11,299024,0\n" + "2017-09-28,16:05:00,168.09,168.59,168.09,168.49,260943,0\n" + "2017-09-28,16:10:00,168.46,168.77,168.33,168.675,225866,0\n" + "2017-09-28,16:15:00,168.66,168.66,168.38,168.43,196108,0\n" + "2017-09-28,16:20:00,168.403,168.47,168.09,168.16,152852,0\n" + "2017-09-28,16:25:00,168.16,168.28,168.06,168.1,102641,0\n" + "2017-09-28,16:30:00,168.08,168.72,168.0621,168.6943,224124,0\n" + "2017-09-28,16:35:00,168.66,168.74,168.521,168.5726,159756,0\n" + "2017-09-28,16:40:00,168.56,168.7,168.4502,168.62,120405,0\n" + "2017-09-28,16:45:00,168.6,169.06,168.59,169.02,260050,0\n" + "2017-09-28,16:50:00,169.01,169.0696,168.69,168.8513,189081,0\n" + "2017-09-28,16:55:00,168.82,168.93,168.71,168.9,127425,0\n" + "2017-09-28,17:00:00,168.88,168.9116,168.6,168.6196,127020,0\n" + "2017-09-28,17:05:00,168.6173,168.69,168.48,168.6336,145866,0\n" + "2017-09-28,17:10:00,168.62,168.8,168.59,168.74,132152,0\n" + "2017-09-28,17:15:00,168.76,168.87,168.56,168.57,91621,0\n" + "2017-09-28,17:20:00,168.56,168.71,168.48,168.6901,101503,0\n" + "2017-09-28,17:25:00,168.69,168.74,168.57,168.6212,62758,0\n" + "2017-09-28,17:30:00,168.63,168.7,168.42,168.7,108778,0\n" + "2017-09-28,17:35:00,168.68,168.72,168.46,168.63,106170,0\n" + "2017-09-28,17:40:00,168.62,168.79,168.56,168.64,50262,0\n" + "2017-09-28,17:45:00,168.631,168.71,168.42,168.45,79449,0\n" + "2017-09-28,17:50:00,168.448,168.5,168.27,168.38,196568,0\n" + "2017-09-28,17:55:00,168.36,168.39,168.16,168.212,83478,0\n" + "2017-09-28,18:00:00,168.21,168.25,167.99,168.16,170722,0\n" + "2017-09-28,18:05:00,168.17,168.29,168.01,168.2149,109073,0\n" + "2017-09-28,18:10:00,168.23,168.31,168.1451,168.1668,65361,0\n" + "2017-09-28,18:15:00,168.2,168.27,168.03,168.07,56249,0\n" + "2017-09-28,18:20:00,168.075,168.27,168.075,168.25,95105,0\n" + "2017-09-28,18:25:00,168.2553,168.28,168.17,168.23,41837,0\n" + "2017-09-28,18:30:00,168.23,168.2532,168.02,168.1,54516,0\n" + "2017-09-28,18:35:00,168.11,168.19,168.1,168.17,77834,0\n" + "2017-09-28,18:40:00,168.17,168.1931,168.06,168.06,122010,0\n" + "2017-09-28,18:45:00,168.08,168.08,167.79,167.84,170118,0\n" + "2017-09-28,18:50:00,167.85,168,167.85,167.9814,61922,0\n" + "2017-09-28,18:55:00,168,168.09,167.88,168.09,57266,0\n" + "2017-09-28,19:00:00,168.09,168.19,168.09,168.1,58543,0\n" + "2017-09-28,19:05:00,168.1167,168.19,167.26,167.77,294259,0\n" + "2017-09-28,19:10:00,167.77,167.93,167.63,167.92,134389,0\n" + "2017-09-28,19:15:00,167.925,167.98,167.79,167.97,65208,0\n" + "2017-09-28,19:20:00,167.9602,168.12,167.92,168.008,97565,0\n" + "2017-09-28,19:25:00,168.01,168.29,167.99,168.22,99282,0\n" + "2017-09-28,19:30:00,168.2301,168.28,168.1403,168.24,68625,0\n" + "2017-09-28,19:35:00,168.25,168.28,168.15,168.27,41514,0\n" + "2017-09-28,19:40:00,168.28,168.4526,168.28,168.41,68396,0\n" + "2017-09-28,19:45:00,168.4126,168.49,168.37,168.42,49819,0\n" + "2017-09-28,19:50:00,168.42,168.46,168.3467,168.44,55438,0\n" + "2017-09-28,19:55:00,168.4358,168.55,168.43,168.54,76526,0\n" + "2017-09-28,20:00:00,168.56,168.69,168.53,168.58,87910,0\n" + "2017-09-28,20:05:00,168.58,168.665,168.53,168.6,70156,0\n" + "2017-09-28,20:10:00,168.6,168.6,168.44,168.52,61114,0\n" + "2017-09-28,20:15:00,168.51,168.51,168.365,168.43,58286,0\n" + "2017-09-28,20:20:00,168.3968,168.505,168.34,168.34,53982,0\n" + "2017-09-28,20:25:00,168.35,168.359,168.13,168.13,93947,0\n" + "2017-09-28,20:30:00,168.14,168.3,168.12,168.279,65449,0\n" + "2017-09-28,20:35:00,168.27,168.38,168.185,168.335,49059,0\n" + "2017-09-28,20:40:00,168.33,168.355,168.21,168.24,56022,0\n" + "2017-09-28,20:45:00,168.26,168.37,168.21,168.3632,36538,0\n" + "2017-09-28,20:50:00,168.37,168.42,168.2578,168.2699,58880,0\n" + "2017-09-28,20:55:00,168.29,168.38,168.26,168.37,39166,0\n" + "2017-09-28,21:00:00,168.37,168.55,168.37,168.44,71989,0\n" + "2017-09-28,21:05:00,168.45,168.56,168.39,168.4468,79944,0\n" + "2017-09-28,21:10:00,168.46,168.469,168.291,168.37,57256,0\n" + "2017-09-28,21:15:00,168.3497,168.49,168.33,168.4064,38794,0\n" + "2017-09-28,21:20:00,168.41,168.49,168.4,168.42,31063,0\n" + "2017-09-28,21:25:00,168.436,168.44,168.3,168.34,55086,0\n" + "2017-09-28,21:30:00,168.344,168.36,168.22,168.28,61384,0\n" + "2017-09-28,21:35:00,168.28,168.304,168.14,168.28,108728,0\n" + "2017-09-28,21:40:00,168.28,168.33,168.17,168.25,71156,0\n" + "2017-09-28,21:45:00,168.24,168.3336,168.2,168.29,112327,0\n" + "2017-09-28,21:50:00,168.3,168.33,168,168.2589,159273,0\n" + "2017-09-28,21:55:00,168.24,168.65,168.24,168.635,231928,0\n" + "2017-09-28,22:00:00,168.63,168.82,168.581,168.73,877554,0\n" + "2017-09-29,15:35:00,168.83,169.6,168.81,169.53,623389,0\n" + "2017-09-29,15:40:00,169.51,169.88,169.51,169.75,402657,0\n" + "2017-09-29,15:45:00,169.7999,169.7999,169.43,169.705,318978,0\n" + "2017-09-29,15:50:00,169.734,169.84,169.31,169.795,249071,0\n" + "2017-09-29,15:55:00,169.82,169.89,169.52,169.7,235315,0\n" + "2017-09-29,16:00:00,169.71,169.77,169.4099,169.5,281170,0\n" + "2017-09-29,16:05:00,169.56,169.83,169.38,169.8,326879,0\n" + "2017-09-29,16:10:00,169.79,170.24,169.65,170.2068,413516,0\n" + "2017-09-29,16:15:00,170.23,170.26,169.96,170.16,185665,0\n" + "2017-09-29,16:20:00,170.17,170.23,170.01,170.03,130839,0\n" + "2017-09-29,16:25:00,170.01,170.27,170.01,170.1625,122554,0\n" + "2017-09-29,16:30:00,170.1584,170.87,170.1584,170.58,401063,0\n" + "2017-09-29,16:35:00,170.58,170.83,170.52,170.6,180214,0\n" + "2017-09-29,16:40:00,170.59,170.843,170.56,170.843,136558,0\n" + "2017-09-29,16:45:00,170.85,170.88,170.621,170.71,143770,0\n" + "2017-09-29,16:50:00,170.73,170.74,170.5073,170.5284,117942,0\n" + "2017-09-29,16:55:00,170.53,170.55,170.46,170.481,125567,0\n" + "2017-09-29,17:00:00,170.48,170.74,170.47,170.68,161514,0\n" + "2017-09-29,17:05:00,170.6764,170.7303,170.56,170.56,101555,0\n" + "2017-09-29,17:10:00,170.5668,170.74,170.56,170.5738,88593,0\n" + "2017-09-29,17:15:00,170.57,170.65,170.44,170.448,103141,0\n" + "2017-09-29,17:20:00,170.445,170.86,170.41,170.7852,197559,0\n" + "2017-09-29,17:25:00,170.79,170.96,170.76,170.81,170037,0\n" + "2017-09-29,17:30:00,170.83,170.8404,170.67,170.72,156036,0\n" + "2017-09-29,17:35:00,170.71,170.87,170.67,170.81,108098,0\n" + "2017-09-29,17:40:00,170.81,170.8786,170.6048,170.6288,182604,0\n" + "2017-09-29,17:45:00,170.63,170.64,170.4363,170.4363,101391,0\n" + "2017-09-29,17:50:00,170.4393,170.4757,170.34,170.43,114050,0\n" + "2017-09-29,17:55:00,170.44,170.63,170.44,170.59,93861,0\n" + "2017-09-29,18:00:00,170.59,170.639,170.53,170.58,95934,0\n" + "2017-09-29,18:05:00,170.585,170.69,170.5,170.54,76956,0\n" + "2017-09-29,18:10:00,170.53,170.61,170.5,170.579,63106,0\n" + "2017-09-29,18:15:00,170.55,170.58,170.505,170.54,70915,0\n" + "2017-09-29,18:20:00,170.55,170.7,170.545,170.595,69296,0\n" + "2017-09-29,18:25:00,170.5972,170.66,170.55,170.61,51545,0\n" + "2017-09-29,18:30:00,170.6,170.82,170.58,170.795,80687,0\n" + "2017-09-29,18:35:00,170.7944,170.856,170.79,170.84,91664,0\n" + "2017-09-29,18:40:00,170.8398,170.85,170.74,170.77,76334,0\n" + "2017-09-29,18:45:00,170.7701,171.11,170.74,171.025,378515,0\n" + "2017-09-29,18:50:00,171.021,171.22,171.01,171.1808,222109,0\n" + "2017-09-29,18:55:00,171.195,171.38,171.14,171.37,156630,0\n" + "2017-09-29,19:00:00,171.35,171.39,171.2401,171.35,152538,0\n" + "2017-09-29,19:05:00,171.3468,171.59,171.3468,171.58,166360,0\n" + "2017-09-29,19:10:00,171.5784,171.65,171.5,171.58,116604,0\n" + "2017-09-29,19:15:00,171.58,171.66,171.45,171.55,123553,0\n" + "2017-09-29,19:20:00,171.54,171.55,171.39,171.41,109259,0\n" + "2017-09-29,19:25:00,171.4142,171.5,171.33,171.38,83691,0\n" + "2017-09-29,19:30:00,171.37,171.3901,171.22,171.25,95366,0\n" + "2017-09-29,19:35:00,171.24,171.28,171.22,171.231,100219,0\n" + "2017-09-29,19:40:00,171.23,171.4,171.2298,171.4,93148,0\n" + "2017-09-29,19:45:00,171.38,171.5,171.34,171.39,80264,0\n" + "2017-09-29,19:50:00,171.3942,171.41,171.21,171.22,52943,0\n" + "2017-09-29,19:55:00,171.2265,171.31,171.18,171.3022,75379,0\n" + "2017-09-29,20:00:00,171.31,171.31,171.11,171.2,65708,0\n" + "2017-09-29,20:05:00,171.2042,171.29,171.12,171.13,57920,0\n" + "2017-09-29,20:10:00,171.13,171.13,170.94,171.0021,112416,0\n" + "2017-09-29,20:15:00,171,171,170.88,170.9,46032,0\n" + "2017-09-29,20:20:00,170.8944,170.9604,170.86,170.89,72046,0\n" + "2017-09-29,20:25:00,170.88,170.9353,170.83,170.92,84673,0\n" + "2017-09-29,20:30:00,170.919,170.97,170.85,170.8601,55503,0\n" + "2017-09-29,20:35:00,170.85,170.89,170.7514,170.79,47372,0\n" + "2017-09-29,20:40:00,170.7858,170.7899,170.65,170.72,77312,0\n" + "2017-09-29,20:45:00,170.725,170.74,170.49,170.51,112914,0\n" + "2017-09-29,20:50:00,170.52,170.6,170.5,170.5384,94919,0\n" + "2017-09-29,20:55:00,170.5375,170.74,170.48,170.74,105034,0\n" + "2017-09-29,21:00:00,170.73,170.79,170.64,170.64,102575,0\n" + "2017-09-29,21:05:00,170.64,170.76,170.5901,170.75,64518,0\n" + "2017-09-29,21:10:00,170.74,170.75,170.6,170.6101,103496,0\n" + "2017-09-29,21:15:00,170.61,170.72,170.57,170.6101,167382,0\n" + "2017-09-29,21:20:00,170.6084,170.61,170.3,170.45,110465,0\n" + "2017-09-29,21:25:00,170.44,170.5836,170.4,170.57,146617,0\n" + "2017-09-29,21:30:00,170.58,170.72,170.56,170.56,94241,0\n" + "2017-09-29,21:35:00,170.56,170.56,170.38,170.3879,88600,0\n" + "2017-09-29,21:40:00,170.3807,170.48,170.37,170.42,119247,0\n" + "2017-09-29,21:45:00,170.4166,170.44,170.28,170.3332,140148,0\n" + "2017-09-29,21:50:00,170.32,170.57,170.31,170.41,210241,0\n" + "2017-09-29,21:55:00,170.42,170.97,170.42,170.88,470723,0\n" + "2017-09-29,22:00:00,170.89,170.96,170.75,170.81,529077,0\n" + "2017-10-02,15:35:00,171.39,171.74,171.07,171.55,588294,0\n" + "2017-10-02,15:40:00,171.56,171.87,171.2,171.44,359622,0\n" + "2017-10-02,15:45:00,171.43,171.43,171,171,389084,0\n" + "2017-10-02,15:50:00,171.02,171.0213,170.5,170.57,565126,0\n" + "2017-10-02,15:55:00,170.55,170.66,170.37,170.57,280042,0\n" + "2017-10-02,16:00:00,170.58,170.9,170.43,170.8,239524,0\n" + "2017-10-02,16:05:00,170.77,170.86,170.53,170.84,185532,0\n" + "2017-10-02,16:10:00,170.833,171.0629,170.51,170.6108,318287,0\n" + "2017-10-02,16:15:00,170.61,170.69,170.25,170.515,224911,0\n" + "2017-10-02,16:20:00,170.5146,170.89,170.5,170.63,127456,0\n" + "2017-10-02,16:25:00,170.64,170.77,170.47,170.74,119044,0\n" + "2017-10-02,16:30:00,170.76,170.88,170.67,170.71,88645,0\n" + "2017-10-02,16:35:00,170.7,171.05,170.6,171.05,129027,0\n" + "2017-10-02,16:40:00,171.03,171.03,170.7088,170.769,91230,0\n" + "2017-10-02,16:45:00,170.75,170.81,170.53,170.67,118312,0\n" + "2017-10-02,16:50:00,170.7,170.91,170.685,170.8892,67959,0\n" + "2017-10-02,16:55:00,170.92,170.92,170.62,170.78,57646,0\n" + "2017-10-02,17:00:00,170.8,170.88,170.685,170.73,45319,0\n" + "2017-10-02,17:05:00,170.73,170.79,170.5701,170.65,99757,0\n" + "2017-10-02,17:10:00,170.66,170.71,170.58,170.62,53827,0\n" + "2017-10-02,17:15:00,170.62,170.7305,170.54,170.6805,87297,0\n" + "2017-10-02,17:20:00,170.67,170.915,170.59,170.63,92718,0\n" + "2017-10-02,17:25:00,170.6184,170.69,170.57,170.65,56440,0\n" + "2017-10-02,17:30:00,170.6406,170.66,170.4684,170.55,126303,0\n" + "2017-10-02,17:35:00,170.559,170.559,170.11,170.1489,174048,0\n" + "2017-10-02,17:40:00,170.1445,170.15,169.89,170.0316,281141,0\n" + "2017-10-02,17:45:00,170.03,170.07,169.63,169.71,205253,0\n" + "2017-10-02,17:50:00,169.72,169.75,169.44,169.6407,163311,0\n" + "2017-10-02,17:55:00,169.645,169.834,169.47,169.83,170545,0\n" + "2017-10-02,18:00:00,169.85,169.88,169.1,169.1827,206384,0\n" + "2017-10-02,18:05:00,169.18,169.1827,168.75,169.08,274548,0\n" + "2017-10-02,18:10:00,169.08,169.3,169.02,169.24,142191,0\n" + "2017-10-02,18:15:00,169.2646,169.28,169.05,169.13,159430,0\n" + "2017-10-02,18:20:00,169.1184,169.39,169.06,169.39,112785,0\n" + "2017-10-02,18:25:00,169.3761,169.668,169.3584,169.57,139816,0\n" + "2017-10-02,18:30:00,169.58,169.7,169.53,169.57,75071,0\n" + "2017-10-02,18:35:00,169.56,169.66,169.4226,169.51,87149,0\n" + "2017-10-02,18:40:00,169.51,169.5689,169.44,169.44,81034,0\n" + "2017-10-02,18:45:00,169.4425,169.495,169.33,169.495,102046,0\n" + "2017-10-02,18:50:00,169.49,169.56,169.42,169.42,93721,0\n" + "2017-10-02,18:55:00,169.42,169.5,169.39,169.4276,62662,0\n" + "2017-10-02,19:00:00,169.4163,169.63,169.4163,169.59,62796,0\n" + "2017-10-02,19:05:00,169.59,169.77,169.47,169.7149,99259,0\n" + "2017-10-02,19:10:00,169.71,169.77,169.5946,169.6,58483,0\n" + "2017-10-02,19:15:00,169.61,169.75,169.5,169.72,56775,0\n" + "2017-10-02,19:20:00,169.73,169.85,169.6621,169.79,59568,0\n" + "2017-10-02,19:25:00,169.8,169.8856,169.71,169.8109,59454,0\n" + "2017-10-02,19:30:00,169.81,169.8294,169.7,169.78,60161,0\n" + "2017-10-02,19:35:00,169.78,169.83,169.6314,169.72,51695,0\n" + "2017-10-02,19:40:00,169.72,169.8,169.49,169.6394,92280,0\n" + "2017-10-02,19:45:00,169.65,169.65,169.47,169.5,84189,0\n" + "2017-10-02,19:50:00,169.511,169.6999,169.511,169.6404,52544,0\n" + "2017-10-02,19:55:00,169.65,169.68,169.62,169.67,45082,0\n" + "2017-10-02,20:00:00,169.6684,169.7,169.52,169.65,58666,0\n" + "2017-10-02,20:05:00,169.65,169.73,169.57,169.66,62389,0\n" + "2017-10-02,20:10:00,169.66,169.72,169.6,169.72,47445,0\n" + "2017-10-02,20:15:00,169.73,169.73,169.6,169.64,64938,0\n" + "2017-10-02,20:20:00,169.6453,169.65,169.53,169.62,58709,0\n" + "2017-10-02,20:25:00,169.61,169.71,169.55,169.65,62378,0\n" + "2017-10-02,20:30:00,169.6514,170.14,169.64,170.115,232773,0\n" + "2017-10-02,20:35:00,170.11,170.33,170.1,170.302,139619,0\n" + "2017-10-02,20:40:00,170.3,170.312,170.16,170.285,86557,0\n" + "2017-10-02,20:45:00,170.285,170.32,170.1,170.14,76256,0\n" + "2017-10-02,20:50:00,170.13,170.18,169.88,169.94,144037,0\n" + "2017-10-02,20:55:00,169.9406,170.02,169.88,169.9031,73110,0\n" + "2017-10-02,21:00:00,169.91,169.98,169.77,169.83,96418,0\n" + "2017-10-02,21:05:00,169.82,169.98,169.7,169.8002,130333,0\n" + "2017-10-02,21:10:00,169.8,169.82,169.65,169.7387,86945,0\n" + "2017-10-02,21:15:00,169.72,169.78,169.62,169.63,91854,0\n" + "2017-10-02,21:20:00,169.63,169.7,169.56,169.68,87127,0\n" + "2017-10-02,21:25:00,169.67,169.84,169.635,169.65,87038,0\n" + "2017-10-02,21:30:00,169.65,169.7553,169.65,169.65,74510,0\n" + "2017-10-02,21:35:00,169.64,169.745,169.5276,169.55,102864,0\n" + "2017-10-02,21:40:00,169.54,169.65,169.53,169.62,112944,0\n" + "2017-10-02,21:45:00,169.6102,169.63,169.38,169.4851,135767,0\n" + "2017-10-02,21:50:00,169.49,169.57,169.36,169.54,120950,0\n" + "2017-10-02,21:55:00,169.54,169.82,169.25,169.62,354984,0\n" + "2017-10-02,22:00:00,169.6207,169.67,169.35,169.47,1015547,0\n" + "2017-10-03,15:35:00,169.3,169.74,169.2,169.6352,406843,0\n" + "2017-10-03,15:40:00,169.62,170.44,169.51,170.3745,378048,0\n" + "2017-10-03,15:45:00,170.3805,170.47,170.01,170.02,254547,0\n" + "2017-10-03,15:50:00,170.058,170.72,170.02,170.64,250809,0\n" + "2017-10-03,15:55:00,170.65,170.66,170.332,170.44,158609,0\n" + "2017-10-03,16:00:00,170.43,170.73,170.425,170.59,136805,0\n" + "2017-10-03,16:05:00,170.59,170.7,170.33,170.555,97150,0\n" + "2017-10-03,16:10:00,170.56,170.585,170.1,170.285,139735,0\n" + "2017-10-03,16:15:00,170.29,170.35,169.65,169.67,216528,0\n" + "2017-10-03,16:20:00,169.69,169.95,169.44,169.9117,283003,0\n" + "2017-10-03,16:25:00,169.911,170.09,169.72,170,120083,0\n" + "2017-10-03,16:30:00,169.99,170.14,169.92,170.053,110589,0\n" + "2017-10-03,16:35:00,170.05,170.32,169.85,170.2,181088,0\n" + "2017-10-03,16:40:00,170.19,170.47,170.1445,170.47,118138,0\n" + "2017-10-03,16:45:00,170.47,170.49,170.18,170.183,55228,0\n" + "2017-10-03,16:50:00,170.18,170.34,170.11,170.24,64900,0\n" + "2017-10-03,16:55:00,170.25,170.39,170.11,170.21,72447,0\n" + "2017-10-03,17:00:00,170.2078,170.46,170.1684,170.3365,87446,0\n" + "2017-10-03,17:05:00,170.32,170.46,170.31,170.35,54672,0\n" + "2017-10-03,17:10:00,170.35,170.47,170.33,170.37,79862,0\n" + "2017-10-03,17:15:00,170.38,170.43,170.27,170.36,70582,0\n" + "2017-10-03,17:20:00,170.3601,170.47,170.342,170.47,48196,0\n" + "2017-10-03,17:25:00,170.47,170.578,170.4,170.47,54960,0\n" + "2017-10-03,17:30:00,170.47,170.48,170.1999,170.219,59327,0\n" + "2017-10-03,17:35:00,170.22,170.3624,170.18,170.29,52495,0\n" + "2017-10-03,17:40:00,170.28,170.289,170.1,170.175,58176,0\n" + "2017-10-03,17:45:00,170.16,170.22,170.0701,170.18,41250,0\n" + "2017-10-03,17:50:00,170.17,170.26,170.09,170.26,37439,0\n" + "2017-10-03,17:55:00,170.25,170.25,170.09,170.16,36528,0\n" + "2017-10-03,18:00:00,170.1559,170.1559,169.97,170.0568,57627,0\n" + "2017-10-03,18:05:00,170.06,170.14,170.02,170.06,33036,0\n" + "2017-10-03,18:10:00,170.051,170.09,169.95,170.08,42033,0\n" + "2017-10-03,18:15:00,170.09,170.2497,170.06,170.18,44289,0\n" + "2017-10-03,18:20:00,170.18,170.265,170.1,170.12,42199,0\n" + "2017-10-03,18:25:00,170.11,170.13,170,170.09,127542,0\n" + "2017-10-03,18:30:00,170.09,170.14,170.02,170.03,45278,0\n" + "2017-10-03,18:35:00,170.03,170.11,170,170.1016,77518,0\n" + "2017-10-03,18:40:00,170.1,170.13,170,170.0268,43636,0\n" + "2017-10-03,18:45:00,170.03,170.04,169.9,169.93,75863,0\n" + "2017-10-03,18:50:00,169.93,170.03,169.82,169.85,71378,0\n" + "2017-10-03,18:55:00,169.85,170,169.84,169.9252,51154,0\n" + "2017-10-03,19:00:00,169.93,169.98,169.9,169.98,21103,0\n" + "2017-10-03,19:05:00,169.9769,170.09,169.91,170.09,56346,0\n" + "2017-10-03,19:10:00,170.09,170.1,169.93,169.935,48134,0\n" + "2017-10-03,19:15:00,169.94,170.05,169.94,170.0301,24779,0\n" + "2017-10-03,19:20:00,170.0335,170.0335,169.8945,169.934,28837,0\n" + "2017-10-03,19:25:00,169.92,170.03,169.88,169.9234,55398,0\n" + "2017-10-03,19:30:00,169.91,170.02,169.9,169.94,56641,0\n" + "2017-10-03,19:35:00,169.9366,169.97,169.86,169.88,46685,0\n" + "2017-10-03,19:40:00,169.86,170.0251,169.85,170,44470,0\n" + "2017-10-03,19:45:00,170,170.01,169.83,169.91,70571,0\n" + "2017-10-03,19:50:00,169.91,169.9872,169.91,169.97,24873,0\n" + "2017-10-03,19:55:00,169.98,170.03,169.97,170.0165,22077,0\n" + "2017-10-03,20:00:00,170.0209,170.03,169.93,169.989,38646,0\n" + "2017-10-03,20:05:00,169.97,170.1,169.96,170.0701,41230,0\n" + "2017-10-03,20:10:00,170.08,170.09,170.01,170.0343,43049,0\n" + "2017-10-03,20:15:00,170.04,170.17,170.04,170.155,40711,0\n" + "2017-10-03,20:20:00,170.15,170.255,170.13,170.19,53786,0\n" + "2017-10-03,20:25:00,170.18,170.25,170.15,170.17,37430,0\n" + "2017-10-03,20:30:00,170.16,170.16,170.0699,170.11,25705,0\n" + "2017-10-03,20:35:00,170.11,170.14,170.06,170.09,38273,0\n" + "2017-10-03,20:40:00,170.1,170.1197,170,170.05,35705,0\n" + "2017-10-03,20:45:00,170.0451,170.09,170.02,170.04,22701,0\n" + "2017-10-03,20:50:00,170.03,170.11,169.97,170.05,48164,0\n" + "2017-10-03,20:55:00,170.055,170.1389,170.04,170.06,39045,0\n" + "2017-10-03,21:00:00,170.07,170.14,170.0445,170.08,26367,0\n" + "2017-10-03,21:05:00,170.087,170.1,169.95,169.98,37274,0\n" + "2017-10-03,21:10:00,169.97,169.98,169.87,169.9155,60362,0\n" + "2017-10-03,21:15:00,169.9199,170.01,169.85,170,80632,0\n" + "2017-10-03,21:20:00,170,170.02,169.9167,169.99,67873,0\n" + "2017-10-03,21:25:00,169.99,170.1,169.96,169.96,35384,0\n" + "2017-10-03,21:30:00,169.96,170.04,169.86,169.98,50925,0\n" + "2017-10-03,21:35:00,169.985,170.04,169.93,169.97,67340,0\n" + "2017-10-03,21:40:00,169.98,170.16,169.92,170.16,121267,0\n" + "2017-10-03,21:45:00,170.17,170.17,169.99,170.04,73965,0\n" + "2017-10-03,21:50:00,170.0498,170.05,169.87,169.8933,92198,0\n" + "2017-10-03,21:55:00,169.9,169.95,169.82,169.91,149032,0\n" + "2017-10-03,22:00:00,169.9154,170,169.76,169.96,743526,0\n" + "2017-10-04,15:35:00,169.83,170.24,169.52,169.975,398157,0\n" + "2017-10-04,15:40:00,169.99,170.1218,169.53,169.671,299473,0\n" + "2017-10-04,15:45:00,169.685,169.92,169.12,169.34,280530,0\n" + "2017-10-04,15:50:00,169.35,169.58,169.19,169.53,173560,0\n" + "2017-10-04,15:55:00,169.5599,169.85,169.52,169.75,152409,0\n" + "2017-10-04,16:00:00,169.74,169.9,169.68,169.786,97553,0\n" + "2017-10-04,16:05:00,169.785,169.98,169.6001,169.9364,132937,0\n" + "2017-10-04,16:10:00,169.935,170.1,169.83,170.0978,184817,0\n" + "2017-10-04,16:15:00,170.09,170.52,170.07,170.46,311474,0\n" + "2017-10-04,16:20:00,170.46,170.65,170.46,170.5552,142525,0\n" + "2017-10-04,16:25:00,170.5557,170.6,170.43,170.56,105005,0\n" + "2017-10-04,16:30:00,170.57,170.6499,170.28,170.29,83623,0\n" + "2017-10-04,16:35:00,170.29,170.41,170.03,170.16,107134,0\n" + "2017-10-04,16:40:00,170.15,170.17,170.02,170.07,71016,0\n" + "2017-10-04,16:45:00,170.05,170.1599,169.9,170.14,98949,0\n" + "2017-10-04,16:50:00,170.1293,170.25,170.05,170.1565,57149,0\n" + "2017-10-04,16:55:00,170.19,170.28,170.14,170.2767,41865,0\n" + "2017-10-04,17:00:00,170.275,170.45,170.27,170.359,89708,0\n" + "2017-10-04,17:05:00,170.36,170.5,170.36,170.425,90904,0\n" + "2017-10-04,17:10:00,170.4158,170.53,170.28,170.32,85245,0\n" + "2017-10-04,17:15:00,170.32,170.36,170.19,170.19,35387,0\n" + "2017-10-04,17:20:00,170.2068,170.28,170.1601,170.23,49177,0\n" + "2017-10-04,17:25:00,170.23,170.28,170.18,170.27,68875,0\n" + "2017-10-04,17:30:00,170.27,170.486,170.18,170.48,62464,0\n" + "2017-10-04,17:35:00,170.4799,170.53,170.29,170.3959,62946,0\n" + "2017-10-04,17:40:00,170.4,170.67,170.4,170.47,299961,0\n" + "2017-10-04,17:45:00,170.45,170.45,170.2401,170.285,52537,0\n" + "2017-10-04,17:50:00,170.29,170.32,170.22,170.28,33454,0\n" + "2017-10-04,17:55:00,170.27,170.37,170.11,170.1332,87204,0\n" + "2017-10-04,18:00:00,170.12,170.18,170.0277,170.09,82042,0\n" + "2017-10-04,18:05:00,170.0844,170.11,169.98,170.06,47941,0\n" + "2017-10-04,18:10:00,170.04,170.15,170.016,170.13,41231,0\n" + "2017-10-04,18:15:00,170.12,170.2,170.1,170.15,30757,0\n" + "2017-10-04,18:20:00,170.1709,170.54,170.15,170.37,107087,0\n" + "2017-10-04,18:25:00,170.38,170.46,170.27,170.42,53164,0\n" + "2017-10-04,18:30:00,170.43,170.4391,170.33,170.3617,16467,0\n" + "2017-10-04,18:35:00,170.38,170.38,170.2004,170.2095,48056,0\n" + "2017-10-04,18:40:00,170.22,170.31,170.14,170.175,42391,0\n" + "2017-10-04,18:45:00,170.169,170.2,170.08,170.199,30249,0\n" + "2017-10-04,18:50:00,170.17,170.17,169.99,170.0399,90641,0\n" + "2017-10-04,18:55:00,170.035,170.17,170.02,170.17,42272,0\n" + "2017-10-04,19:00:00,170.17,170.3011,169.9,169.95,190402,0\n" + "2017-10-04,19:05:00,169.95,170.0011,169.72,169.8,185279,0\n" + "2017-10-04,19:10:00,169.7912,169.82,169.7,169.7,87907,0\n" + "2017-10-04,19:15:00,169.7084,169.76,169.5,169.5497,150575,0\n" + "2017-10-04,19:20:00,169.55,169.55,169.3,169.48,165884,0\n" + "2017-10-04,19:25:00,169.4624,169.5492,169.41,169.5145,93177,0\n" + "2017-10-04,19:30:00,169.5147,169.59,169.45,169.48,68605,0\n" + "2017-10-04,19:35:00,169.4715,169.48,169.25,169.3342,163891,0\n" + "2017-10-04,19:40:00,169.335,169.335,168.89,169.0541,397847,0\n" + "2017-10-04,19:45:00,169.0541,169.1313,168.95,169.1313,118981,0\n" + "2017-10-04,19:50:00,169.1356,169.17,169.05,169.13,107858,0\n" + "2017-10-04,19:55:00,169.15,169.4,169.14,169.29,150707,0\n" + "2017-10-04,20:00:00,169.2944,169.37,169.19,169.31,74009,0\n" + "2017-10-04,20:05:00,169.31,169.42,169.27,169.3,149683,0\n" + "2017-10-04,20:10:00,169.29,169.49,169.29,169.35,65945,0\n" + "2017-10-04,20:15:00,169.34,169.36,169.23,169.2744,51156,0\n" + "2017-10-04,20:20:00,169.28,169.297,169.1732,169.285,33019,0\n" + "2017-10-04,20:25:00,169.28,169.3399,169.23,169.24,34718,0\n" + "2017-10-04,20:30:00,169.2344,169.27,169.14,169.2,175020,0\n" + "2017-10-04,20:35:00,169.2056,169.25,169.08,169.11,135676,0\n" + "2017-10-04,20:40:00,169.1,169.16,169.065,169.09,82331,0\n" + "2017-10-04,20:45:00,169.09,169.18,169.05,169.15,112675,0\n" + "2017-10-04,20:50:00,169.1401,169.16,169.13,169.15,39535,0\n" + "2017-10-04,20:55:00,169.15,169.255,169.14,169.21,88144,0\n" + "2017-10-04,21:00:00,169.22,169.28,169.2,169.22,55237,0\n" + "2017-10-04,21:05:00,169.219,169.24,169.0901,169.17,76080,0\n" + "2017-10-04,21:10:00,169.1819,169.24,169.13,169.23,55788,0\n" + "2017-10-04,21:15:00,169.24,169.34,169.2,169.305,83015,0\n" + "2017-10-04,21:20:00,169.305,169.43,169.29,169.37,114681,0\n" + "2017-10-04,21:25:00,169.39,169.4,169.32,169.34,69299,0\n" + "2017-10-04,21:30:00,169.33,169.35,169.21,169.21,88829,0\n" + "2017-10-04,21:35:00,169.21,169.25,169.12,169.23,132991,0\n" + "2017-10-04,21:40:00,169.22,169.2961,169.14,169.18,104071,0\n" + "2017-10-04,21:45:00,169.18,169.19,169.025,169.1,120937,0\n" + "2017-10-04,21:50:00,169.09,169.12,168.92,168.99,264181,0\n" + "2017-10-04,21:55:00,169,169,168.32,168.36,567124,0\n" + "2017-10-04,22:00:00,168.3593,168.48,168.29,168.42,1263104,0" + "2017-10-05,15:35:00,169.18,169.75,169.17,169.4,551260,0\n" + "2017-10-05,15:40:00,169.44,169.66,169.3001,169.33,300542,0\n" + "2017-10-05,15:45:00,169.33,169.615,169.05,169.43,446135,0\n" + "2017-10-05,15:50:00,169.43,169.66,169.43,169.48,175125,0\n" + "2017-10-05,15:55:00,169.5069,169.65,169.02,169.22,218871,0\n" + "2017-10-05,16:00:00,169.23,169.28,168.76,168.82,260499,0\n" + "2017-10-05,16:05:00,168.79,169.07,168.77,168.87,246255,0\n" + "2017-10-05,16:10:00,168.87,169.08,168.83,168.91,283385,0\n" + "2017-10-05,16:15:00,168.9,168.9899,168.83,168.9,149244,0\n" + "2017-10-05,16:20:00,168.9,169.37,168.87,169.338,250532,0\n" + "2017-10-05,16:25:00,169.31,169.5,169.2903,169.38,136187,0\n" + "2017-10-05,16:30:00,169.371,169.63,169.34,169.36,239973,0\n" + "2017-10-05,16:35:00,169.35,169.38,168.62,168.8495,271145,0\n" + "2017-10-05,16:40:00,168.86,169.157,168.86,169.12,116436,0\n" + "2017-10-05,16:45:00,169.12,169.25,168.97,169.075,116907,0\n" + "2017-10-05,16:50:00,169.0769,169.12,168.8,168.83,125154,0\n" + "2017-10-05,16:55:00,168.83,168.87,168.62,168.66,250228,0\n" + "2017-10-05,17:00:00,168.65,168.831,168.6,168.66,131683,0\n" + "2017-10-05,17:05:00,168.67,168.85,168.67,168.78,77072,0\n" + "2017-10-05,17:10:00,168.781,168.89,168.65,168.68,191292,0\n" + "2017-10-05,17:15:00,168.69,168.9,168.69,168.81,55178,0\n" + "2017-10-05,17:20:00,168.82,168.825,168.71,168.75,51215,0\n" + "2017-10-05,17:25:00,168.75,168.918,168.75,168.9,66924,0\n" + "2017-10-05,17:30:00,168.89,169.07,168.89,169.03,129045,0\n" + "2017-10-05,17:35:00,169.03,169.24,168.99,169.24,103682,0\n" + "2017-10-05,17:40:00,169.235,169.25,169,169.065,72765,0\n" + "2017-10-05,17:45:00,169.08,169.21,169.06,169.1,52377,0\n" + "2017-10-05,17:50:00,169.09,169.1,168.81,168.84,97458,0\n" + "2017-10-05,17:55:00,168.84,168.8709,168.7,168.79,96050,0\n" + "2017-10-05,18:00:00,168.79,168.97,168.75,168.935,57725,0\n" + "2017-10-05,18:05:00,168.92,169.09,168.9199,168.99,58552,0\n" + "2017-10-05,18:10:00,168.99,169.04,168.93,168.9438,33871,0\n" + "2017-10-05,18:15:00,168.95,169.25,168.94,169.21,92189,0\n" + "2017-10-05,18:20:00,169.21,169.54,169.21,169.52,164189,0\n" + "2017-10-05,18:25:00,169.53,169.99,169.53,169.97,319811,0\n" + "2017-10-05,18:30:00,169.955,170.34,169.93,170.2998,425631,0\n" + "2017-10-05,18:35:00,170.3,170.49,170.14,170.2,244958,0\n" + "2017-10-05,18:40:00,170.2,170.66,170.131,170.6,229089,0\n" + "2017-10-05,18:45:00,170.59,170.63,170.34,170.51,145818,0\n" + "2017-10-05,18:50:00,170.5127,170.75,170.5044,170.7,199695,0\n" + "2017-10-05,18:55:00,170.68,170.7,170.591,170.664,87695,0\n" + "2017-10-05,19:00:00,170.65,170.7,170.54,170.6,132210,0\n" + "2017-10-05,19:05:00,170.59,170.72,170.52,170.6907,84610,0\n" + "2017-10-05,19:10:00,170.6799,170.7,170.55,170.64,59561,0\n" + "2017-10-05,19:15:00,170.64,170.65,170.45,170.58,74779,0\n" + "2017-10-05,19:20:00,170.59,170.6,170.41,170.5264,73591,0\n" + "2017-10-05,19:25:00,170.53,170.62,170.44,170.52,48826,0\n" + "2017-10-05,19:30:00,170.52,170.63,170.44,170.6,85789,0\n" + "2017-10-05,19:35:00,170.5965,170.62,170.38,170.6,109223,0\n" + "2017-10-05,19:40:00,170.6,170.82,170.52,170.7848,139266,0\n" + "2017-10-05,19:45:00,170.7776,170.8,170.61,170.72,79229,0\n" + "2017-10-05,19:50:00,170.7037,170.79,170.6701,170.73,77545,0\n" + "2017-10-05,19:55:00,170.74,170.88,170.74,170.8,122197,0\n" + "2017-10-05,20:00:00,170.805,170.89,170.57,170.64,163130,0\n" + "2017-10-05,20:05:00,170.63,170.69,170.53,170.54,83694,0\n" + "2017-10-05,20:10:00,170.54,170.63,170.53,170.5502,49975,0\n" + "2017-10-05,20:15:00,170.55,170.59,170.5,170.5667,35498,0\n" + "2017-10-05,20:20:00,170.575,170.66,170.56,170.6,73553,0\n" + "2017-10-05,20:25:00,170.59,170.63,170.52,170.55,53525,0\n" + "2017-10-05,20:30:00,170.555,170.59,170.45,170.4936,39509,0\n" + "2017-10-05,20:35:00,170.5032,170.615,170.49,170.5708,69477,0\n" + "2017-10-05,20:40:00,170.5751,170.62,170.51,170.57,67598,0\n" + "2017-10-05,20:45:00,170.5825,170.69,170.55,170.59,106098,0\n" + "2017-10-05,20:50:00,170.6,170.64,170.52,170.56,47525,0\n" + "2017-10-05,20:55:00,170.5615,170.62,170.53,170.58,45716,0\n" + "2017-10-05,21:00:00,170.599,170.9,170.52,170.76,97779,0\n" + "2017-10-05,21:05:00,170.76,171,170.75,170.976,224416,0\n" + "2017-10-05,21:10:00,170.98,171,170.77,170.84,135360,0\n" + "2017-10-05,21:15:00,170.83,170.86,170.75,170.77,70224,0\n" + "2017-10-05,21:20:00,170.783,170.89,170.75,170.885,69051,0\n" + "2017-10-05,21:25:00,170.8899,171,170.84,170.89,110395,0\n" + "2017-10-05,21:30:00,170.9,170.99,170.83,170.83,149043,0\n" + "2017-10-05,21:35:00,170.83,171,170.81,170.96,119791,0\n" + "2017-10-05,21:40:00,170.97,171.05,170.81,170.985,251145,0\n" + "2017-10-05,21:45:00,170.99,171.1,170.9795,171.08,143574,0\n" + "2017-10-05,21:50:00,171.09,171.17,170.98,171.05,195975,0\n" + "2017-10-05,21:55:00,171.04,171.15,170.8,171.131,433457,0\n" + "2017-10-05,22:00:00,171.14,171.31,171.13,171.24,1128343,0\n" + "2017-10-06,15:35:00,170.25,170.31,169.75,170.1,664149,0\n" + "2017-10-06,15:40:00,170.08,170.42,169.81,170.25,320783,0\n" + "2017-10-06,15:45:00,170.25,170.86,170.1301,170.775,324838,0\n" + "2017-10-06,15:50:00,170.77,170.99,170.611,170.65,336886,0\n" + "2017-10-06,15:55:00,170.65,170.72,170.3,170.31,157502,0\n" + "2017-10-06,16:00:00,170.31,170.5,170.25,170.495,136683,0\n" + "2017-10-06,16:05:00,170.49,170.76,170.45,170.7,209150,0\n" + "2017-10-06,16:10:00,170.67,170.88,170.57,170.75,166652,0\n" + "2017-10-06,16:15:00,170.7454,170.8,170.56,170.56,184889,0\n" + "2017-10-06,16:20:00,170.56,170.6109,170.39,170.5,117913,0\n" + "2017-10-06,16:25:00,170.5,170.6,170.35,170.57,98916,0\n" + "2017-10-06,16:30:00,170.5734,170.5734,170.34,170.44,125507,0\n" + "2017-10-06,16:35:00,170.45,170.4903,170.36,170.44,96602,0\n" + "2017-10-06,16:40:00,170.44,170.5,170.27,170.43,148571,0\n" + "2017-10-06,16:45:00,170.44,170.475,170.31,170.34,84227,0\n" + "2017-10-06,16:50:00,170.35,170.55,170.34,170.474,87117,0\n" + "2017-10-06,16:55:00,170.46,170.54,170.29,170.32,115809,0\n" + "2017-10-06,17:00:00,170.35,170.35,170.11,170.2599,183249,0\n" + "2017-10-06,17:05:00,170.26,170.47,170.26,170.31,90236,0\n" + "2017-10-06,17:10:00,170.31,170.4272,170.27,170.29,50300,0\n" + "2017-10-06,17:15:00,170.32,170.4,170.3,170.385,54053,0\n" + "2017-10-06,17:20:00,170.39,170.71,170.37,170.66,143121,0\n" + "2017-10-06,17:25:00,170.65,170.71,170.5475,170.7,106767,0\n" + "2017-10-06,17:30:00,170.69,170.85,170.6801,170.8,76303,0\n" + "2017-10-06,17:35:00,170.81,170.85,170.74,170.83,68554,0\n" + "2017-10-06,17:40:00,170.83,170.86,170.66,170.7,93086,0\n" + "2017-10-06,17:45:00,170.695,170.78,170.6,170.7,67186,0\n" + "2017-10-06,17:50:00,170.73,171.05,170.7217,170.99,124157,0\n" + "2017-10-06,17:55:00,170.999,171.1,170.99,171.06,74128,0\n" + "2017-10-06,18:00:00,171.0691,171.351,171.01,171.3,172326,0\n" + "2017-10-06,18:05:00,171.319,171.4,171.13,171.33,172606,0\n" + "2017-10-06,18:10:00,171.36,171.54,171.3,171.4399,147101,0\n" + "2017-10-06,18:15:00,171.4391,171.5,171.26,171.3664,119360,0\n" + "2017-10-06,18:20:00,171.363,171.45,171.32,171.44,54723,0\n" + "2017-10-06,18:25:00,171.445,171.58,171.35,171.57,88315,0\n" + "2017-10-06,18:30:00,171.57,171.78,171.54,171.7639,123191,0\n" + "2017-10-06,18:35:00,171.7623,172.14,171.75,172.08,408140,0\n" + "2017-10-06,18:40:00,172.09,172.25,171.985,172.22,140686,0\n" + "2017-10-06,18:45:00,172.22,172.28,172.04,172.23,91064,0\n" + "2017-10-06,18:50:00,172.22,172.2345,172.13,172.17,188036,0\n" + "2017-10-06,18:55:00,172.1601,172.18,172.05,172.17,112332,0\n" + "2017-10-06,19:00:00,172.1762,172.19,171.99,172.05,131256,0\n" + "2017-10-06,19:05:00,172.0498,172.2,171.8,171.8,219040,0\n" + "2017-10-06,19:10:00,171.81,171.88,171.62,171.77,122858,0\n" + "2017-10-06,19:15:00,171.77,171.84,171.57,171.62,136296,0\n" + "2017-10-06,19:20:00,171.6,171.68,171.56,171.67,108984,0\n" + "2017-10-06,19:25:00,171.67,171.88,171.58,171.8521,127761,0\n" + "2017-10-06,19:30:00,171.8514,171.93,171.64,171.7,95688,0\n" + "2017-10-06,19:35:00,171.72,171.78,171.51,171.53,71837,0\n" + "2017-10-06,19:40:00,171.54,171.61,171.4391,171.61,89620,0\n" + "2017-10-06,19:45:00,171.6199,171.7876,171.56,171.76,72493,0\n" + "2017-10-06,19:50:00,171.76,171.78,171.65,171.65,35393,0\n" + "2017-10-06,19:55:00,171.68,171.7,171.62,171.69,38159,0\n" + "2017-10-06,20:00:00,171.67,171.71,171.62,171.69,29785,0\n" + "2017-10-06,20:05:00,171.68,171.685,171.56,171.57,30352,0\n" + "2017-10-06,20:10:00,171.58,171.7099,171.55,171.67,39764,0\n" + "2017-10-06,20:15:00,171.6601,171.6601,171.52,171.57,51418,0\n" + "2017-10-06,20:20:00,171.5614,171.63,171.54,171.6,49072,0\n" + "2017-10-06,20:25:00,171.5891,171.63,171.54,171.5999,39779,0\n" + "2017-10-06,20:30:00,171.59,171.59,171.36,171.41,70373,0\n" + "2017-10-06,20:35:00,171.44,171.52,171.42,171.52,44849,0\n" + "2017-10-06,20:40:00,171.525,171.57,171.44,171.45,45171,0\n" + "2017-10-06,20:45:00,171.44,171.55,171.41,171.51,38605,0\n" + "2017-10-06,20:50:00,171.501,171.6284,171.501,171.54,57509,0\n" + "2017-10-06,20:55:00,171.54,171.66,171.51,171.63,47831,0\n" + "2017-10-06,21:00:00,171.64,171.71,171.599,171.6728,54993,0\n" + "2017-10-06,21:05:00,171.67,171.75,171.6301,171.72,57250,0\n" + "2017-10-06,21:10:00,171.72,171.79,171.71,171.75,62189,0\n" + "2017-10-06,21:15:00,171.7454,171.77,171.67,171.76,60708,0\n" + "2017-10-06,21:20:00,171.76,171.77,171.55,171.6,91057,0\n" + "2017-10-06,21:25:00,171.5886,171.81,171.5886,171.8013,69765,0\n" + "2017-10-06,21:30:00,171.81,171.82,171.62,171.74,85199,0\n" + "2017-10-06,21:35:00,171.74,171.78,171.66,171.67,49544,0\n" + "2017-10-06,21:40:00,171.6636,171.8,171.63,171.79,64271,0\n" + "2017-10-06,21:45:00,171.8,171.99,171.79,171.965,156700,0\n" + "2017-10-06,21:50:00,171.96,172.1,171.9,171.93,270150,0\n" + "2017-10-06,21:55:00,171.95,172.25,171.95,172.24,287810,0\n" + "2017-10-06,22:00:00,172.24,172.37,172.16,172.23,1062537,0";
    String[] dataLine = rawData_5_minutes.split("\n");
    List<Bar> bars = new ArrayList<>();
    for (int i = 0; i < dataLine.length; i++) {
        String[] barData = dataLine[i].split(",");
        ZonedDateTime date = ZonedDateTime.parse(barData[0] + " " + barData[1] + " PST", DateTimeFormatter.ofPattern("yyyy-MM-dd H:m:s z"));
        double open = Double.parseDouble(barData[2]);
        double high = Double.parseDouble(barData[3]);
        double low = Double.parseDouble(barData[4]);
        double close = Double.parseDouble(barData[5]);
        double volume = Double.parseDouble(barData[6]);
        bars.add(new BaseBar(date, open, high, low, close, volume));
    }
    series_5_minutes = new BaseTimeSeries("FB_5_minutes", bars);
}
Also used : Bar(org.ta4j.core.Bar) BaseBar(org.ta4j.core.BaseBar) ZonedDateTime(java.time.ZonedDateTime) BaseBar(org.ta4j.core.BaseBar) BaseTimeSeries(org.ta4j.core.BaseTimeSeries) ArrayList(java.util.ArrayList) Before(org.junit.Before)

Example 15 with BaseTimeSeries

use of org.ta4j.core.BaseTimeSeries in project ta4j by ta4j.

the class PivotPointIndicatorTest method initDataForWeeklyTimeFrame.

@Before
public void initDataForWeeklyTimeFrame() {
    String rawData_1_hours = "2017-09-01,16:00:00,172.4,172.55,171.58,171.8,2204582,0\n" + "2017-09-01,17:00:00,171.79,172.49,171.31,172.43,1870246,0\n" + "2017-09-01,18:00:00,172.42,172.84,172.24,172.74,1264679,0\n" + "2017-09-01,19:00:00,172.74,172.915,172.34,172.37,987869,0\n" + "2017-09-01,20:00:00,172.37,172.4803,171.995,172.2189,1159335,0\n" + "2017-09-01,21:00:00,172.2174,172.3593,171.85,172.0151,830724,0\n" + "2017-09-01,22:00:00,172.03,172.39,171.92,172.02,1777758,0\n" + "2017-09-05,16:00:00,171.27,172.22,170.7301,172.08,1685421,0\n" + "2017-09-05,17:00:00,172.0731,172.3875,171.36,171.51,1879301,0\n" + "2017-09-05,18:00:00,171.49,171.5,170.95,171.21,1231823,0\n" + "2017-09-05,19:00:00,171.19,171.19,169.88,170.319,1724213,0\n" + "2017-09-05,20:00:00,170.27,170.47,169.55,170.45,1321590,0\n" + "2017-09-05,21:00:00,170.43,170.9,170.21,170.6003,1174472,0\n" + "2017-09-05,22:00:00,170.61,170.95,170.43,170.72,2004332,0\n" + "2017-09-06,16:00:00,170.91,171.49,170.76,171.25,1420276,0\n" + "2017-09-06,17:00:00,171.25,171.25,169.65,170.31,2110723,0\n" + "2017-09-06,18:00:00,170.34,170.64,169.57,170.52,1391833,0\n" + "2017-09-06,19:00:00,170.515,171.44,170.45,171.4211,1314133,0\n" + "2017-09-06,20:00:00,171.43,171.64,171.28,171.37,1127506,0\n" + "2017-09-06,21:00:00,171.38,172.04,171.33,171.98,1654536,0\n" + "2017-09-06,22:00:00,171.98,172.48,171.84,172.09,2815393,0\n" + "2017-09-07,16:00:00,171.94,172.05,170.57,170.64,2387691,0\n" + "2017-09-07,17:00:00,170.65,171.18,170.27,171.015,3142555,0\n" + "2017-09-07,18:00:00,171.03,172.49,171.03,172.36,2440694,0\n" + "2017-09-07,19:00:00,172.355,172.73,171.91,172.5,2437801,0\n" + "2017-09-07,20:00:00,172.48,172.87,172.299,172.78,1410186,0\n" + "2017-09-07,21:00:00,172.77,172.99,172.63,172.94,1279331,0\n" + "2017-09-07,22:00:00,172.94,173.3067,172.72,173.21,2543650,0\n" + "2017-09-08,16:00:00,173.09,173.49,172.69,172.991,1459655,0\n" + "2017-09-08,17:00:00,173.02,173.1,172.25,172.66,1354956,0\n" + "2017-09-08,18:00:00,172.66,172.95,172.14,172.21,1075148,0\n" + "2017-09-08,19:00:00,172.22,172.35,171.71,171.879,1197265,0\n" + "2017-09-08,20:00:00,171.88,172.13,171.42,171.435,959896,0\n" + "2017-09-08,21:00:00,171.44,171.51,171.11,171.24,893674,0\n" + "2017-09-08,22:00:00,171.27,171.35,170.8,170.95,1654448,0\n" + "2017-09-11,16:00:00,172.4,173.47,172.2,173.4,2569917,0\n" + "2017-09-11,17:00:00,173.39,173.89,172.88,172.95,1985972,0\n" + "2017-09-11,18:00:00,172.93,173.29,172.66,173.12,1249627,0\n" + "2017-09-11,19:00:00,173.14,173.465,173,173.2925,846283,0\n" + "2017-09-11,20:00:00,173.3,173.62,173.19,173.475,796323,0\n" + "2017-09-11,21:00:00,173.49,173.58,173.21,173.4029,700101,0\n" + "2017-09-11,22:00:00,173.4,173.69,173.23,173.51,2247054,0\n" + "2017-09-12,16:00:00,173.76,174,172.62,172.95,1600694,0\n" + "2017-09-12,17:00:00,172.94,172.97,172.29,172.8485,1850525,0\n" + "2017-09-12,18:00:00,172.83,173.06,172.5,172.5375,913774,0\n" + "2017-09-12,19:00:00,172.54,172.82,172.33,172.55,811710,0\n" + "2017-09-12,20:00:00,172.55,172.64,172.31,172.3779,756646,0\n" + "2017-09-12,21:00:00,172.37,172.51,171.75,172.18,1296421,0\n" + "2017-09-12,22:00:00,172.1899,172.95,171.96,172.95,1853689,0\n" + "2017-09-13,16:00:00,173.01,173.06,172.06,172.79,1219091,0\n" + "2017-09-13,17:00:00,172.8,172.99,172.36,172.66,1353380,0\n" + "2017-09-13,18:00:00,172.68,172.79,172.1307,172.29,929711,0\n" + "2017-09-13,19:00:00,172.28,172.88,172.27,172.85,600868,0\n" + "2017-09-13,20:00:00,172.84,172.92,172.26,172.71,1141623,0\n" + "2017-09-13,21:00:00,172.73,172.91,172.62,172.76,690702,0\n" + "2017-09-13,22:00:00,172.77,173.17,172.64,173.05,1951351,0\n" + "2017-09-14,16:00:00,172.26,172.28,170.5,171.48,3413922,0\n" + "2017-09-14,17:00:00,171.47,172,171.31,171.86,2025746,0\n" + "2017-09-14,18:00:00,171.86,171.95,171.38,171.44,1295512,0\n" + "2017-09-14,19:00:00,171.4383,171.53,170.7701,171.36,1573507,0\n" + "2017-09-14,20:00:00,171.38,171.585,170.98,171.07,880249,0\n" + "2017-09-14,21:00:00,171.07,171.32,170.97,171.1276,1000415,0\n" + "2017-09-14,22:00:00,171.135,171.2644,170.84,170.96,3505708,0\n" + "2017-09-15,16:00:00,170.88,171.35,170.26,171.02,4626553,0\n" + "2017-09-15,17:00:00,171.02,172.34,170.81,171.9,2152852,0\n" + "2017-09-15,18:00:00,171.9014,172.01,171.4,171.59,922110,0\n" + "2017-09-15,19:00:00,171.59,171.84,171.5,171.69,698595,0\n" + "2017-09-15,20:00:00,171.69,171.79,171.45,171.6,489550,0\n" + "2017-09-15,21:00:00,171.5912,171.75,171.3914,171.72,453983,0\n" + "2017-09-15,22:00:00,171.73,171.78,171.32,171.58,3372272,0\n" + "2017-09-18,16:00:00,171.99,172.07,171.27,171.82,1238452,0\n" + "2017-09-18,17:00:00,171.86,171.9402,171.14,171.16,1435108,0\n" + "2017-09-18,18:00:00,171.155,171.58,171.14,171.375,1034295,0\n" + "2017-09-18,19:00:00,171.375,171.54,170.892,171.24,1068328,0\n" + "2017-09-18,20:00:00,171.24,171.25,170.8,170.96,917132,0\n" + "2017-09-18,21:00:00,170.9583,171.03,169.34,169.8168,2447027,0\n" + "2017-09-18,22:00:00,169.8199,170.26,169.79,170.01,1899851,0\n" + "2017-09-19,16:00:00,170.62,171.82,170.36,171.04,2666461,0\n" + "2017-09-19,17:00:00,171.06,171.55,170.86,171.54,1519011,0\n" + "2017-09-19,18:00:00,171.5411,172,171.12,171.74,1296463,0\n" + "2017-09-19,19:00:00,171.735,172.24,171.7,171.783,995548,0\n" + "2017-09-19,20:00:00,171.77,171.81,171.52,171.63,595006,0\n" + "2017-09-19,21:00:00,171.63,172.17,171.63,171.8874,894959,0\n" + "2017-09-19,22:00:00,171.88,172.56,171.77,172.52,3361600,0\n" + "2017-09-20,16:00:00,172.5,173.05,171.91,172.436,1532373,0\n" + "2017-09-20,17:00:00,172.49,172.5,170.91,170.94,1882462,0\n" + "2017-09-20,18:00:00,170.99,171.91,170.7,171.42,1754497,0\n" + "2017-09-20,19:00:00,171.43,172.0499,171.37,171.74,701282,0\n" + "2017-09-20,20:00:00,171.75,172.34,171.68,172.2068,595816,0\n" + "2017-09-20,21:00:00,172.2,172.3228,170.8901,171.67,1933222,0\n" + "2017-09-20,22:00:00,171.67,172.37,171.38,172.17,2321029,0\n" + "2017-09-21,16:00:00,171.69,171.78,170.11,170.4176,1923218,0\n" + "2017-09-21,17:00:00,170.41,170.95,170.01,170.645,1802748,0\n" + "2017-09-21,18:00:00,170.64,172.27,170.63,171.79,1898152,0\n" + "2017-09-21,19:00:00,171.83,172.17,171.57,171.735,744466,0\n" + "2017-09-21,20:00:00,171.76,172.19,171.71,171.9,603496,0\n" + "2017-09-21,21:00:00,171.9,172.09,171.53,171.93,732452,0\n" + "2017-09-21,22:00:00,171.93,172.02,171.1,171.11,1549501,0\n" + "2017-09-22,16:00:00,170.21,171.7,170.2,171.04,1528102,0\n" + "2017-09-22,17:00:00,171.09,171.73,170.61,170.66,1213718,0\n" + "2017-09-22,18:00:00,170.67,170.9,170.3,170.4544,1129049,0\n" + "2017-09-22,19:00:00,170.455,170.4999,169.69,169.72,1486495,0\n" + "2017-09-22,20:00:00,169.7246,170.18,169.22,169.955,1306114,0\n" + "2017-09-22,21:00:00,169.97,170.6157,169.81,170.2223,1009723,0\n" + "2017-09-22,22:00:00,170.24,170.66,169.97,170.54,2891812,0\n" + "2017-09-25,16:00:00,169.24,169.3,164.25,164.5,7673085,0\n" + "2017-09-25,17:00:00,164.5,165.7,164.11,164.56,8126863,0\n" + "2017-09-25,18:00:00,164.55,164.99,163.89,164.3,3986187,0\n" + "2017-09-25,19:00:00,164.306,164.3618,162.78,163.9401,3761738,0\n" + "2017-09-25,20:00:00,163.945,164.1,162.8,163.1555,2185387,0\n" + "2017-09-25,21:00:00,163.155,163.28,161.56,162.72,4213188,0\n" + "2017-09-25,22:00:00,162.72,163.19,162.32,162.87,6664367,0\n" + "2017-09-26,16:00:00,164.5,164.88,163.53,163.9538,3979814,0\n" + "2017-09-26,17:00:00,163.95,165.39,163.33,163.485,4087164,0\n" + "2017-09-26,18:00:00,163.47,163.6,162.78,163.01,2683532,0\n" + "2017-09-26,19:00:00,163.01,164.35,163,164.1278,2086545,0\n" + "2017-09-26,20:00:00,164.13,165.5,164.103,165.03,2472074,0\n" + "2017-09-26,21:00:00,165.02,165.24,164.3,164.4132,1656648,0\n" + "2017-09-26,22:00:00,164.415,164.99,164.1,164.21,2410436,0\n" + "2017-09-27,16:00:00,165.9,167.14,165.57,166.74,3913309,0\n" + "2017-09-27,17:00:00,166.73,166.95,165.86,166.67,2198970,0\n" + "2017-09-27,18:00:00,166.64,166.74,166.2,166.41,1063139,0\n" + "2017-09-27,19:00:00,166.43,166.82,166.14,166.82,903477,0\n" + "2017-09-27,20:00:00,166.83,167.29,166.7794,167.25,1332143,0\n" + "2017-09-27,21:00:00,167.25,168.18,167.24,167.77,2455149,0\n" + "2017-09-27,22:00:00,167.78,168.34,167.63,167.68,3912593,0\n" + "2017-09-28,16:00:00,167.94,168.399,167.16,168.11,2261661,0\n" + "2017-09-28,17:00:00,168.09,169.0696,168.06,168.6196,2146271,0\n" + "2017-09-28,18:00:00,168.6173,168.87,167.99,168.16,1329327,0\n" + "2017-09-28,19:00:00,168.17,168.31,167.79,168.1,969834,0\n" + "2017-09-28,20:00:00,168.1167,168.69,167.26,168.58,1138931,0\n" + "2017-09-28,21:00:00,168.58,168.665,168.12,168.44,714588,0\n" + "2017-09-28,22:00:00,168.45,168.82,168,168.73,1884493,0\n" + "2017-09-29,16:00:00,168.83,169.89,168.81,169.5,2110580,0\n" + "2017-09-29,17:00:00,169.56,170.88,169.38,170.68,2446081,0\n" + "2017-09-29,18:00:00,170.6764,170.96,170.34,170.58,1512859,0\n" + "2017-09-29,19:00:00,170.585,171.39,170.5,171.35,1490295,0\n" + "2017-09-29,20:00:00,171.3468,171.66,171.11,171.2,1162494,0\n" + "2017-09-29,21:00:00,171.2042,171.29,170.48,170.64,968716,0\n" + "2017-09-29,22:00:00,170.64,170.97,170.28,170.81,2244755,0\n" + "2017-10-02,16:00:00,171.39,171.87,170.37,170.8,2421692,0\n" + "2017-10-02,17:00:00,170.77,171.0629,170.25,170.73,1573368,0\n" + "2017-10-02,18:00:00,170.73,170.915,169.1,169.1827,1717024,0\n" + "2017-10-02,19:00:00,169.18,169.7,168.75,169.59,1393249,0\n" + "2017-10-02,20:00:00,169.59,169.8856,169.47,169.65,778156,0\n" + "2017-10-02,21:00:00,169.65,170.33,169.53,169.83,1144629,0\n" + "2017-10-02,22:00:00,169.82,169.98,169.25,169.47,2400863,0\n" + "2017-10-03,16:00:00,169.3,170.73,169.2,170.59,1585661,0\n" + "2017-10-03,17:00:00,170.59,170.7,169.44,170.3365,1546335,0\n" + "2017-10-03,18:00:00,170.32,170.578,169.97,170.0568,651114,0\n" + "2017-10-03,19:00:00,170.06,170.265,169.82,169.98,675029,0\n" + "2017-10-03,20:00:00,169.9769,170.1,169.83,169.989,517457,0\n" + "2017-10-03,21:00:00,169.97,170.255,169.96,170.08,452166,0\n" + "2017-10-03,22:00:00,170.087,170.17,169.76,169.96,1579778,0\n" + "2017-10-04,16:00:00,169.83,170.24,169.12,169.786,1401682,0\n" + "2017-10-04,17:00:00,169.785,170.65,169.6001,170.359,1426202,0\n" + "2017-10-04,18:00:00,170.36,170.67,170.0277,170.09,1010196,0\n" + "2017-10-04,19:00:00,170.0844,170.54,169.9,169.95,740658,0\n" + "2017-10-04,20:00:00,169.95,170.0011,168.89,169.31,1764720,0\n" + "2017-10-04,21:00:00,169.31,169.49,169.05,169.22,1023139,0\n" + "2017-10-04,22:00:00,169.219,169.43,168.29,168.42,2940100,0\n" + "2017-10-05,16:00:00,169.18,169.75,168.76,168.82,1952432,0\n" + "2017-10-05,17:00:00,168.79,169.63,168.6,168.66,2317129,0\n" + "2017-10-05,18:00:00,168.67,169.25,168.65,168.935,1050783,0\n" + "2017-10-05,19:00:00,168.92,170.75,168.9199,170.6,2133708,0\n" + "2017-10-05,20:00:00,170.59,170.89,170.38,170.64,1117746,0\n" + "2017-10-05,21:00:00,170.63,170.9,170.45,170.76,769947,0\n" + "2017-10-05,22:00:00,170.76,171.31,170.75,171.24,3030774,0\n" + "2017-10-06,16:00:00,170.25,170.99,169.75,170.495,1940841,0\n" + "2017-10-06,17:00:00,170.49,170.88,170.11,170.2599,1618602,0\n" + "2017-10-06,18:00:00,170.26,171.351,170.26,171.3,1120217,0\n" + "2017-10-06,19:00:00,171.319,172.28,171.13,172.05,1776810,0\n" + "2017-10-06,20:00:00,172.0498,172.2,171.4391,171.69,1147914,0\n" + "2017-10-06,21:00:00,171.68,171.71,171.36,171.6728,569716,0\n" + "2017-10-06,22:00:00,171.67,172.37,171.55,172.23,2317180,0";
    String[] dataLine = rawData_1_hours.split("\n");
    List<Bar> bars = new ArrayList<>();
    for (int i = 0; i < dataLine.length; i++) {
        String[] barData = dataLine[i].split(",");
        ZonedDateTime date = ZonedDateTime.parse(barData[0] + " " + barData[1] + " PST", DateTimeFormatter.ofPattern("yyyy-MM-dd H:m:s z"));
        double open = Double.parseDouble(barData[2]);
        double high = Double.parseDouble(barData[3]);
        double low = Double.parseDouble(barData[4]);
        double close = Double.parseDouble(barData[5]);
        double volume = Double.parseDouble(barData[6]);
        bars.add(new BaseBar(date, open, high, low, close, volume));
    }
    series_1_hours = new BaseTimeSeries("FB_1_hours", bars);
}
Also used : Bar(org.ta4j.core.Bar) BaseBar(org.ta4j.core.BaseBar) ZonedDateTime(java.time.ZonedDateTime) BaseBar(org.ta4j.core.BaseBar) BaseTimeSeries(org.ta4j.core.BaseTimeSeries) ArrayList(java.util.ArrayList) Before(org.junit.Before)

Aggregations

Bar (org.ta4j.core.Bar)16 BaseTimeSeries (org.ta4j.core.BaseTimeSeries)16 ArrayList (java.util.ArrayList)14 Before (org.junit.Before)12 BaseBar (org.ta4j.core.BaseBar)9 ZonedDateTime (java.time.ZonedDateTime)8 MockBar (org.ta4j.core.mocks.MockBar)6 CSVReader (com.opencsv.CSVReader)2 IOException (java.io.IOException)2 InputStream (java.io.InputStream)2 InputStreamReader (java.io.InputStreamReader)2 TimeSeries (org.ta4j.core.TimeSeries)2 BitfinexApiBroker (com.github.jnidzwetzki.bitfinex.v2.BitfinexApiBroker)1 APIException (com.github.jnidzwetzki.bitfinex.v2.entity.APIException)1 BitfinexCurrencyPair (com.github.jnidzwetzki.bitfinex.v2.entity.BitfinexCurrencyPair)1 BitfinexTick (com.github.jnidzwetzki.bitfinex.v2.entity.BitfinexTick)1 Timeframe (com.github.jnidzwetzki.bitfinex.v2.entity.Timeframe)1 BitfinexCandlestickSymbol (com.github.jnidzwetzki.bitfinex.v2.entity.symbol.BitfinexCandlestickSymbol)1 BarConverter (com.github.jnidzwetzki.cryptobot.util.BarConverter)1 Instant (java.time.Instant)1