@Test public void isSatisfied() { assertTrue(rule.isSatisfied(0)); assertTrue(rule.isSatisfied(1)); assertFalse(rule.isSatisfied(2)); assertTrue(rule.isSatisfied(3)); assertFalse(rule.isSatisfied(4)); assertTrue(rule.isSatisfied(5)); assertFalse(rule.isSatisfied(6)); assertFalse(rule.isSatisfied(7)); assertFalse(rule.isSatisfied(8)); assertTrue(rule.isSatisfied(9)); }
@Override public boolean isSatisfied(int index, TradingRecord tradingRecord) { LowestValueIndicator lowest = new LowestValueIndicator(ref, barCount); Num lowestVal = lowest.getValue(index); Num refVal = ref.getValue(index); final boolean satisfied = !refVal.isNaN() && !lowestVal.isNaN() && refVal.equals(lowestVal); traceIsSatisfied(index, satisfied); return satisfied; }
IsLowestRule extends AbstractRule { @Override public boolean isSatisfied(int index, TradingRecord tradingRecord) { LowestValueIndicator lowest = new LowestValueIndicator(ref, barCount); Num lowestVal = lowest.getValue(index); Num refVal = ref.getValue(index); final boolean satisfied = !refVal.isNaN() && !lowestVal.isNaN() && refVal.equals(lowestVal); traceIsSatisfied(index, satisfied); return satisfied; } }
IsLowestRule extends AbstractRule { @Override public boolean isSatisfied(int index, TradingRecord tradingRecord) { LowestValueIndicator lowest = new LowestValueIndicator(ref, barCount); Num lowestVal = lowest.getValue(index); Num refVal = ref.getValue(index); final boolean satisfied = !refVal.isNaN() && !lowestVal.isNaN() && refVal.equals(lowestVal); traceIsSatisfied(index, satisfied); return satisfied; } IsLowestRule(Indicator<Num> ref, int barCount); }
IsLowestRule extends AbstractRule { @Override public boolean isSatisfied(int index, TradingRecord tradingRecord) { LowestValueIndicator lowest = new LowestValueIndicator(ref, barCount); Num lowestVal = lowest.getValue(index); Num refVal = ref.getValue(index); final boolean satisfied = !refVal.isNaN() && !lowestVal.isNaN() && refVal.equals(lowestVal); traceIsSatisfied(index, satisfied); return satisfied; } IsLowestRule(Indicator<Num> ref, int barCount); @Override boolean isSatisfied(int index, TradingRecord tradingRecord); }
IsLowestRule extends AbstractRule { @Override public boolean isSatisfied(int index, TradingRecord tradingRecord) { LowestValueIndicator lowest = new LowestValueIndicator(ref, barCount); Num lowestVal = lowest.getValue(index); Num refVal = ref.getValue(index); final boolean satisfied = !refVal.isNaN() && !lowestVal.isNaN() && refVal.equals(lowestVal); traceIsSatisfied(index, satisfied); return satisfied; } IsLowestRule(Indicator<Num> ref, int barCount); @Override boolean isSatisfied(int index, TradingRecord tradingRecord);  }