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


Java Tick.getMaxPrice方法代码示例

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


在下文中一共展示了Tick.getMaxPrice方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: calculate

import org.ta4j.core.Tick; //导入方法依赖的package包/类
@Override
protected Decimal calculate(int index) {
    List<Integer> ticksOfPreviousPeriod = pivotPointIndicator.getTicksOfPreviousPeriod(index);
    if (ticksOfPreviousPeriod.isEmpty())
        return Decimal.NaN;
    Tick tick = getTimeSeries().getTick(ticksOfPreviousPeriod.get(0));
    Decimal high =  tick.getMaxPrice();
    Decimal low = tick.getMinPrice();
    for(int i: ticksOfPreviousPeriod){
        high = (getTimeSeries().getTick(i).getMaxPrice()).max(high);
        low = (getTimeSeries().getTick(i).getMinPrice()).min(low);
    }

    if (fibReversalTyp == FibReversalTyp.RESISTANCE) {
        return pivotPointIndicator.getValue(index).plus(fibonacciFactor.multipliedBy(high.minus(low)));
    }
    return pivotPointIndicator.getValue(index).minus(fibonacciFactor.multipliedBy(high.minus(low)));
}
 
开发者ID:ta4j,项目名称:ta4j,代码行数:19,代码来源:FibonacciReversalIndicator.java

示例2: calcPivotPoint

import org.ta4j.core.Tick; //导入方法依赖的package包/类
private Decimal calcPivotPoint(List<Integer> ticksOfPreviousPeriod) {
       if (ticksOfPreviousPeriod.isEmpty())
           return Decimal.NaN;
       Tick tick = getTimeSeries().getTick(ticksOfPreviousPeriod.get(0));
	Decimal close = tick.getClosePrice();
	Decimal high =  tick.getMaxPrice();
	Decimal low = tick.getMinPrice();
	for(int i: ticksOfPreviousPeriod){
		high = (getTimeSeries().getTick(i).getMaxPrice()).max(high);
		low = (getTimeSeries().getTick(i).getMinPrice()).min(low);
	}
	return (high.plus(low).plus(close)).dividedBy(Decimal.THREE);
}
 
开发者ID:ta4j,项目名称:ta4j,代码行数:14,代码来源:PivotPointIndicator.java

示例3: calcPivotPoint

import org.ta4j.core.Tick; //导入方法依赖的package包/类
private Decimal calcPivotPoint(List<Integer> ticksOfPreviousPeriod) {
       if (ticksOfPreviousPeriod.isEmpty())
           return Decimal.NaN;
       Tick tick = getTimeSeries().getTick(ticksOfPreviousPeriod.get(0));
	Decimal open = getTimeSeries().getTick(ticksOfPreviousPeriod.get(ticksOfPreviousPeriod.size()-1)).getOpenPrice();
       Decimal close = tick.getClosePrice();
	Decimal high =  tick.getMaxPrice();
	Decimal low = tick.getMinPrice();

       for(int i: ticksOfPreviousPeriod){
           high = (getTimeSeries().getTick(i).getMaxPrice()).max(high);
           low = (getTimeSeries().getTick(i).getMinPrice()).min(low);
       }

	Decimal x;

	if (close.isLessThan(open)){
	    x = high.plus(Decimal.TWO.multipliedBy(low)).plus(close);
       }
       else if (close.isGreaterThan(open)) {
           x = Decimal.TWO.multipliedBy(high).plus(low).plus(close);
       }
       else{
	    x = high.plus(low).plus(Decimal.TWO.multipliedBy(close));
       }

	return x.dividedBy(Decimal.valueOf(4));
}
 
开发者ID:ta4j,项目名称:ta4j,代码行数:29,代码来源:DeMarkPivotPointIndicator.java

示例4: calculateR3

import org.ta4j.core.Tick; //导入方法依赖的package包/类
private Decimal calculateR3(List<Integer> ticksOfPreviousPeriod, int index){
    Tick tick = getTimeSeries().getTick(ticksOfPreviousPeriod.get(0));
    Decimal low = tick.getMinPrice();
    Decimal high =  tick.getMaxPrice();
    for(int i: ticksOfPreviousPeriod){
        low = (getTimeSeries().getTick(i).getMinPrice()).min(low);
        high = (getTimeSeries().getTick(i).getMaxPrice()).max(high);
    }
    return high.plus(Decimal.TWO.multipliedBy((pivotPointIndicator.getValue(index).minus(low))));
}
 
开发者ID:ta4j,项目名称:ta4j,代码行数:11,代码来源:StandardReversalIndicator.java

示例5: calculateR2

import org.ta4j.core.Tick; //导入方法依赖的package包/类
private Decimal calculateR2(List<Integer> ticksOfPreviousPeriod, int index){
    Tick tick = getTimeSeries().getTick(ticksOfPreviousPeriod.get(0));
    Decimal low = tick.getMinPrice();
    Decimal high = tick.getMaxPrice();
    for(int i: ticksOfPreviousPeriod){
        low = (getTimeSeries().getTick(i).getMinPrice()).min(low);
        high = (getTimeSeries().getTick(i).getMaxPrice()).max(high);
    }
    return pivotPointIndicator.getValue(index).plus((high.minus(low)));
}
 
开发者ID:ta4j,项目名称:ta4j,代码行数:11,代码来源:StandardReversalIndicator.java

示例6: calculateS2

import org.ta4j.core.Tick; //导入方法依赖的package包/类
private Decimal calculateS2(List<Integer> ticksOfPreviousPeriod, int index){
    Tick tick = getTimeSeries().getTick(ticksOfPreviousPeriod.get(0));
    Decimal high =  tick.getMaxPrice();
    Decimal low = tick.getMinPrice();
    for(int i: ticksOfPreviousPeriod){
        high = (getTimeSeries().getTick(i).getMaxPrice()).max(high);
        low = (getTimeSeries().getTick(i).getMinPrice()).min(low);
    }
    return pivotPointIndicator.getValue(index).minus((high.minus(low)));
}
 
开发者ID:ta4j,项目名称:ta4j,代码行数:11,代码来源:StandardReversalIndicator.java

示例7: calculateS3

import org.ta4j.core.Tick; //导入方法依赖的package包/类
private Decimal calculateS3(List<Integer> ticksOfPreviousPeriod, int index){
    Tick tick = getTimeSeries().getTick(ticksOfPreviousPeriod.get(0));
    Decimal high =  tick.getMaxPrice();
    Decimal low = tick.getMinPrice();
    for(int i: ticksOfPreviousPeriod){
        high = (getTimeSeries().getTick(i).getMaxPrice()).max(high);
        low = (getTimeSeries().getTick(i).getMinPrice()).min(low);
    }
    return low.minus(Decimal.TWO.multipliedBy((high.minus(pivotPointIndicator.getValue(index)))));
}
 
开发者ID:ta4j,项目名称:ta4j,代码行数:11,代码来源:StandardReversalIndicator.java

示例8: calculateSupport

import org.ta4j.core.Tick; //导入方法依赖的package包/类
private Decimal calculateSupport(Decimal x, int index){
    List<Integer> ticksOfPreviousPeriod = pivotPointIndicator.getTicksOfPreviousPeriod(index);
    if (ticksOfPreviousPeriod.isEmpty()) {
        return Decimal.NaN;
    }
    Tick tick = getTimeSeries().getTick(ticksOfPreviousPeriod.get(0));
    Decimal high = tick.getMaxPrice();
    for(int i: ticksOfPreviousPeriod){
        high = getTimeSeries().getTick(i).getMaxPrice().max(high);
    }

    return x.dividedBy(Decimal.TWO).minus(high);
}
 
开发者ID:ta4j,项目名称:ta4j,代码行数:14,代码来源:DeMarkReversalIndicator.java


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