Order does not check decimals anymore
This commit is contained in:
parent
54d4b5baee
commit
882c84adf2
@ -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=
|
||||
|
@ -63,7 +63,6 @@ public class Order implements Comparable<Order> {
|
||||
|
||||
return this.id.compareTo(o.id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -100,33 +99,15 @@ public class Order implements Comparable<Order> {
|
||||
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<Order> {
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user