From 882c84adf23ea4baf18b7e61002de343392112f1 Mon Sep 17 00:00:00 2001 From: 7u83 <7u83@maiil.ru> Date: Sat, 29 Dec 2018 20:02:58 +0100 Subject: [PATCH] Order does not check decimals anymore --- nbproject/project.properties | 2 +- src/opensesim/world/Order.java | 40 ++++++++-------------------------- 2 files changed, 10 insertions(+), 32 deletions(-) diff --git a/nbproject/project.properties b/nbproject/project.properties index bc8116d..9d1d0d7 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -1,4 +1,4 @@ -#Sat, 29 Dec 2018 11:54:40 +0100 +#Sat, 29 Dec 2018 19:58:50 +0100 annotation.processing.enabled=true annotation.processing.enabled.in.editor=false annotation.processing.processors.list= diff --git a/src/opensesim/world/Order.java b/src/opensesim/world/Order.java index 2a11912..dafc615 100644 --- a/src/opensesim/world/Order.java +++ b/src/opensesim/world/Order.java @@ -63,7 +63,6 @@ public class Order implements Comparable { return this.id.compareTo(o.id); } - } /** @@ -100,33 +99,15 @@ public class Order implements Comparable { double cost; GodWorld world; - Order(opensesim.world.TradingEngine engine, Account account, Type type, + Order(TradingEngine engine, Account account, Type type, double volume, double limit, Addition addition) { - - AssetPair pair = engine.getAssetPair(); - - // round asset and currency - double v, l; - switch (type) { - case BUY: - l = pair.getCurrency().roundToDecimals(limit); - v = pair.getAsset().roundToDecimals(volume); - break; - case SELL: - l = pair.getCurrency().roundToDecimals(limit); - v = pair.getAsset().roundToDecimals(volume); - break; - - default: - l = limit; - v = volume; - - } - - // assign rounded volume and limit - this.volume = v; - this.initial_volume = v; - this.limit = l; + + // Assign volume and initial volume + this.volume = volume; + this.initial_volume = volume; + + // limit + this.limit = limit; this.account = account; this.type = type; @@ -134,10 +115,7 @@ public class Order implements Comparable { this.created = 0; this.status = Status.OPEN; this.cost = 0; - // id = Order.idGenerator.getNext(); - // this.world = world; - // id = world. - // id = world.orderIdGenerator.getNext(); + id = engine.id_generator.getNext(); this.addition = addition; }