Class SwingPoint

java.lang.Object
com.motivewave.platform.sdk.common.SwingPoint
All Implemented Interfaces:
Comparable<SwingPoint>

public class SwingPoint extends Object implements Comparable<SwingPoint>
Identifies a swing point (local high or low) on a chart.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SwingPoint(boolean top, int index, long time, double value, int strLeft, int strRight)
    Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Compares this swing point to another point This is used to sort swing points by time.
    double
    Gets the average strength of this swing point ((left strength +right strength)/2)
    Gets the coordinate for the swing point (time, value).
    int
    Index of the bar in the data series.
    int
    Gets the strength of this swing point (minimum of left and right strength).
    int
    Gets the number of bars to the left of this point.
    int
    Gets the number of bars to the right of this point.
    long
    Gets the start time of the bar in the data series (milliseconds since 1970).
    double
    Gets the value of the bar (high for top, low for bottom) in the data series.
    boolean
    Determines if this is a bottom swing point (local low).
    boolean
    Determines if this is a top swing point (local high).
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • SwingPoint

      public SwingPoint(boolean top, int index, long time, double value, int strLeft, int strRight)
      Constructor
      Parameters:
      top - true if this is a top swing point (local high)
      index - index in the data series
      time - time of the swing point bar (milliseconds since 1970)
      value - value of the swing point bar
      strLeft - left strength (number of bars to the left of this point)
      strRight - right strength (number of bars to the right of this point)
  • Method Details

    • isTop

      public boolean isTop()
      Determines if this is a top swing point (local high).
      Returns:
      true if this is a top swing point
    • isBottom

      public boolean isBottom()
      Determines if this is a bottom swing point (local low).
      Returns:
      true if this is a bottom swing point
    • getStrengthLeft

      public int getStrengthLeft()
      Gets the number of bars to the left of this point.
      Returns:
      number of bars to the left of this point
    • getStrengthRight

      public int getStrengthRight()
      Gets the number of bars to the right of this point.
      Returns:
      number of bars to the right of this point
    • getIndex

      public int getIndex()
      Index of the bar in the data series.
      Returns:
      index of the bar in the data series
    • getTime

      public long getTime()
      Gets the start time of the bar in the data series (milliseconds since 1970).
      Returns:
      start time of the bar in the data series
    • getValue

      public double getValue()
      Gets the value of the bar (high for top, low for bottom) in the data series.
      Returns:
      value of the swing point bar
    • getCoordinate

      public Coordinate getCoordinate()
      Gets the coordinate for the swing point (time, value).
      Returns:
      coordinate for the swing point
    • getStrength

      public int getStrength()
      Gets the strength of this swing point (minimum of left and right strength).
      Returns:
      strength of this swing point
    • getAvgStrength

      public double getAvgStrength()
      Gets the average strength of this swing point ((left strength +right strength)/2)
      Returns:
      average strength of this swing point
    • compareTo

      public int compareTo(SwingPoint sp)
      Compares this swing point to another point This is used to sort swing points by time.
      Specified by:
      compareTo in interface Comparable<SwingPoint>
    • toString

      public String toString()
      Overrides:
      toString in class Object