use of org.ta4j.core.trading.rules.AndRule in project crypto-bot by jnidzwetzki.
the class DonchianChannelStrategy method getStrategy.
@Override
public Strategy getStrategy() {
final MACDIndicator macd = new MACDIndicator(closePriceIndicator, 9, 26);
final EMAIndicator emaMacd = new EMAIndicator(macd, 9);
final Rule buyingRule = new AndRule(new IsRisingRule(donchianChannelUpper, 1), new OverIndicatorRule(macd, Decimal.valueOf(0)));
final // new OrRule(
Rule sellingRule = new IsFallingRule(donchianChannelLower, 1);
// new UnderIndicatorRule(macd, emaMacd));
final BaseStrategy strategy = new BaseStrategy(buyingRule, sellingRule);
return strategy;
}
Aggregations