Search in sources :

Example 1 with VolumeIndicator

use of org.ta4j.core.indicators.helpers.VolumeIndicator in project ta4j by ta4j.

the class CorrelationCoefficientIndicatorTest method setUp.

@Before
public void setUp() {
    List<Bar> bars = new ArrayList<Bar>();
    // close, volume
    bars.add(new MockBar(6, 100));
    bars.add(new MockBar(7, 105));
    bars.add(new MockBar(9, 130));
    bars.add(new MockBar(12, 160));
    bars.add(new MockBar(11, 150));
    bars.add(new MockBar(10, 130));
    bars.add(new MockBar(11, 95));
    bars.add(new MockBar(13, 120));
    bars.add(new MockBar(15, 180));
    bars.add(new MockBar(12, 160));
    bars.add(new MockBar(8, 150));
    bars.add(new MockBar(4, 200));
    bars.add(new MockBar(3, 150));
    bars.add(new MockBar(4, 85));
    bars.add(new MockBar(3, 70));
    bars.add(new MockBar(5, 90));
    bars.add(new MockBar(8, 100));
    bars.add(new MockBar(9, 95));
    bars.add(new MockBar(11, 110));
    bars.add(new MockBar(10, 95));
    TimeSeries data = new BaseTimeSeries(bars);
    close = new ClosePriceIndicator(data);
    volume = new VolumeIndicator(data, 2);
}
Also used : MockBar(org.ta4j.core.mocks.MockBar) VolumeIndicator(org.ta4j.core.indicators.helpers.VolumeIndicator) MockBar(org.ta4j.core.mocks.MockBar) ArrayList(java.util.ArrayList) ClosePriceIndicator(org.ta4j.core.indicators.helpers.ClosePriceIndicator) Before(org.junit.Before)

Example 2 with VolumeIndicator

use of org.ta4j.core.indicators.helpers.VolumeIndicator in project ta4j by ta4j.

the class CovarianceIndicatorTest method setUp.

@Before
public void setUp() {
    List<Bar> bars = new ArrayList<Bar>();
    // close, volume
    bars.add(new MockBar(6, 100));
    bars.add(new MockBar(7, 105));
    bars.add(new MockBar(9, 130));
    bars.add(new MockBar(12, 160));
    bars.add(new MockBar(11, 150));
    bars.add(new MockBar(10, 130));
    bars.add(new MockBar(11, 95));
    bars.add(new MockBar(13, 120));
    bars.add(new MockBar(15, 180));
    bars.add(new MockBar(12, 160));
    bars.add(new MockBar(8, 150));
    bars.add(new MockBar(4, 200));
    bars.add(new MockBar(3, 150));
    bars.add(new MockBar(4, 85));
    bars.add(new MockBar(3, 70));
    bars.add(new MockBar(5, 90));
    bars.add(new MockBar(8, 100));
    bars.add(new MockBar(9, 95));
    bars.add(new MockBar(11, 110));
    bars.add(new MockBar(10, 95));
    TimeSeries data = new BaseTimeSeries(bars);
    close = new ClosePriceIndicator(data);
    volume = new VolumeIndicator(data, 2);
}
Also used : MockBar(org.ta4j.core.mocks.MockBar) VolumeIndicator(org.ta4j.core.indicators.helpers.VolumeIndicator) MockBar(org.ta4j.core.mocks.MockBar) ArrayList(java.util.ArrayList) ClosePriceIndicator(org.ta4j.core.indicators.helpers.ClosePriceIndicator) Before(org.junit.Before)

Example 3 with VolumeIndicator

use of org.ta4j.core.indicators.helpers.VolumeIndicator in project ta4j by ta4j.

the class PearsonCorrelationIndicatorTest method setUp.

@Before
public void setUp() {
    List<Bar> bars = new ArrayList<Bar>();
    // close, volume
    bars.add(new MockBar(6, 100));
    bars.add(new MockBar(7, 105));
    bars.add(new MockBar(9, 130));
    bars.add(new MockBar(12, 160));
    bars.add(new MockBar(11, 150));
    bars.add(new MockBar(10, 130));
    bars.add(new MockBar(11, 95));
    bars.add(new MockBar(13, 120));
    bars.add(new MockBar(15, 180));
    bars.add(new MockBar(12, 160));
    bars.add(new MockBar(8, 150));
    bars.add(new MockBar(4, 200));
    bars.add(new MockBar(3, 150));
    bars.add(new MockBar(4, 85));
    bars.add(new MockBar(3, 70));
    bars.add(new MockBar(5, 90));
    bars.add(new MockBar(8, 100));
    bars.add(new MockBar(9, 95));
    bars.add(new MockBar(11, 110));
    bars.add(new MockBar(10, 95));
    TimeSeries data = new BaseTimeSeries(bars);
    close = new ClosePriceIndicator(data);
    volume = new VolumeIndicator(data, 2);
}
Also used : MockBar(org.ta4j.core.mocks.MockBar) VolumeIndicator(org.ta4j.core.indicators.helpers.VolumeIndicator) MockBar(org.ta4j.core.mocks.MockBar) ArrayList(java.util.ArrayList) ClosePriceIndicator(org.ta4j.core.indicators.helpers.ClosePriceIndicator) Before(org.junit.Before)

Aggregations

ArrayList (java.util.ArrayList)3 Before (org.junit.Before)3 ClosePriceIndicator (org.ta4j.core.indicators.helpers.ClosePriceIndicator)3 VolumeIndicator (org.ta4j.core.indicators.helpers.VolumeIndicator)3 MockBar (org.ta4j.core.mocks.MockBar)3