本文整理汇总了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)));
}
示例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);
}
示例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));
}
示例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))));
}
示例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)));
}
示例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)));
}
示例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)))));
}
示例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);
}