rename OHLCValue -> OHLCEvent

This commit is contained in:
2018-06-20 22:28:42 -07:00
parent ced385ef8a
commit ff5fa69e7d
5 changed files with 51 additions and 63 deletions

View File

@ -0,0 +1,44 @@
package ats.plugin;
import org.joda.time.DateTime;
/**
* OHLCEvent stores one bar of OHLC info.
*/
public class OHLCEvent {
private DateTime time;
private double open;
private double high;
private double low;
private double close;
public OHLCEvent(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("OHLCEvent[%s, open=%s, high=%s, low=%s, close=%s]",
time, open, high, low, close);
}
}

View File

@ -231,7 +231,7 @@ public class OHLCPlugInView extends ViewSupport {
private void postData() {
if (open == null) return;
OHLCValue value = new OHLCValue(windowStartTime, open, high, low, close);
OHLCEvent value = new OHLCEvent(windowStartTime, open, high, low, close);
// send
EventAdapterService service = agentContext.getStatementContext().getEventAdapterService();
@ -261,8 +261,8 @@ public class OHLCPlugInView extends ViewSupport {
protected static EventType getEventType(EventAdapterService service)
{
return service.addBeanType(OHLCValue.class.getName(),
OHLCValue.class,
return service.addBeanType(OHLCEvent.class.getName(),
OHLCEvent.class,
false, false, false);
}

View File

@ -1,54 +0,0 @@
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);
}
}