Search in sources :

Example 46 with MockBar

use of org.ta4j.core.mocks.MockBar in project ta4j by ta4j.

the class BullishHaramiIndicatorTest 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(21, 15, 22, 14));
    bars.add(new MockBar(17, 20, 21, 17));
    bars.add(new MockBar(15, 11, 15, 8));
    bars.add(new MockBar(11, 12, 12, 10));
    series = new MockTimeSeries(bars);
}
Also used : MockBar(org.ta4j.core.mocks.MockBar) Bar(org.ta4j.core.Bar) MockBar(org.ta4j.core.mocks.MockBar) ArrayList(java.util.ArrayList) MockTimeSeries(org.ta4j.core.mocks.MockTimeSeries) Before(org.junit.Before)

Example 47 with MockBar

use of org.ta4j.core.mocks.MockBar in project ta4j by ta4j.

the class DojiIndicatorTest method setUp.

@Before
public void setUp() {
    List<Bar> bars = new ArrayList<Bar>();
    // open, close, high, low
    bars.add(new MockBar(19, 19, 22, 16));
    bars.add(new MockBar(10, 18, 20, 10));
    bars.add(new MockBar(17, 20, 21, 17));
    bars.add(new MockBar(15, 15.1, 16, 14));
    bars.add(new MockBar(15, 11, 15, 8));
    bars.add(new MockBar(11, 12, 12, 10));
    series = new MockTimeSeries(bars);
}
Also used : MockBar(org.ta4j.core.mocks.MockBar) Bar(org.ta4j.core.Bar) MockBar(org.ta4j.core.mocks.MockBar) ArrayList(java.util.ArrayList) MockTimeSeries(org.ta4j.core.mocks.MockTimeSeries) Before(org.junit.Before)

Example 48 with MockBar

use of org.ta4j.core.mocks.MockBar in project ta4j by ta4j.

the class LowerShadowIndicatorTest 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);
}
Also used : MockBar(org.ta4j.core.mocks.MockBar) Bar(org.ta4j.core.Bar) MockBar(org.ta4j.core.mocks.MockBar) ArrayList(java.util.ArrayList) MockTimeSeries(org.ta4j.core.mocks.MockTimeSeries) Before(org.junit.Before)

Example 49 with MockBar

use of org.ta4j.core.mocks.MockBar in project ta4j by ta4j.

the class RealBodyIndicatorTest 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);
}
Also used : MockBar(org.ta4j.core.mocks.MockBar) Bar(org.ta4j.core.Bar) MockBar(org.ta4j.core.mocks.MockBar) ArrayList(java.util.ArrayList) MockTimeSeries(org.ta4j.core.mocks.MockTimeSeries) Before(org.junit.Before)

Example 50 with MockBar

use of org.ta4j.core.mocks.MockBar in project ta4j by ta4j.

the class ThreeBlackCrowsIndicatorTest 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, 20, 21, 17));
    bars.add(new MockBar(19, 17, 20, 16.9));
    bars.add(new MockBar(17.5, 14, 18, 13.9));
    bars.add(new MockBar(15, 11, 15, 11));
    bars.add(new MockBar(12, 14, 15, 8));
    bars.add(new MockBar(13, 16, 16, 11));
    series = new MockTimeSeries(bars);
}
Also used : MockBar(org.ta4j.core.mocks.MockBar) Bar(org.ta4j.core.Bar) MockBar(org.ta4j.core.mocks.MockBar) ArrayList(java.util.ArrayList) MockTimeSeries(org.ta4j.core.mocks.MockTimeSeries) Before(org.junit.Before)

Aggregations

MockBar (org.ta4j.core.mocks.MockBar)57 ArrayList (java.util.ArrayList)54 Bar (org.ta4j.core.Bar)48 MockTimeSeries (org.ta4j.core.mocks.MockTimeSeries)46 Before (org.junit.Before)35 Test (org.junit.Test)22 BaseTimeSeries (org.ta4j.core.BaseTimeSeries)6 TimeSeries (org.ta4j.core.TimeSeries)5 ClosePriceIndicator (org.ta4j.core.indicators.helpers.ClosePriceIndicator)5 ZonedDateTime (java.time.ZonedDateTime)3 VolumeIndicator (org.ta4j.core.indicators.helpers.VolumeIndicator)3 BaseTradingRecord (org.ta4j.core.BaseTradingRecord)1 TradingRecord (org.ta4j.core.TradingRecord)1 FixedRule (org.ta4j.core.trading.rules.FixedRule)1