Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

can't create market or limit orders #6

Open
kchima opened this issue Apr 14, 2019 · 5 comments
Open

can't create market or limit orders #6

kchima opened this issue Apr 14, 2019 · 5 comments
Assignees
Labels

Comments

@kchima
Copy link

kchima commented Apr 14, 2019

  1. had to update the fundamentals endpoint to add auth token to meet newer requirements. Then had to move "verifytickerdata" before setOrderParameters.

  2. even afterwards, I get 400 bad request when doing either market or limit. Can anyone else successfully do an order right now?

@ConradWeiser
Copy link
Owner

ConradWeiser commented Apr 14, 2019

Interesting, it's been a little while since ive looked at those endpoints as i didn't see much news of them changing since they last were modified.

Within the next few days ill debug the situation and see whats going on. Its about time some JUnit tests were also included so other people can troubleshoot the system in its entirety. Stay tuned, we'll get this sorted out.

@kchima
Copy link
Author

kchima commented Apr 14, 2019

Yeah, it's very possible that I made a mistake, but if possible just try to make any buy order (probably sell order too) and let me know if it works! Thanks.

@ConradWeiser
Copy link
Owner

Using the steps you've provided of attaching auth token requirements to the fundamental checkups has fixed one of the critical bugs from preventing the system from making the order.

Unfortunately I too am reproducing the issue with an order placement returning a code 400.
After looking through the order documentation again, I note a field called 'price' which is required to be a part of the request, which didn't exist when the system was created in the first place, along with the explanation note of..

*Note 2: market orders in Robinhood are adjusted to limit orders collared up to 5% (which is why a price is required). This process is not automatic, and so market orders will remain pending if the given price is not equal to the last bid price at execution (until the last bid price once again hits the given price).

There was an issue of the instrument url not being sent along with the market request, which has been resolved. After adding in this 'price' value, I still am getting a code 400 sadly. (This time, the response is HTML and not JSON, causing a stack trace to fire. Exception is now being handled a little more informatively and gracefully)

I'll have to do some surveys on other repositories wrapping the RobinhoodAPI, and see if there's any similar problems perhaps alluding to a system change. Otherwise, we'll get the internal issue sorted out as soon as I can.

Tldr; Valid issue! Service doesn't like how the the request is being sent. 70% sure it's an authentication issue. I'll be able to devote some proper time to this soon. Thanks for bringing this up!

@kchima
Copy link
Author

kchima commented Apr 15, 2019

Thank you for the quick response Conrad. If there's anything I can do to help, let me know.

@ConradWeiser
Copy link
Owner

Alright. One pain in the butt later.

This was a two step solution. There was indeed an issue within the library causing transactions not to go through. This has been fixed(?).

The other issue was discovered while jamming queries into Curl. Apparently, if your Robinhood account is older and you haven't signed the Margin Agreement request, you must do that or else the Java library will always return a "Bad Request" until you've signed (digitally) said agreement.

You can find a link to do that right here!

There are a few other bugs that I'd like to fix before I push the change through, but if you'd like to go through and verify that the library is working again (after signing said agreement) you can find a compiled version of the library on pull request #7

Everything seems to be working on my system, although I've only been able to test the system to a certain extent. Unfortunately I don't have any free money to try a stock purchase with, and can only judge that the system is working based on the API responses I personally get with my account.

Although I'm 80% confident that things should be all set again.
If you have any additional questions, please get 'em in here!

I'll refrain from closing the issue until the pull request has all of the other bugfixes I'd like, and is merged into master.

@ConradWeiser ConradWeiser self-assigned this Apr 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants