jessecooper / pyetrade

Python E-Trade API Wrapper
GNU General Public License v3.0
209 stars 97 forks source link

order["stopPrice"] is always empty #50

Closed mw66 closed 3 years ago

mw66 commented 3 years ago

https://github.com/jessecooper/pyetrade/blob/master/pyetrade/order.py#L159

        order["stopPrice"] = ""

This line should be changed to:

        if "stopPrice" in kwargs:
          stopPrice = (float(kwargs["stopPrice"]) - 0.01)
          if stopPrice > 0:
            order["stopPrice"] = "%.2f" % stopPrice

to properly convert float number to 2 decimal place dollar value.

jessecooper commented 3 years ago

released in 1.2.2 @mingwugmail thank you for the contribution.