Replace OHLCValueEvent

This commit is contained in:
2018-11-14 20:53:09 -08:00
parent 92c3636d8f
commit 8cf12a27fb
3 changed files with 14 additions and 57 deletions

View File

@ -16,7 +16,6 @@ import org.slf4j.LoggerFactory;
import ats.orders.MarketOrderRequest;
import ats.plugin.OHLCEvent;
import ats.plugin.OHLCPlugInViewFactory;
import ats.plugin.OHLCValueEvent;
public class EsperProcessor implements TickProcessor {
@ -36,7 +35,6 @@ public class EsperProcessor implements TickProcessor {
// register event types defined in java classes
config.addEventType(TickEvent.class);
config.addEventType(OHLCEvent.class);
config.addEventType(OHLCValueEvent.class);
config.addEventType(DateTime.class);
// add OHLC plugin

View File

@ -1,42 +0,0 @@
package ats.plugin;
import org.joda.time.DateTime;
/**
* OHLCValueEvent stores one bar of OHLC info.
*/
public class OHLCValueEvent extends OHLCEvent {
private double value;
public OHLCValueEvent() {
this(null, 0, 0, 0, 0, 0);
}
public OHLCValueEvent(DateTime time,
double open, double high,
double low, double close,
double value)
{
super(time, open, high, low, close);
this.value = value;
}
public static OHLCValueEvent make(DateTime time,
double open, double high,
double low, double close,
double value)
{
return new OHLCValueEvent(time, open, high, low, close, value);
}
public Double getValue() { return value; }
/**
* Return a human readable representation of this event.
*/
public String toString() {
return String.format("OHLCValueEvent[%s, open=%.3f, high=%.3f, low=%.3f, close=%.3f, value=%.3f]",
getTime(), getOpen(), getHigh(), getLow(), getClose(), value);
}
}