public class SwingPoint extends java.lang.Object implements java.lang.Comparable<SwingPoint>
Constructor and Description |
---|
SwingPoint(boolean top,
int index,
long time,
double value,
int strLeft,
int strRight)
Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(SwingPoint sp)
Compares this swing point to another point
This is used to sort swing points by time.
|
double |
getAvgStrength()
Gets the average strength of this swing point ((left strength +right strength)/2)
|
Coordinate |
getCoordinate()
Gets the coordinate for the swing point (time, value).
|
int |
getIndex()
Index of the bar in the data series.
|
int |
getStrength()
Gets the strength of this swing point (minimum of left and right strength).
|
int |
getStrengthLeft()
Gets the number of bars to the left of this point.
|
int |
getStrengthRight()
Gets the number of bars to the right of this point.
|
long |
getTime()
Gets the start time of the bar in the data series (milliseconds since 1970).
|
double |
getValue()
Gets the value of the bar (high for top, low for bottom) in the data series.
|
boolean |
isBottom()
Determines if this is a bottom swing point (local low).
|
boolean |
isTop()
Determines if this is a top swing point (local high).
|
public SwingPoint(boolean top, int index, long time, double value, int strLeft, int strRight)
top
- true if this is a top swing point (local high)index
- index in the data seriestime
- time of the swing point bar (milliseconds since 1970)value
- value of the swing point barstrLeft
- left strength (number of bars to the left of this point)strRight
- right strength (number of bars to the right of this point)public boolean isTop()
public boolean isBottom()
public int getStrengthLeft()
public int getStrengthRight()
public int getIndex()
public long getTime()
public double getValue()
public Coordinate getCoordinate()
public int getStrength()
public double getAvgStrength()
public int compareTo(SwingPoint sp)
compareTo
in interface java.lang.Comparable<SwingPoint>