alienbrett / PyAlly

Ally Invest API Module for Python3
https://alienbrett.github.io/PyAlly/
MIT License
57 stars 28 forks source link

Stop Order incorrect Parameter used #33

Closed eyesuk closed 4 years ago

eyesuk commented 4 years ago

Hello All, I found a bug attributed to a typo included in the orders.py line 183. The code currently using a StopPX parameter that is causing an empty stop price while submitting a stop order. Replacing StopPX with StopPx resolves this issue.

The current code below submits an empty stop price:

def Stop(stop):
    return {
        '__execution' :'stop',
        'Typ'   :'3',
        'StopPX' : str(float(stop))
    }

The below works properly

def Stop(stop):
    return {
        '__execution' :'stop',
        'Typ'   :'3',
        'StopPx' : str(float(stop))
    }