Open Jay54520 opened 5 years ago
(1 + settings.INTERVAL) ** 0
evaluates to 1 before being multiplied with start_position
because the order of operations in python is pow before mult.
If you put parenthesis around the first part it will evaluate the same:
(start_position * (1 + settings.INTERVAL)) ** 0
The code is
return math.toNearest(start_position * (1 + settings.INTERVAL) ** index, self.instrument['tickSize'])
inget_price_offset
.Why there are different results?
start_position * (1 + settings.INTERVAL) ** 0 = 9522.6475
9570.260737499999 ** 0 = 1
.We know that
**
means pow in Python, so 2 is expected but not 1.