add OHLC plugin

This commit is contained in:
2018-05-26 23:19:12 -07:00
parent 476f3708f4
commit 26b199a4f9
9 changed files with 734 additions and 31 deletions

View 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);
}
}