org.otfeed.event
Class OTOHLC

java.lang.Object
  extended by org.otfeed.event.OTOHLC
All Implemented Interfaces:
java.lang.Comparable<OTOHLC>

public final class OTOHLC
extends java.lang.Object
implements java.lang.Comparable<OTOHLC>

This class provides historical OHLC values (open, high, low, and close prices) for the requested time period. Also it provides the volume value (the accumulated number of shares) in the requested time period. In cases when there were not any transactions within certain time period, all the price values, as well as the volume value, are set to zero.


Constructor Summary
OTOHLC()
          Default constructor.
OTOHLC(java.util.Date timestamp, double openPrice, double highPrice, double lowPrice, double closePrice, long volume)
          Constructor.
 
Method Summary
 int compareTo(OTOHLC other)
           
 boolean equals(java.lang.Object o)
           
 double getClosePrice()
           
 double getHighPrice()
           
 double getLowPrice()
           
 double getOpenPrice()
           
 java.util.Date getTimestamp()
           
 long getVolume()
           
 int hashCode()
           
 void setClosePrice(double closePrice)
          Sets close price.
 void setHighPrice(double highPrice)
          Sets high price.
 void setLowPrice(double lowPrice)
          Sets low price.
 void setOpenPrice(double openPrice)
          Sets open price.
 void setTimestamp(java.util.Date timestamp)
          Sets time of the event.
 void setVolume(long volume)
          Sets accumulated volume for the requested time period.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OTOHLC

public OTOHLC()
Default constructor.


OTOHLC

public OTOHLC(java.util.Date timestamp,
              double openPrice,
              double highPrice,
              double lowPrice,
              double closePrice,
              long volume)
Constructor.

Parameters:
timestamp - Time when the event occurred.
openPrice - Open price.
highPrice - High price.
lowPrice - Low price.
closePrice - Close price.
volume - Accumulated volume for the requested time period.
Method Detail

getTimestamp

public java.util.Date getTimestamp()
Returns:
Starting time of the time period.

setTimestamp

public void setTimestamp(java.util.Date timestamp)
Sets time of the event.

Parameters:
timestamp - Time when the event occurred.

getOpenPrice

public double getOpenPrice()
Returns:
High price.

setOpenPrice

public void setOpenPrice(double openPrice)
Sets open price.

Parameters:
openPrice - Open price.

getHighPrice

public double getHighPrice()
Returns:
High price.

setHighPrice

public void setHighPrice(double highPrice)
Sets high price.

Parameters:
highPrice - High price.

getLowPrice

public double getLowPrice()
Returns:
Low Price.

setLowPrice

public void setLowPrice(double lowPrice)
Sets low price.

Parameters:
lowPrice - Low price.

getClosePrice

public double getClosePrice()
Returns:
Close price.

setClosePrice

public void setClosePrice(double closePrice)
Sets close price.

Parameters:
closePrice - Close price.

getVolume

public long getVolume()
Returns:
Accumulated volume for the requested time period.

setVolume

public void setVolume(long volume)
Sets accumulated volume for the requested time period.

Parameters:
volume - Accumulated volume for the requested time period.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(OTOHLC other)
Specified by:
compareTo in interface java.lang.Comparable<OTOHLC>


Copyright © 2007 Mike Kroutikov. All Rights Reserved.