Order does not check decimals anymore

This commit is contained in:
7u83 2018-12-29 20:02:58 +01:00
parent 54d4b5baee
commit 882c84adf2
2 changed files with 10 additions and 32 deletions

View File

@ -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=true
annotation.processing.enabled.in.editor=false annotation.processing.enabled.in.editor=false
annotation.processing.processors.list= annotation.processing.processors.list=

View File

@ -63,7 +63,6 @@ public class Order implements Comparable<Order> {
return this.id.compareTo(o.id); return this.id.compareTo(o.id);
} }
} }
/** /**
@ -100,33 +99,15 @@ public class Order implements Comparable<Order> {
double cost; double cost;
GodWorld world; GodWorld world;
Order(opensesim.world.TradingEngine engine, Account account, Type type, Order(TradingEngine engine, Account account, Type type,
double volume, double limit, Addition addition) { double volume, double limit, Addition addition) {
AssetPair pair = engine.getAssetPair(); // Assign volume and initial volume
this.volume = volume;
// round asset and currency this.initial_volume = volume;
double v, l;
switch (type) { // limit
case BUY: this.limit = limit;
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;
this.account = account; this.account = account;
this.type = type; this.type = type;
@ -134,10 +115,7 @@ public class Order implements Comparable<Order> {
this.created = 0; this.created = 0;
this.status = Status.OPEN; this.status = Status.OPEN;
this.cost = 0; this.cost = 0;
// id = Order.idGenerator.getNext();
// this.world = world;
// id = world.
// id = world.orderIdGenerator.getNext();
id = engine.id_generator.getNext(); id = engine.id_generator.getNext();
this.addition = addition; this.addition = addition;
} }