@Deprecated public abstract class AbstractPatternIndicator extends java.lang.Object implements IIndicator, IDrawingIndicator
Modifier and Type | Class and Description |
---|---|
static class |
AbstractPatternIndicator.IndexValue
Deprecated.
|
static class |
AbstractPatternIndicator.PatternIndicatorOutput
Deprecated.
|
static class |
AbstractPatternIndicator.PatternObject
Deprecated.
|
Modifier and Type | Field and Description |
---|---|
protected static int |
BARS_FORWARD_UNTIL_CROSS
Deprecated.
|
protected static java.lang.String |
CLOSE_PRICE
Deprecated.
|
protected static java.lang.String |
HIGH_LOW_PRICES
Deprecated.
|
protected static double |
HUNDRED_PERCENT
Deprecated.
|
protected static int |
MAXIMAL_INCREMENT_COUNT
Deprecated.
|
protected static int |
OUTPUT_COUNT_FOR_ONE_SUBINDICATOR
Deprecated.
|
protected static double |
PERCENT_MULTIPLYER
Deprecated.
|
Constructor and Description |
---|
AbstractPatternIndicator()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static double |
a(double x1,
double y1,
double x2,
double y2)
Deprecated.
|
static double |
angleBetween2LinesDegrees(java.awt.geom.Line2D line1,
java.awt.geom.Line2D line2)
Deprecated.
|
static double |
angleBetween2LinesRadians(java.awt.geom.Line2D line1,
java.awt.geom.Line2D line2)
Deprecated.
|
protected double |
angleBetweenAsymptotesInDegrees(double[] cleanPattern,
double[] dirtyPattern,
int dirtyPatternStartIndex,
int dirtyPatternSize,
int[] firstAsymptoteIndices,
int[] secondAsymptoteIndices)
Deprecated.
|
protected boolean |
aproxEqual(double v1,
double v2)
Deprecated.
|
protected boolean |
aproxEqual(double v1,
double v2,
double eps)
Deprecated.
|
protected boolean |
aproxEqual(double v1,
double v2,
double v3,
double eps)
Deprecated.
|
protected boolean |
aproxEqualTriple(double v1,
double v2,
double v3)
Deprecated.
|
protected boolean |
areParallel(double[] cleanPattern,
double[] dirtyPattern,
int dirtyPatternStartIndex,
int dirtyPatternSize,
int[] firstAsymptoteIndices,
int[] secondAsymptoteIndices)
Deprecated.
|
static double |
average(double... array)
Deprecated.
|
protected double |
averageValueForIndicies(double[] cleanPattern,
double[] dirtyPattern,
int dirtyPatternStartIndex,
int dirtyPatternSize,
int[] indicies)
Deprecated.
|
static double |
b(double x1,
double y1,
double a)
Deprecated.
|
IndicatorResult |
calculate(int startIndex,
int endIndex)
Deprecated.
Calculates values of the indicator from startIndex to endIndex of input parameter and places them in output parameters
|
protected double |
calculateCrossIndex(double[] cleanPattern,
double[] source,
int sourceStartIndex,
int dirtyPatternSize,
int[] firstAsymptoteIndices,
int[] secondAsymptoteIndices)
Deprecated.
|
protected double |
calculateCrossIndex(double[] cleanPattern,
double[] dirtyPattern,
int dirtyPatternStartIndex,
int dirtyPatternSize,
int[] firstAsymptoteIndices,
int[] secondAsymptoteIndices,
double secondAsymptoteAverageValue)
Deprecated.
|
protected double |
calculateCrossIndex(double x11,
double y11,
double x12,
double y12,
double x21,
double y21,
double x22,
double y22)
Deprecated.
|
protected double |
calculateLastAsymptoteIndex(double[] cleanPattern,
double[] source,
int sourceStartIndex,
int dirtyPatternSize,
double priceBorderDontCross,
int[] asymptoteLinePriceIndices)
Deprecated.
|
protected IndicatorResult |
calculatePivotPoints(double[][][] inputs,
double[] pivotPointsArray,
java.lang.Object[] pattern,
java.lang.Object[] firstAsymptote,
java.lang.Object[] secondAsymptote,
int barsOnSides,
int startIndex,
int endIndex)
Deprecated.
|
protected boolean |
checkGapsRange(double[] gapSizes)
Deprecated.
|
protected abstract boolean |
checkPattern(double[] cleanPattern,
double[] pivotPointsData,
int dirtyPatterStartIndex,
int dirtyPatternSize)
Deprecated.
|
protected abstract AbstractPatternIndicator.IndexValue[] |
constructBottomAsymptote(double[] cleanPattern,
double[] pivotPointsData,
int dirtyPatternStartIndex,
int dirtyPatternSize)
Deprecated.
|
protected AbstractPatternIndicator.IndexValue[] |
constructDiagonalAsymptote(double[] cleanPattern,
double[] source,
int sourceStartIndex,
int dirtyPatternSize,
int[] asymptoteLinePriceIndices)
Deprecated.
|
protected AbstractPatternIndicator.IndexValue[] |
constructDiagonalAsymptoteUntilCross(double[] cleanPattern,
double[] dirtyPattern,
int dirtyPatternStartIndex,
int dirtyPatternSize,
int[] asymptoteLinePriceIndices,
int[] secondCrossingAsymptoteLinePriceIndices)
Deprecated.
|
protected AbstractPatternIndicator.IndexValue[] |
constructDiagonalAsymptoteUntilCrossWithHorizontal(double[] cleanPattern,
double[] dirtyPattern,
int dirtyPatternStartIndex,
int dirtyPatternSize,
int[] diagonalAsymptoteLinePriceIndices,
int[] horizontalAsymptoteLinePriceIndices)
Deprecated.
|
protected AbstractPatternIndicator.IndexValue[] |
constructHorizontalAsymptote(double[] cleanPattern,
double[] source,
int sourceStartIndex,
int dirtyPatternSize,
int[] asymptoteLinePriceIndices)
Deprecated.
|
protected AbstractPatternIndicator.IndexValue[] |
constructHorizontalAsymptoteUntilCross(double[] cleanPattern,
double[] dirtyPattern,
int dirtyPatternStartIndex,
int dirtyPatternSize,
int[] horizontalAsymptoteLinePriceIndices,
int[] secondCrossingAsymptoteLinePriceIndices)
Deprecated.
|
protected AbstractPatternIndicator.IndexValue[] |
constructPattern(double[] cleanPattern,
double[] pivotPointsData,
int pivotPointsDataStartIndex,
int pivotPointsDataDirtyPatternSize)
Deprecated.
|
protected abstract AbstractPatternIndicator.IndexValue[] |
constructUppperAsymptote(double[] cleanPattern,
double[] pivotPointsData,
int dirtyPatternStartIndex,
int dirtyPatternSize)
Deprecated.
|
protected OutputParameterInfo |
createFirstAsymptoteInfo()
Deprecated.
|
protected abstract IndicatorInfo |
createIndicatorInfo()
Deprecated.
|
protected InputParameterInfo[] |
createInputParameterInfo()
Deprecated.
|
protected OptInputParameterInfo |
createNumberOfBarsOnSidesStartCountInfo()
Deprecated.
|
protected OptInputParameterInfo[] |
createOptInputParameterInfo()
Deprecated.
|
protected OutputParameterInfo[] |
createOutputParameterInfo()
Deprecated.
|
protected OutputParameterInfo |
createPatterCurveInfo()
Deprecated.
|
protected OptInputParameterInfo |
createPatternInaccuracy()
Deprecated.
|
protected OptInputParameterInfo |
createPriceForPivotPointsCalculationInfo()
Deprecated.
|
protected OutputParameterInfo |
createSecondAsymptoteInfo()
Deprecated.
|
protected OptInputParameterInfo |
createWholePatternCalculationInfo()
Deprecated.
|
protected void |
drawIndexValues(AbstractPatternIndicator.IndexValue[] indexValues,
java.awt.Graphics2D g,
IIndicatorDrawingSupport indicatorDrawingSupport,
int index)
Deprecated.
|
java.awt.Point |
drawOutput(java.awt.Graphics g,
int outputIdx,
java.lang.Object values,
java.awt.Color color,
java.awt.Stroke stroke,
IIndicatorDrawingSupport indicatorDrawingSupport,
java.util.List<java.awt.Shape> shapes,
java.util.Map<java.awt.Color,java.util.List<java.awt.Point>> handles)
Deprecated.
This method will be called once for every output marked as drawnByIndicator every time the chart surface needs to be redrawn
|
protected void |
drawPatternLine(AbstractPatternIndicator.IndexValue[] indexValues,
int currentIndex,
java.awt.Graphics2D g,
int x1,
int y1,
int x2,
int y2)
Deprecated.
|
protected int |
getBarsOnSidesIncrementCount()
Deprecated.
|
protected int |
getBarsOnSidesStartCount()
Deprecated.
|
protected java.lang.String |
getDefaultPatternRecognitionGroup()
Deprecated.
|
IndicatorInfo |
getIndicatorInfo()
Deprecated.
Returns object that describes indicator, how many inputs, outputs it has, where it should be shown etc
|
InputParameterInfo |
getInputParameterInfo(int index)
Deprecated.
Returns object that describes one of the inputs
|
int |
getLookback()
Deprecated.
Returns number of elements needed to calculate value of the first element.
|
int |
getLookforward()
Deprecated.
Returns number of elements after last element needed to calculate value of the last element.
|
protected int |
getNumberOfOutputs()
Deprecated.
|
protected int |
getNumberOfOutputsForOneSubindicator()
Deprecated.
|
OptInputParameterInfo |
getOptInputParameterInfo(int index)
Deprecated.
Returns object that describes optional input
|
protected OptInputParameterInfo[] |
getOptInputParameterInfos()
Deprecated.
|
OutputParameterInfo |
getOutputParameterInfo(int index)
Deprecated.
Returns object that describes output
|
protected abstract int |
getPatternPivotPointNumber()
Deprecated.
|
protected double |
getPatternQuality()
Deprecated.
|
protected java.lang.String |
getPivotPointCalculationPrice()
Deprecated.
|
protected double |
getReversedPatternQuality()
Deprecated.
|
protected double[] |
indicesToValues(double[] source,
int[] indices)
Deprecated.
|
protected boolean |
isUseful(double value)
Deprecated.
|
protected boolean |
isWholePatternCalculation()
Deprecated.
|
void |
onStart(IIndicatorContext context)
Deprecated.
Called on indicator initialization
|
protected void |
setBarsOnSidesStartCount(int barsOnSidesStartCount)
Deprecated.
|
void |
setInputParameter(int index,
java.lang.Object array)
Deprecated.
Sets input parameter.
|
void |
setOptInputParameter(int index,
java.lang.Object value)
Deprecated.
Sets optional input parameter.
|
void |
setOutputParameter(int index,
java.lang.Object array)
Deprecated.
Sets output parameter.
|
protected void |
setPatternQuality(double patternQuality)
Deprecated.
|
protected void |
setPivotPointCalculationPrice(java.lang.String pivotPointCalculationPrice)
Deprecated.
|
protected void |
setWholePatternCalculation(boolean wholePatternCalculation)
Deprecated.
|
protected boolean |
willAsymptotesCrossBeforeBarsCount(double[] cleanPattern,
double[] dirtyPattern,
int dirtyPatternStartIndex,
int dirtyPatternSize,
int[] firstAsymptoteIndices,
int[] secondAsymptoteIndices,
double secondAsymptoteAverageValue,
int unitsCount)
Deprecated.
|
protected boolean |
willAsymptotesCrossForUnitsCount(double[] cleanPattern,
double[] dirtyPattern,
int dirtyPatternStartIndex,
int dirtyPatternSize,
int[] firstAsymptoteIndices,
int[] secondAsymptoteIndices,
int unitsCount)
Deprecated.
|
protected boolean |
willAsymptotesCrossUntilPatternEnd(double[] cleanPattern,
double[] dirtyPattern,
int dirtyPatternStartIndex,
int dirtyPatternSize,
int[] firstAsymptoteIndices,
int[] secondAsymptoteIndices)
Deprecated.
|
protected boolean |
willAsymptotesCrossUntilPatternEnd(double[] cleanPattern,
double[] dirtyPattern,
int dirtyPatternStartIndex,
int dirtyPatternSize,
int[] firstAsymptoteIndices,
int[] secondAsymptoteIndices,
double secondAsymptoteAverageValue)
Deprecated.
|
static double |
x4y(double x1,
double y1,
double x2,
double y2,
double y3)
Deprecated.
|
static double |
xCross(double a1,
double b1,
double a2,
double b2)
Deprecated.
|
static double |
y4x(double x1,
double y1,
double x2,
double y2,
double x3)
Deprecated.
|
protected static final double PERCENT_MULTIPLYER
protected static final double HUNDRED_PERCENT
protected static final int MAXIMAL_INCREMENT_COUNT
protected static final int OUTPUT_COUNT_FOR_ONE_SUBINDICATOR
protected static final java.lang.String CLOSE_PRICE
protected static final java.lang.String HIGH_LOW_PRICES
protected static final int BARS_FORWARD_UNTIL_CROSS
protected abstract IndicatorInfo createIndicatorInfo()
protected abstract int getPatternPivotPointNumber()
protected abstract boolean checkPattern(double[] cleanPattern, double[] pivotPointsData, int dirtyPatterStartIndex, int dirtyPatternSize)
protected abstract AbstractPatternIndicator.IndexValue[] constructUppperAsymptote(double[] cleanPattern, double[] pivotPointsData, int dirtyPatternStartIndex, int dirtyPatternSize)
protected abstract AbstractPatternIndicator.IndexValue[] constructBottomAsymptote(double[] cleanPattern, double[] pivotPointsData, int dirtyPatternStartIndex, int dirtyPatternSize)
public void onStart(IIndicatorContext context)
IIndicator
onStart
in interface IIndicator
context
- allows access to system functionalitypublic IndicatorResult calculate(int startIndex, int endIndex)
IIndicator
calculate
in interface IIndicator
startIndex
- index of the first element in input parameters that needs corresponding indicator value. That doesn't mean that values
before startIndex will not be read, they will be if lookback is more than 0. That also doesn't mean that value for startIndex will be
calculated, it will be not if startIndex < lookback. IndicatorResult.getFirstValueIndex()
returns index of the first element that
has corresponding calculated value in output array(s)endIndex
- index of the last element in input parameters that needs corresponding indicator valueprotected IndicatorResult calculatePivotPoints(double[][][] inputs, double[] pivotPointsArray, java.lang.Object[] pattern, java.lang.Object[] firstAsymptote, java.lang.Object[] secondAsymptote, int barsOnSides, int startIndex, int endIndex)
protected AbstractPatternIndicator.IndexValue[] constructPattern(double[] cleanPattern, double[] pivotPointsData, int pivotPointsDataStartIndex, int pivotPointsDataDirtyPatternSize)
protected AbstractPatternIndicator.IndexValue[] constructDiagonalAsymptoteUntilCrossWithHorizontal(double[] cleanPattern, double[] dirtyPattern, int dirtyPatternStartIndex, int dirtyPatternSize, int[] diagonalAsymptoteLinePriceIndices, int[] horizontalAsymptoteLinePriceIndices)
protected AbstractPatternIndicator.IndexValue[] constructHorizontalAsymptoteUntilCross(double[] cleanPattern, double[] dirtyPattern, int dirtyPatternStartIndex, int dirtyPatternSize, int[] horizontalAsymptoteLinePriceIndices, int[] secondCrossingAsymptoteLinePriceIndices)
protected AbstractPatternIndicator.IndexValue[] constructHorizontalAsymptote(double[] cleanPattern, double[] source, int sourceStartIndex, int dirtyPatternSize, int[] asymptoteLinePriceIndices)
protected AbstractPatternIndicator.IndexValue[] constructDiagonalAsymptoteUntilCross(double[] cleanPattern, double[] dirtyPattern, int dirtyPatternStartIndex, int dirtyPatternSize, int[] asymptoteLinePriceIndices, int[] secondCrossingAsymptoteLinePriceIndices)
protected AbstractPatternIndicator.IndexValue[] constructDiagonalAsymptote(double[] cleanPattern, double[] source, int sourceStartIndex, int dirtyPatternSize, int[] asymptoteLinePriceIndices)
protected double calculateCrossIndex(double x11, double y11, double x12, double y12, double x21, double y21, double x22, double y22)
protected double calculateCrossIndex(double[] cleanPattern, double[] dirtyPattern, int dirtyPatternStartIndex, int dirtyPatternSize, int[] firstAsymptoteIndices, int[] secondAsymptoteIndices, double secondAsymptoteAverageValue)
protected double calculateCrossIndex(double[] cleanPattern, double[] source, int sourceStartIndex, int dirtyPatternSize, int[] firstAsymptoteIndices, int[] secondAsymptoteIndices)
protected double calculateLastAsymptoteIndex(double[] cleanPattern, double[] source, int sourceStartIndex, int dirtyPatternSize, double priceBorderDontCross, int[] asymptoteLinePriceIndices)
protected double[] indicesToValues(double[] source, int[] indices)
protected boolean areParallel(double[] cleanPattern, double[] dirtyPattern, int dirtyPatternStartIndex, int dirtyPatternSize, int[] firstAsymptoteIndices, int[] secondAsymptoteIndices)
protected double angleBetweenAsymptotesInDegrees(double[] cleanPattern, double[] dirtyPattern, int dirtyPatternStartIndex, int dirtyPatternSize, int[] firstAsymptoteIndices, int[] secondAsymptoteIndices)
public static double angleBetween2LinesDegrees(java.awt.geom.Line2D line1, java.awt.geom.Line2D line2)
public static double angleBetween2LinesRadians(java.awt.geom.Line2D line1, java.awt.geom.Line2D line2)
protected boolean willAsymptotesCrossUntilPatternEnd(double[] cleanPattern, double[] dirtyPattern, int dirtyPatternStartIndex, int dirtyPatternSize, int[] firstAsymptoteIndices, int[] secondAsymptoteIndices, double secondAsymptoteAverageValue)
protected boolean willAsymptotesCrossUntilPatternEnd(double[] cleanPattern, double[] dirtyPattern, int dirtyPatternStartIndex, int dirtyPatternSize, int[] firstAsymptoteIndices, int[] secondAsymptoteIndices)
protected boolean willAsymptotesCrossBeforeBarsCount(double[] cleanPattern, double[] dirtyPattern, int dirtyPatternStartIndex, int dirtyPatternSize, int[] firstAsymptoteIndices, int[] secondAsymptoteIndices, double secondAsymptoteAverageValue, int unitsCount)
protected boolean willAsymptotesCrossForUnitsCount(double[] cleanPattern, double[] dirtyPattern, int dirtyPatternStartIndex, int dirtyPatternSize, int[] firstAsymptoteIndices, int[] secondAsymptoteIndices, int unitsCount)
public IndicatorInfo getIndicatorInfo()
IIndicator
getIndicatorInfo
in interface IIndicator
public InputParameterInfo getInputParameterInfo(int index)
IIndicator
getInputParameterInfo
in interface IIndicator
index
- index of the inputpublic int getLookback()
IIndicator
getLookback
in interface IIndicator
public int getLookforward()
IIndicator
getLookforward
in interface IIndicator
public OptInputParameterInfo getOptInputParameterInfo(int index)
IIndicator
getOptInputParameterInfo
in interface IIndicator
index
- index of the optional inputpublic OutputParameterInfo getOutputParameterInfo(int index)
IIndicator
getOutputParameterInfo
in interface IIndicator
index
- index of the outputpublic void setInputParameter(int index, java.lang.Object array)
IIndicator
setInputParameter
in interface IIndicator
index
- index of the parameterarray
- array of the doubles, ints or prices represented as double[][]public void setOptInputParameter(int index, java.lang.Object value)
IIndicator
setOptInputParameter
in interface IIndicator
index
- index of the parametervalue
- int or double valuepublic void setOutputParameter(int index, java.lang.Object array)
IIndicator
IIndicator.calculate(int, int)
callsetOutputParameter
in interface IIndicator
index
- index of the parameterarray
- array of doubles or ints enough to hold values from startIndex to endIndexpublic java.awt.Point drawOutput(java.awt.Graphics g, int outputIdx, java.lang.Object values, java.awt.Color color, java.awt.Stroke stroke, IIndicatorDrawingSupport indicatorDrawingSupport, java.util.List<java.awt.Shape> shapes, java.util.Map<java.awt.Color,java.util.List<java.awt.Point>> handles)
IDrawingIndicator
drawOutput
in interface IDrawingIndicator
g
- graphical contextoutputIdx
- index of the output parametervalues
- array of values (int[], double[] or Object[] depending of the type of the output). Array may be empty or null if data is not yet available.color
- color selected when the indicator was addedstroke
- stroke selected when the indicator was addedindicatorDrawingSupport
- provides information about candle positions, indexes, etcshapes
- graphical shapes can be added to this list. This makes it possible to show correct popup when user right-clicks one of the shapes in this list on charthandles
- coordinate points with their corresponding colors can be added to this listnull
is returned.protected void drawIndexValues(AbstractPatternIndicator.IndexValue[] indexValues, java.awt.Graphics2D g, IIndicatorDrawingSupport indicatorDrawingSupport, int index)
protected void drawPatternLine(AbstractPatternIndicator.IndexValue[] indexValues, int currentIndex, java.awt.Graphics2D g, int x1, int y1, int x2, int y2)
public static double y4x(double x1, double y1, double x2, double y2, double x3)
public static double x4y(double x1, double y1, double x2, double y2, double y3)
public static double a(double x1, double y1, double x2, double y2)
public static double b(double x1, double y1, double a)
public static double xCross(double a1, double b1, double a2, double b2)
protected double averageValueForIndicies(double[] cleanPattern, double[] dirtyPattern, int dirtyPatternStartIndex, int dirtyPatternSize, int[] indicies)
public static double average(double... array)
protected boolean aproxEqualTriple(double v1, double v2, double v3)
protected boolean aproxEqual(double v1, double v2)
protected boolean aproxEqual(double v1, double v2, double v3, double eps)
protected boolean aproxEqual(double v1, double v2, double eps)
protected boolean checkGapsRange(double[] gapSizes)
protected boolean isUseful(double value)
protected InputParameterInfo[] createInputParameterInfo()
protected OutputParameterInfo[] createOutputParameterInfo()
protected OptInputParameterInfo[] createOptInputParameterInfo()
protected OutputParameterInfo createSecondAsymptoteInfo()
protected OutputParameterInfo createFirstAsymptoteInfo()
protected OutputParameterInfo createPatterCurveInfo()
protected OptInputParameterInfo createNumberOfBarsOnSidesStartCountInfo()
protected OptInputParameterInfo createPriceForPivotPointsCalculationInfo()
protected OptInputParameterInfo createWholePatternCalculationInfo()
protected OptInputParameterInfo createPatternInaccuracy()
protected java.lang.String getDefaultPatternRecognitionGroup()
protected int getNumberOfOutputs()
protected int getNumberOfOutputsForOneSubindicator()
protected int getBarsOnSidesStartCount()
protected void setBarsOnSidesStartCount(int barsOnSidesStartCount)
protected int getBarsOnSidesIncrementCount()
protected OptInputParameterInfo[] getOptInputParameterInfos()
protected double getReversedPatternQuality()
protected double getPatternQuality()
protected void setPatternQuality(double patternQuality)
protected java.lang.String getPivotPointCalculationPrice()
protected void setPivotPointCalculationPrice(java.lang.String pivotPointCalculationPrice)
protected boolean isWholePatternCalculation()
protected void setWholePatternCalculation(boolean wholePatternCalculation)
Copyright © 2024. All rights reserved.