From bebb0c1f12699daba5cf0e6557eb880aaa7a4896 Mon Sep 17 00:00:00 2001 From: 7u83 <7u83@maiil.ru> Date: Sat, 29 Dec 2018 13:27:42 +0100 Subject: [PATCH] Introduced Order.Addition --- src/opensesim/world/Order.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/opensesim/world/Order.java b/src/opensesim/world/Order.java index 008166c..2a11912 100644 --- a/src/opensesim/world/Order.java +++ b/src/opensesim/world/Order.java @@ -80,8 +80,14 @@ public class Order implements Comparable { BUYLIMIT, SELLLIMIT, STOPLOSS, STOPBUY, BUY, SELL } + public static enum Addition { + NONE, MARGIN_CALL, FILL_OR_KILL + } + + Addition addition; protected Status status; protected Type type; + protected double limit; protected double volume; @@ -95,7 +101,7 @@ public class Order implements Comparable { GodWorld world; Order(opensesim.world.TradingEngine engine, Account account, Type type, - double volume, double limit) { + double volume, double limit, Addition addition) { AssetPair pair = engine.getAssetPair(); @@ -133,6 +139,12 @@ public class Order implements Comparable { // id = world. // id = world.orderIdGenerator.getNext(); id = engine.id_generator.getNext(); + this.addition = addition; + } + + Order(opensesim.world.TradingEngine engine, Account account, Type type, + double volume, double limit) { + this(engine, account, type, volume, limit, Addition.NONE); } public Id getID() {