Moved OrderStatus from Exchange to Order

This commit is contained in:
7u83 2017-10-08 21:14:28 +02:00
parent f4d4ba2c46
commit 08c4c5e91d
5 changed files with 87 additions and 84 deletions

View File

@ -1,4 +1,4 @@
#Sun, 08 Oct 2017 19:42:34 +0200
#Sun, 08 Oct 2017 21:13:57 +0200
annotation.processing.enabled=true
annotation.processing.enabled.in.editor=false
annotation.processing.processors.list=

View File

@ -36,6 +36,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.json.JSONArray;
import org.json.JSONObject;
import sesim.Order.OrderStatus;
/**
* @desc Echchange class
@ -294,12 +295,6 @@ public class Exchange {
return a.id;
}
public enum OrderStatus {
OPEN,
PARTIALLY_EXECUTED,
CLOSED,
CANCELED
}
class OrderComparator implements Comparator<Order> {

View File

@ -31,8 +31,15 @@ package sesim;
*/
public class Order {
public enum OrderStatus {
OPEN,
PARTIALLY_EXECUTED,
CLOSED,
CANCELED
}
Stock stock;
Exchange.OrderStatus status;
OrderStatus status;
Exchange.OrderType type;
protected double limit;
protected double volume;
@ -54,7 +61,7 @@ package sesim;
this.volume = volume;
this.initial_volume = this.volume;
this.created = created;
this.status = Exchange.OrderStatus.OPEN;
this.status = OrderStatus.OPEN;
this.cost = 0;
}
@ -98,7 +105,7 @@ package sesim;
return account;
}
public Exchange.OrderStatus getOrderStatus() {
public OrderStatus getOrderStatus() {
return status;
}

View File

@ -37,7 +37,7 @@ import sesim.AutoTraderGui;
import sesim.AutoTraderInterface;
import sesim.Exchange;
import sesim.Exchange.AccountListener;
import sesim.Exchange.OrderStatus;
import sesim.Order.OrderStatus;
import sesim.Order;
/**

View File

@ -36,9 +36,10 @@ import sesim.AutoTraderGui;
import sesim.Exchange;
import sesim.Exchange.Account;
import sesim.Exchange.AccountListener;
import sesim.Exchange.OrderStatus;
import sesim.Exchange.OrderType;
import sesim.Order;
import sesim.Order.OrderStatus;
import sesim.Quote;
/**