use of org.ta4j.core.mocks.MockTimeSeries in project ta4j by ta4j.
the class BollingerBandWidthIndicatorTest method setUp.
@Before
public void setUp() {
TimeSeries data = new MockTimeSeries(10, 12, 15, 14, 17, 20, 21, 20, 20, 19, 20, 17, 12, 12, 9, 8, 9, 10, 9, 10);
closePrice = new ClosePriceIndicator(data);
}
use of org.ta4j.core.mocks.MockTimeSeries in project ta4j by ta4j.
the class BollingerBandsUpperIndicatorTest method setUp.
@Before
public void setUp() {
TimeSeries data = new MockTimeSeries(1, 2, 3, 4, 3, 4, 5, 4, 3, 3, 4, 3, 2);
timeFrame = 3;
closePrice = new ClosePriceIndicator(data);
sma = new SMAIndicator(closePrice, timeFrame);
}
use of org.ta4j.core.mocks.MockTimeSeries in project ta4j by ta4j.
the class KAMAIndicatorTest method getValueOnDeepIndicesShouldNotCauseStackOverflow.
@Test
public void getValueOnDeepIndicesShouldNotCauseStackOverflow() {
TimeSeries series = new MockTimeSeries();
series.setMaximumBarCount(5000);
assertEquals(5000, series.getBarCount());
KAMAIndicator kama = new KAMAIndicator(new ClosePriceIndicator(series), 10, 2, 30);
try {
assertDecimalEquals(kama.getValue(3000), "2999.75");
} catch (Throwable t) {
fail(t.getMessage());
}
}
use of org.ta4j.core.mocks.MockTimeSeries in project ta4j by ta4j.
the class PercentBIndicatorTest method setUp.
@Before
public void setUp() {
TimeSeries data = new MockTimeSeries(10, 12, 15, 14, 17, 20, 21, 20, 20, 19, 20, 17, 12, 12, 9, 8, 9, 10, 9, 10);
closePrice = new ClosePriceIndicator(data);
}
use of org.ta4j.core.mocks.MockTimeSeries in project ta4j by ta4j.
the class BearishEngulfingIndicatorTest method setUp.
@Before
public void setUp() {
List<Bar> bars = new ArrayList<Bar>();
// open, close, high, low
bars.add(new MockBar(10, 18, 20, 10));
bars.add(new MockBar(17, 20, 21, 17));
bars.add(new MockBar(21, 15, 22, 14));
bars.add(new MockBar(15, 11, 15, 8));
bars.add(new MockBar(11, 12, 12, 10));
series = new MockTimeSeries(bars);
}
Aggregations