use of org.ta4j.core.Strategy in project ta4j by ta4j.
the class AbstractAnalysisCriterionTest method bestShouldBeBuyAndHoldOnLoss.
@Test
public void bestShouldBeBuyAndHoldOnLoss() {
MockTimeSeries series = new MockTimeSeries(6.0, 3.0, 6.0, 6.0);
TimeSeriesManager manager = new TimeSeriesManager(series);
Strategy bestStrategy = new TotalProfitCriterion().chooseBest(manager, strategies);
assertEquals(buyAndHoldStrategy, bestStrategy);
}
use of org.ta4j.core.Strategy in project ta4j by ta4j.
the class AbstractAnalysisCriterionTest method bestShouldBeAlwaysOperateOnProfit.
@Test
public void bestShouldBeAlwaysOperateOnProfit() {
MockTimeSeries series = new MockTimeSeries(6.0, 9.0, 6.0, 6.0);
TimeSeriesManager manager = new TimeSeriesManager(series);
Strategy bestStrategy = new TotalProfitCriterion().chooseBest(manager, strategies);
assertEquals(alwaysStrategy, bestStrategy);
}
Aggregations