oanda / v20-python

OANDA v20 bindings for Python
MIT License
223 stars 89 forks source link

order.stop_loss_replace fails with status 400 #21

Closed IntegralTriad closed 7 years ago

IntegralTriad commented 7 years ago

In order.py -> EntitySpec -> replace method: the request url uses {orderSpecifier} but a few lines below an 'orderID' param is set.

request = Request( 'PUT', '/v3/accounts/{accountID}/orders/{orderSpecifier}' )

    request.set_path_param(
        'accountID',
        accountID
    )

    request.set_path_param(
        'orderID',
        orderID

)

When changed to 'orderSpecifier' it works as expected.

    # -------------------CHANGED THIS -----------------
    request.set_path_param(
        'orderSpecifier',  # used to be 'orderID'
        orderID
    )
    # -------------------------------------------------
dmpettyp commented 7 years ago

That is very strange. The current internal head doesn't have this issue so I've committed version 3.0.15 which is fixed.