Class AntherPosition
java.lang.Object
com.bluebell.greenhouse.anther.models.position.AntherPosition
- All Implemented Interfaces:
Comparable<AntherPosition>
Class representation of a position taken in an
AntherTradingStrategy.- Version:
- 2.0.3
- Author:
- Stephen Prizio
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublecalculateProfit(double pricePerPoint) Calculates the total profit for this position.intDefines the sort order.booleanDefines an object's equivalence with this entity.doubleReturns the net points gained/lost by comparing the open and closing price.longReturns the duration of the position in minutes.inthashCode()Computes the hash code.booleanisLong()Returns whether the position is a short or long position.
-
Constructor Details
-
AntherPosition
public AntherPosition()
-
-
Method Details
-
getPoints
public double getPoints()Returns the net points gained/lost by comparing the open and closing price.- Returns:
- close price - open price
-
getPositionDuration
public long getPositionDuration()Returns the duration of the position in minutes.- Returns:
- time between position open and close time
-
calculateProfit
public double calculateProfit(double pricePerPoint) Calculates the total profit for this position.- Parameters:
pricePerPoint- price per point- Returns:
- price per point * net points
-
isLong
public boolean isLong()Returns whether the position is a short or long position.- Returns:
- true if long, false if short
-
compareTo
Defines the sort order.- Specified by:
compareToin interfaceComparable<AntherPosition>- Parameters:
o-AntherPosition- Returns:
- sort order
-
equals
-
hashCode
-