本文整理匯總了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);
}