当前位置: 首页>>代码示例>>Java>>正文


Java Tick.isBullish方法代码示例

本文整理汇总了Java中org.ta4j.core.Tick.isBullish方法的典型用法代码示例。如果您正苦于以下问题:Java Tick.isBullish方法的具体用法?Java Tick.isBullish怎么用?Java Tick.isBullish使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.ta4j.core.Tick的用法示例。


在下文中一共展示了Tick.isBullish方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
 
开发者ID:ta4j,项目名称:ta4j,代码行数:19,代码来源:BullishHaramiIndicator.java

示例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;
}
 
开发者ID:ta4j,项目名称:ta4j,代码行数:19,代码来源:BearishHaramiIndicator.java

示例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;
}
 
开发者ID:ta4j,项目名称:ta4j,代码行数:19,代码来源:BearishEngulfingIndicator.java

示例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;
}
 
开发者ID:ta4j,项目名称:ta4j,代码行数:19,代码来源:BullishEngulfingIndicator.java

示例5: isBlackCrow

import org.ta4j.core.Tick; //导入方法依赖的package包/类
/**
 * @param index the current tick/candle index
 * @return true if the current tick/candle is a black crow, false otherwise
 */
private boolean isBlackCrow(int index) {
    Tick prevTick = series.getTick(index-1);
    Tick currTick = series.getTick(index);
    if (currTick.isBearish()) {
        if (prevTick.isBullish()) {
            // First crow case
            return hasVeryShortLowerShadow(index)
                    && currTick.getOpenPrice().isLessThan(prevTick.getMaxPrice());
        } else {
            return hasVeryShortLowerShadow(index) && isDeclining(index);
        }
    }
    return false;
}
 
开发者ID:ta4j,项目名称:ta4j,代码行数:19,代码来源:ThreeBlackCrowsIndicator.java

示例6: isWhiteSoldier

import org.ta4j.core.Tick; //导入方法依赖的package包/类
/**
 * @param index the current tick/candle index
 * @return true if the current tick/candle is a white soldier, false otherwise
 */
private boolean isWhiteSoldier(int index) {
    Tick prevTick = series.getTick(index-1);
    Tick currTick = series.getTick(index);
    if (currTick.isBullish()) {
        if (prevTick.isBearish()) {
            // First soldier case
            return hasVeryShortUpperShadow(index)
                    && currTick.getOpenPrice().isGreaterThan(prevTick.getMinPrice());
        } else {
            return hasVeryShortUpperShadow(index) && isGrowing(index);
        }
    }
    return false;
}
 
开发者ID:ta4j,项目名称:ta4j,代码行数:19,代码来源:ThreeWhiteSoldiersIndicator.java


注:本文中的org.ta4j.core.Tick.isBullish方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。