本文整理汇总了Java中org.ta4j.core.Tick.getOpenPrice方法的典型用法代码示例。如果您正苦于以下问题:Java Tick.getOpenPrice方法的具体用法?Java Tick.getOpenPrice怎么用?Java Tick.getOpenPrice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ta4j.core.Tick
的用法示例。
在下文中一共展示了Tick.getOpenPrice方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: calculate
import org.ta4j.core.Tick; //导入方法依赖的package包/类
@Override
protected Boolean calculate(int index) {
if (index < 1) {
// Harami is a 2-candle pattern
return false;
}
Tick prevTick = series.getTick(index-1);
Tick currTick = series.getTick(index);
if (prevTick.isBearish() && currTick.isBullish()) {
final Decimal prevOpenPrice = prevTick.getOpenPrice();
final Decimal prevClosePrice = prevTick.getClosePrice();
final Decimal currOpenPrice = currTick.getOpenPrice();
final Decimal currClosePrice = currTick.getClosePrice();
return currOpenPrice.isLessThan(prevOpenPrice) && currOpenPrice.isGreaterThan(prevClosePrice)
&& currClosePrice.isLessThan(prevOpenPrice) && currClosePrice.isGreaterThan(prevClosePrice);
}
return false;
}
示例2: calculate
import org.ta4j.core.Tick; //导入方法依赖的package包/类
@Override
protected Boolean calculate(int index) {
if (index < 1) {
// Harami is a 2-candle pattern
return false;
}
Tick prevTick = series.getTick(index-1);
Tick currTick = series.getTick(index);
if (prevTick.isBullish() && currTick.isBearish()) {
final Decimal prevOpenPrice = prevTick.getOpenPrice();
final Decimal prevClosePrice = prevTick.getClosePrice();
final Decimal currOpenPrice = currTick.getOpenPrice();
final Decimal currClosePrice = currTick.getClosePrice();
return currOpenPrice.isGreaterThan(prevOpenPrice) && currOpenPrice.isLessThan(prevClosePrice)
&& currClosePrice.isGreaterThan(prevOpenPrice) && currClosePrice.isLessThan(prevClosePrice);
}
return false;
}
示例3: calculate
import org.ta4j.core.Tick; //导入方法依赖的package包/类
@Override
protected Boolean calculate(int index) {
if (index < 1) {
// Engulfing is a 2-candle pattern
return false;
}
Tick prevTick = series.getTick(index-1);
Tick currTick = series.getTick(index);
if (prevTick.isBullish() && currTick.isBearish()) {
final Decimal prevOpenPrice = prevTick.getOpenPrice();
final Decimal prevClosePrice = prevTick.getClosePrice();
final Decimal currOpenPrice = currTick.getOpenPrice();
final Decimal currClosePrice = currTick.getClosePrice();
return currOpenPrice.isGreaterThan(prevOpenPrice) && currOpenPrice.isGreaterThan(prevClosePrice)
&& currClosePrice.isLessThan(prevOpenPrice) && currClosePrice.isLessThan(prevClosePrice);
}
return false;
}
示例4: calculate
import org.ta4j.core.Tick; //导入方法依赖的package包/类
@Override
protected Boolean calculate(int index) {
if (index < 1) {
// Engulfing is a 2-candle pattern
return false;
}
Tick prevTick = series.getTick(index-1);
Tick currTick = series.getTick(index);
if (prevTick.isBearish() && currTick.isBullish()) {
final Decimal prevOpenPrice = prevTick.getOpenPrice();
final Decimal prevClosePrice = prevTick.getClosePrice();
final Decimal currOpenPrice = currTick.getOpenPrice();
final Decimal currClosePrice = currTick.getClosePrice();
return currOpenPrice.isLessThan(prevOpenPrice) && currOpenPrice.isLessThan(prevClosePrice)
&& currClosePrice.isGreaterThan(prevOpenPrice) && currClosePrice.isGreaterThan(prevClosePrice);
}
return false;
}
示例5: isDeclining
import org.ta4j.core.Tick; //导入方法依赖的package包/类
/**
* @param index the current tick/candle index
* @return true if the current tick/candle is declining, false otherwise
*/
private boolean isDeclining(int index) {
Tick prevTick = series.getTick(index-1);
Tick currTick = series.getTick(index);
final Decimal prevOpenPrice = prevTick.getOpenPrice();
final Decimal prevClosePrice = prevTick.getClosePrice();
final Decimal currOpenPrice = currTick.getOpenPrice();
final Decimal currClosePrice = currTick.getClosePrice();
// Opens within the body of the previous candle
return currOpenPrice.isLessThan(prevOpenPrice) && currOpenPrice.isGreaterThan(prevClosePrice)
// Closes below the previous close price
&& currClosePrice.isLessThan(prevClosePrice);
}
示例6: isGrowing
import org.ta4j.core.Tick; //导入方法依赖的package包/类
/**
* @param index the current tick/candle index
* @return true if the current tick/candle is growing, false otherwise
*/
private boolean isGrowing(int index) {
Tick prevTick = series.getTick(index-1);
Tick currTick = series.getTick(index);
final Decimal prevOpenPrice = prevTick.getOpenPrice();
final Decimal prevClosePrice = prevTick.getClosePrice();
final Decimal currOpenPrice = currTick.getOpenPrice();
final Decimal currClosePrice = currTick.getClosePrice();
// Opens within the body of the previous candle
return currOpenPrice.isGreaterThan(prevOpenPrice) && currOpenPrice.isLessThan(prevClosePrice)
// Closes above the previous close price
&& currClosePrice.isGreaterThan(prevClosePrice);
}
示例7: calculate
import org.ta4j.core.Tick; //导入方法依赖的package包/类
@Override
protected Decimal calculate(int index) {
Tick t = series.getTick(index);
final Decimal openPrice = t.getOpenPrice();
final Decimal closePrice = t.getClosePrice();
if (closePrice.isGreaterThan(openPrice)) {
// Bullish
return openPrice.minus(t.getMinPrice());
} else {
// Bearish
return closePrice.minus(t.getMinPrice());
}
}
示例8: calculate
import org.ta4j.core.Tick; //导入方法依赖的package包/类
@Override
protected Decimal calculate(int index) {
Tick t = series.getTick(index);
final Decimal openPrice = t.getOpenPrice();
final Decimal closePrice = t.getClosePrice();
if (closePrice.isGreaterThan(openPrice)) {
// Bullish
return t.getMaxPrice().minus(closePrice);
} else {
// Bearish
return t.getMaxPrice().minus(openPrice);
}
}