bcwik9 / robinhood-on-rails Goto Github PK
View Code? Open in Web Editor NEWA web dashboard for the free trading platform Robinhood using Ruby on Rails and a private API
License: MIT License
A web dashboard for the free trading platform Robinhood using Ruby on Rails and a private API
License: MIT License
I'm also making a Robinhood client (for Windows 10), and ran into an api call limit while testing. What refresh rate do you use when auto refreshing? I want to avoid the call limit so the user doesn't run into any issues with normal use.
Hello, great work! I too prefer to deploy via Docker.
One minor pet peeve was having to stop, rebuild and run the Docker image after any change in code (or git pull
).
Here is my new way to launching, after the initial docker build
:
$ cd ~/www/robinhood-on-rails
$ docker run --name=RobinhoodOnRails -v $HOME/www/robinhood-on-rails:$HOME/robinhood-on-rails -dt -p 3222:3000 robinhood-on-rails
Wherein:
--name since I don't expect to run multiple instances on the same server. This prevents Docker from assigning random aliases, and simplifies instance management.
-p 3222 externalizes to a port other than 3000, which on my server was already taken.
-v The main point of this issue. Binds a dir from host to guest, and since Rails is already launched in dev mode, reloads new code on the fly.
I am unsure how to best adapt into the Dockerfile, etc.
Any chance we can get this implemented.
def get_option_orders
@option_orders = get_all_results robinhood_get("#{ROBINHOOD_API_URL}/options/orders/")
end
I have never coded in ruby so it's causing some headache but logically it seems very straight forward if you know the language constructs.
Thanks for all the hard work.
I bought shares of VEA after I had sold them, and my "Today's return" is showing a value much higher than the actual return for today. In the robinhood app, the values for Return and Today's return match.
Hi am having this issue when trying to login:
def handle_unverified_request
raise ActionController::InvalidAuthenticityToken
end
end
end
Am I missing on a step?
upon hitting the login button, the request POSTs and then 302s to localhost.
I get this weird error, used to work fine. I don't get portfolio list at all, tried resetting the DB, pulled latest branch, etc. using mac os x with homebrew to run. Love the software!
Completed 500 Internal Server Error in 588ms (ActiveRecord: 16.7ms)
NoMethodError (undefined method `[]' for nil:NilClass):
app/controllers/robinhood_controller.rb:314:in
block in watchlist' app/controllers/robinhood_controller.rb:313:in
each'
app/controllers/robinhood_controller.rb:313:in `watchlist'
Does this application rely on Rails-specific server-side functionality or API calls? I wonder if there's a way to strip all server-side functionality from this and run it as a simple HTML page.
I had to run bundle update before bundle install. It may be worth adding that in the instructions.
I also had to update ruby but I think people may have an up-to-date version.
It would be nice to see the avg. versus the current price to quickly evaluate if your position is positive or negative when considering a sell.
The color of the chart should reflect the change for that period (ie. my portfolio chart should be green if I've gained money that day)
I'll claim implementing this one unless someone else feels strongly about it :)
Wanted to post first in case there's a reason you see why not to do this.
Hi! I just found this project and it looks awesome!
Are there any instructions for running it?
After having the dashboard sit a while, things start to become unresponsive (tabbing between portfolio/watchlist, or opening up an order modal and changing the order type, etc).
I believe this has to do with a faulty JS setup between the dashboard and watchlist, where things are being called and loaded multiple times when they're actually already loaded.
Reloading the page fixes the issue (until it sits there long enough again)
Basically, I held $VSLR previously but I sold it for a gain. I just bought in again today and the return with sells is very wrong.
I destroyed my docker instance, pulled the latest repository update, and created the instance again.
Here is a screenshot of my position:
https://www.dropbox.com/s/c0ccgjn8sm9zrgs/Screen%20Shot%202017-07-03%20at%2010.45.30%20AM.png?dl=0
https://www.dropbox.com/s/pizq6qt0covs86a/Screen%20Shot%202017-07-03%20at%2011.00.44%20AM.png?dl=0
https://www.dropbox.com/s/lsb3sz7c82xdtdg/Screen%20Shot%202017-07-03%20at%2011.00.51%20AM.png?dl=0
This is verify noticeable for penny stocks like $DCTH
Hi @bcwik9. Thank you for making this! I can't wait to use it.
I just installed this manually on my Mac OSX 10.13.6 (High Sierra) after getting all the ruby issues resolved (rvm, ruby, gem, bundler versions)
After running the local server on port 3000, I attempt to login with my credentials and I get this "Missing device token" error. I get this error both with and without Two Factor Authentication on my account.
System details:
$rvm list
=* ruby-2.7.1 [ x86_64 ]
# => - current
# =* - current && default
# * - default
$ruby -v
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin17]
$gem --version
3.1.2
$bundle -v
Bundler version 2.1.4
Traceback:
$bundle exec rails server
=> Booting Puma
=> Rails 5.0.7.2 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
DEPRECATION WARNING: Sprockets method `register_engine` is deprecated.
Please register a mime type using `register_mime_type` then
use `register_compressor` or `register_transformer`.
https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors
(called from block in <class:Railtie> at /Users/frak/.rvm/gems/ruby-2.7.1/gems/less-rails-2.8.0/lib/less/rails/railtie.rb:16)
DEPRECATION WARNING: You are using a deprecated processor interface Less::Rails::ImportProcessor.
Please update your processor interface:
https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors
(called from block in <class:Railtie> at /Users/frak/.rvm/gems/ruby-2.7.1/gems/less-rails-2.8.0/lib/less/rails/railtie.rb:21)
/Users/frak/.rvm/gems/ruby-2.7.1/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/stack.rb:35: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/frak/.rvm/gems/ruby-2.7.1/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/static.rb:113: warning: The called method `initialize' is defined here
Puma starting in single mode...
* Version 3.12.4 (ruby 2.7.1-p83), codename: Llamas in Pajamas
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://localhost:3000
Use Ctrl-C to stop
Started GET "/" for ::1 at 2020-04-25 11:47:17 -0400
/Users/frak/.rvm/gems/ruby-2.7.1/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/sqlite3_adapter.rb:27: warning: rb_check_safe_obj will be removed in Ruby 3.0
/Users/frak/.rvm/gems/ruby-2.7.1/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract_adapter.rb:81: warning: deprecated Object#=~ is called on Integer; it always returns nil
ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
DEPRECATION WARNING: before_filter is deprecated and will be removed in Rails 5.1. Use before_action instead. (called from <class:ApplicationController> at /Users/frak/git/robinhood/robinhood-on-rails/app/controllers/application_controller.rb:5)
Processing by DashboardController#home as HTML
/Users/frak/.rvm/gems/ruby-2.7.1/gems/actionview-5.0.7.2/lib/action_view/view_paths.rb:11: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/frak/.rvm/gems/ruby-2.7.1/gems/actionview-5.0.7.2/lib/action_view/lookup_context.rb:134: warning: The called method `template_exists?' is defined here
Rendering dashboard/home.html.haml within layouts/application
/Users/frak/.rvm/gems/ruby-2.7.1/gems/actionpack-5.0.7.2/lib/abstract_controller/helpers.rb:68: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/frak/.rvm/gems/ruby-2.7.1/gems/actionpack-5.0.7.2/lib/action_controller/metal/request_forgery_protection.rb:284: warning: The called method `form_authenticity_token' is defined here
Rendered layouts/_robinhood_login_form.html.haml (3.2ms)
Rendered dashboard/home.html.haml within layouts/application (54.7ms)
Rendered application/_favicon.html.erb (1296.5ms)
Rendered layouts/_flash_message.html.haml (2.5ms)
Rendered layouts/_side_menu.html.haml (3.7ms)
Completed 200 OK in 1506ms (Views: 1498.8ms | ActiveRecord: 0.0ms)
/Users/frak/.rvm/gems/ruby-2.7.1/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/sqlite3_adapter.rb:27: warning: rb_check_safe_obj will be removed in Ruby 3.0
/Users/frak/.rvm/gems/ruby-2.7.1/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract_adapter.rb:81: warning: deprecated Object#=~ is called on Integer; it always returns nil
/Users/frak/.rvm/gems/ruby-2.7.1/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/sqlite3_adapter.rb:27: warning: rb_check_safe_obj will be removed in Ruby 3.0
/Users/frak/.rvm/gems/ruby-2.7.1/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract_adapter.rb:81: warning: deprecated Object#=~ is called on Integer; it always returns nil
/Users/frak/.rvm/gems/ruby-2.7.1/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/sqlite3_adapter.rb:27: warning: rb_check_safe_obj will be removed in Ruby 3.0
/Users/frak/.rvm/gems/ruby-2.7.1/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract_adapter.rb:81: warning: deprecated Object#=~ is called on Integer; it always returns nil
/Users/frak/.rvm/gems/ruby-2.7.1/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/sqlite3_adapter.rb:27: warning: rb_check_safe_obj will be removed in Ruby 3.0
/Users/frak/.rvm/gems/ruby-2.7.1/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract_adapter.rb:81: warning: deprecated Object#=~ is called on Integer; it always returns nil
Started POST "/robinhood_login" for ::1 at 2020-04-25 11:47:29 -0400
Processing by RobinhoodController#login as HTML
Parameters: {"utf8"=>"โ", "authenticity_token"=>"xxxx", "username"=>"xxxx", "password"=>"[FILTERED]", "commit"=>"Log in"}
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 6503 100 6503 0 0 2360 0 0:00:02 0:00:02 --:--:-- 2359
Completed 500 Internal Server Error in 5381ms (ActiveRecord: 0.0ms)
RuntimeError (Missing device token):
app/models/concerns/robinhood.rb:48:in `set_account_token'
app/controllers/robinhood_controller.rb:12:in `login'
Rendering /Users/frak/.rvm/gems/ruby-2.7.1/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout
Rendering /Users/frak/.rvm/gems/ruby-2.7.1/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/_source.html.erb
Rendered /Users/frak/.rvm/gems/ruby-2.7.1/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/_source.html.erb (2.3ms)
Rendering /Users/frak/.rvm/gems/ruby-2.7.1/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
Rendered /Users/frak/.rvm/gems/ruby-2.7.1/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.1ms)
Rendering /Users/frak/.rvm/gems/ruby-2.7.1/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb
Rendered /Users/frak/.rvm/gems/ruby-2.7.1/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.1ms)
Rendered /Users/frak/.rvm/gems/ruby-2.7.1/gems/actionpack-5.0.7.2/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (23.9ms)
/Users/frak/git/robinhood/robinhood-on-rails/app/models/concerns/robinhood.rb:48: warning: __FILE__ in eval may not return location in binding; use Binding#source_location instead
/Users/frak/.rvm/gems/ruby-2.7.1/gems/web-console-3.7.0/lib/web_console/exception_mapper.rb:31: warning: in `eval'
^C- Gracefully stopping, waiting for requests to finish
=== puma shutdown: 2020-04-25 11:52:41 -0400 ===
- Goodbye!
Exiting
I'd love to finally get this working. Please let me know if you need any more information.
Thank you!
Putting a stop loss on a position removes it from the portfolio.
This project looks neat but when I try to login via http://localhost:3000/?challenge_required=true and enter my 2FA I get the following error both through the docker installation and ruby installation
Tried to use the docker approach on MAC OS but the login form is not working.
When a stock splits(2:1) the interface shows a loss and only one share. On my phone I see myself as holding two shares.
The Login URL has been changed and the auth token process have been changed as it now uses Oauth2 and Bearer. Any chance the code will reflect these changes soon?. I am trying from my end, but it seems I need to change more than few places. Thanks
Just ran into this. If I have two-factor authentication enabled, it will not log you in unless you disable that option in robinhood.(not sure if I put this in the right spot, I don't generally use github, app looks awesome btw!)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.