Moved OrderType from Exchnage class to Order class

This commit is contained in:
2017-10-09 14:15:39 +02:00
parent 08c4c5e91d
commit 201709b053
15 changed files with 48 additions and 76 deletions

View File

@ -37,6 +37,7 @@ import java.util.logging.Logger;
import org.json.JSONArray;
import org.json.JSONObject;
import sesim.Order.OrderStatus;
import sesim.Order.OrderType;
/**
* @desc Echchange class
@ -110,12 +111,6 @@ public class Exchange {
}
/**
* Definition of order types
*/
public enum OrderType {
BUYLIMIT, SELLLIMIT, STOPLOSS, STOPBUY, BUY, SELL
}
IDGenerator account_id = new IDGenerator();
//public static Timer timer = new Timer();

View File

@ -38,9 +38,16 @@ public class Order {
CANCELED
}
/**
* Definition of order types
*/
public enum OrderType {
BUYLIMIT, SELLLIMIT, STOPLOSS, STOPBUY, BUY, SELL
}
Stock stock;
OrderStatus status;
Exchange.OrderType type;
OrderType type;
protected double limit;
protected double volume;
@ -52,7 +59,7 @@ public class Order {
double cost;
Order(long id, long created, Exchange.Account account, Exchange.OrderType type, double volume, double limit) {
Order(long id, long created, Exchange.Account account, OrderType type, double volume, double limit) {
//id = order_id_generator.getNext();
this.id = id;
this.account = account;
@ -77,7 +84,7 @@ public class Order {
return limit;
}
public Exchange.OrderType getType() {
public OrderType getType() {
return type;
}