Added Python 2.7.x and 3.4.x compatibility to the code. Disabled HTTPS security warning in urllib3 package of 'requests' package.

This commit is contained in:
Michael Halls-Moore
2015-05-11 17:30:28 +01:00
parent 8e74edb4f7
commit a03bc7a1fb
9 changed files with 67 additions and 39 deletions
+4 -2
View File
@@ -92,7 +92,8 @@ class Position(object):
self.update_position_price()
# Calculate PnL
pnl = self.calculate_pips() * qh_close * dec_units
return pnl.quantize(Decimal("0.01", ROUND_HALF_DOWN))
getcontext().rounding = ROUND_HALF_DOWN
return pnl.quantize(Decimal("0.01"))
def close_position(self):
ticker_cp = self.ticker.prices[self.currency_pair]
@@ -106,4 +107,5 @@ class Position(object):
self.update_position_price()
# Calculate PnL
pnl = self.calculate_pips() * qh_close * self.units
return pnl.quantize(Decimal("0.01", ROUND_HALF_DOWN))
getcontext().rounding = ROUND_HALF_DOWN
return pnl.quantize(Decimal("0.01"))