use of org.ta4j.core.mocks.MockBar in project ta4j by ta4j.
the class ThreeWhiteSoldiersIndicatorTest method setUp.
@Before
public void setUp() {
List<Bar> bars = new ArrayList<Bar>();
// open, close, high, low
bars.add(new MockBar(19, 19, 22, 15));
bars.add(new MockBar(10, 18, 20, 8));
bars.add(new MockBar(17, 16, 21, 15));
bars.add(new MockBar(15.6, 18, 18.1, 14));
bars.add(new MockBar(16, 19.9, 20, 15));
bars.add(new MockBar(16.8, 23, 23, 16.7));
bars.add(new MockBar(17, 25, 25, 17));
bars.add(new MockBar(23, 16.8, 24, 15));
series = new MockTimeSeries(bars);
}
use of org.ta4j.core.mocks.MockBar in project ta4j by ta4j.
the class UpperShadowIndicatorTest 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(15, 15, 16, 14));
bars.add(new MockBar(15, 11, 15, 8));
bars.add(new MockBar(11, 12, 12, 10));
series = new MockTimeSeries(bars);
}
use of org.ta4j.core.mocks.MockBar in project ta4j by ta4j.
the class MinusDMIndicatorTest method zeroDirectionalMovement.
@Test
public void zeroDirectionalMovement() {
MockBar yesterdayBar = new MockBar(0, 0, 10, 2);
MockBar todayBar = new MockBar(0, 0, 6, 6);
List<Bar> bars = new ArrayList<Bar>();
bars.add(yesterdayBar);
bars.add(todayBar);
MockTimeSeries series = new MockTimeSeries(bars);
MinusDMIndicator down = new MinusDMIndicator(series);
assertDecimalEquals(down.getValue(1), 0);
}
use of org.ta4j.core.mocks.MockBar in project ta4j by ta4j.
the class MinusDMIndicatorTest method zeroDirectionalMovement2.
@Test
public void zeroDirectionalMovement2() {
MockBar yesterdayBar = new MockBar(0, 0, 6, 12);
MockBar todayBar = new MockBar(0, 0, 12, 6);
List<Bar> bars = new ArrayList<Bar>();
bars.add(yesterdayBar);
bars.add(todayBar);
MockTimeSeries series = new MockTimeSeries(bars);
MinusDMIndicator down = new MinusDMIndicator(series);
assertDecimalEquals(down.getValue(1), 0);
}
use of org.ta4j.core.mocks.MockBar in project ta4j by ta4j.
the class MinusDMIndicatorTest method zeroDirectionalMovement3.
@Test
public void zeroDirectionalMovement3() {
MockBar yesterdayBar = new MockBar(0, 0, 6, 6);
MockBar todayBar = new MockBar(0, 0, 12, 4);
List<Bar> bars = new ArrayList<Bar>();
bars.add(yesterdayBar);
bars.add(todayBar);
MockTimeSeries series = new MockTimeSeries(bars);
MinusDMIndicator down = new MinusDMIndicator(series);
assertDecimalEquals(down.getValue(1), 0);
}
Aggregations