Skip to content

Commit

Permalink
Merge pull request #42 from bdowling/fix_order
Browse files Browse the repository at this point in the history
Fixes place_order to send data not params
  • Loading branch information
Jamonek authored Aug 24, 2017
2 parents 3a6044d + 3649c80 commit 11de820
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Robinhood/Robinhood.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ def instruments(self, stock):
)
res.raise_for_status()
res = res.json()
# if requesting all, return entire object so may paginate with ['next']

# if requesting all, return entire object so may paginate with ['next']
if (stock == ""):
return res

return res['results']

def quote_data(self, stock=''):
Expand Down Expand Up @@ -720,9 +720,9 @@ def place_order(
'quantity': quantity,
'side': transaction.name.lower(),
'symbol': instrument['symbol'],
'time_in_force': time_in_force,
'time_in_force': time_in_force.lower(),
'trigger': trigger,
'type': order
'type': order.lower()
}
#data = 'account=%s&instrument=%s&price=%f&quantity=%d&side=%s&symbol=%s#&time_in_force=gfd&trigger=immediate&type=market' % (
# self.get_account()['url'],
Expand All @@ -734,7 +734,7 @@ def place_order(
#)
res = self.session.post(
self.endpoints['orders'],
params=payload
data=payload
)
res.raise_for_status()
return res
Expand Down

0 comments on commit 11de820

Please sign in to comment.