Files
ATS_Esper/src/main/java/ats/plugin/OHLCValue.java
2018-05-26 23:19:12 -07:00

55 lines
1011 B
Java

package ats.plugin;
import org.joda.time.DateTime;
/**
* OHLCValue stores one bar of OHLC info.
*/
public class OHLCValue {
private DateTime time;
private double open;
private double high;
private double low;
private double close;
public OHLCValue(DateTime time,
double open, double high,
double low, double close)
{
this.time = time;
this.open = open;
this.high = high;
this.low = low;
this.close = close;
}
public DateTime getTime() {
return time;
}
public Double getOpen() {
return open;
}
public Double getHigh() {
return high;
}
public Double getLow() {
return low;
}
public Double getClose() {
return close;
}
/**
* Return a human readable representation of this event.
*/
public String toString() {
return String.format("OHLCValue[%s,open=%s,high=%s,low=%s,close=%s]",
time, open, high, low, close);
}
}