Skip to content

Commit 5e434a0

Browse files
committed
Fixed roundings
1 parent 9f30503 commit 5e434a0

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Bot/Strategy/PlaceOrderStrategy.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def prepare_volume_allocation(self, targets):
108108
'side': self.trade_side().name,
109109
'target': t})
110110

111-
bal -= vol
111+
bal = round(bal - vol, 8)
112112

113113
self.logInfo('Orders to be posted: {}'.format(orders))
114114
return orders

Bot/Value.py

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ def is_rel(self):
2525
def get_val(self, rel_val):
2626
if self.is_abs():
2727
return self.v
28+
if self.v == 100:
29+
return rel_val
2830
return round(rel_val * self.v / 100, 8)
2931

3032
def __eq__(self, other):

0 commit comments

Comments
 (0)