add OHLC plugin
This commit is contained in:
54
src/main/java/ats/plugin/OHLCValue.java
Normal file
54
src/main/java/ats/plugin/OHLCValue.java
Normal file
@ -0,0 +1,54 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user