當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。