Giter VIP home page Giter VIP logo

Comments (5)

tyler-pruitt avatar tyler-pruitt commented on June 10, 2024

Hi jwest31337,

Thank you very much for sending me this error feedback. I was able to implement fixes to resolve both issues that you have sent me and I have just updated my main branch with the solutions. Therefore, if you reclone or redownload the code used in my repository as of now, these errors should no longer occur.

I would like to inform you that my Python package for this program (https://github.com/tyler-pruitt/robinhood_crypto_trader) is much more robust and systematic. I highly recommend using the official Python package instead of the code is this repository. You can install this Python package through pip (https://pypi.org/project/robinhood-crypto-trader/).

If you are interested, I can explain what was going wrong and how I implemented solutions to fix the errors.

  1. In regards to the first error message that you wrote about, it happened to be a simple few lines of code in main.py around line 504 that were there by mistake due to the coping and pasting from other areas of the code base that were similar. At line 504, we know that is_live = True so therefore the mode is not "BACKTEST" and hence crypto_historicals would not be needed and accordingly it was never assigned in the first place, as it should. There was an if-else statement at line 504 that really should of just been a single line of code, i.e. no conditional. Therefore, I just deleted the excess code there.

  2. In regards to the second error message, I simply forgot to consider that exporting logs of completed crypto orders requires the user to be logged in. It is required because the program has to retrieve your order history with your authentication. To fix this, I simply switched the order of the export completed crypto orders statement with the logout statement so that latter precedes the former. These changes took place in the exception handling for the program due to the user ending the program, unexpected errors, and other error catches that I have newly implemented. I have implemented exception handling for KeyError and TypeError in case Robinhood or the web server has errors. I have implemented the code so that if a temporary or inconsequential errors, such as 500 or 503 errors, occur then the code will continue running and the autotrader will continue making trades without the hassle of logging the user and having to run the code again and type in the 2FA code.

Please let me know if these errors persist or if new errors occur.

from robinhood-crypto-autotrader.

jwest31337 avatar jwest31337 commented on June 10, 2024

Aha you did it! I re-cloned the repo and pip3 installed the robinhood-crypto-trader Python module, and it's running like a champ now! I'm letting the bot play around with a couple bucks, I'll update you on how it goes over the next week. Thanks for fixing this!

from robinhood-crypto-autotrader.

tyler-pruitt avatar tyler-pruitt commented on June 10, 2024

I am glad to hear that it is running smoothly now! How has the trading been going?

from robinhood-crypto-autotrader.

jwest31337 avatar jwest31337 commented on June 10, 2024

I've tried running it in a few experiments, and here's what I can report back so far:

The code doesn't seem to crash at all. Once the 2FA code has been provided for the account, it seems to function just fine. I did run into a single scenario where the bot had tied up all the available funds in buying operations, and then had a single transaction that repeatedly failed over and over again, flooding me with notifications. I had to kill the program from running, and cancel the attempted buy order. (Maybe the bot was trying to buy with insufficient funds?)

I've tried letting it run with both a single Crypto currency, and also a mixed grab bag of DOGE, ETH and LTC. It seems to very slowly bleed money until it gets to the point where it hits the limit where it marks funds exhausted, and then the program exits out. I've also tried killing it mid-trade operation when I thought it was on "a hot streak" , but if left to its own devices, it seems to end up very slowly trickling cash. I've been playing around throwing $50 at it, and it's lost anywhere between $5'ish to $15'ish a run, when I let it run for a 24 hour period.

Have you released any updates to the code? I'm still running the original repo that I snagged when I first submitted my message. Thanks for checking back in!

from robinhood-crypto-autotrader.

tyler-pruitt avatar tyler-pruitt commented on June 10, 2024

Hey! Thank you for the very interesting feedback!

That is great to hear that at least the code is not crashing at all. My apologies about the nonstop notifications, I didn't know that failed orders would produce notifications. I would like to inform you that I am no longer going to keep this repository (tyler-pruitt/Robinhood-Crypto-Autotrader) up-to-date with bug fixes and optimizations. Instead, I intend to keep the Python package for this project and its respective repository (tyler-pruitt/robinhood_crypto_trader) for this project more up-to-date. Although, I would encourage you, should you have the desire, to join me in the latter repository as a contributor as I don't have much time now to work on it. Anything helps and is much appreciated.

I think those problems are happening because the buying operations are either limit order by price or market order by price. When the cash being used to by crypto isn't low, then there aren't any problems because you can buy a relatively large amount of crypto. However, the problem arises when either the dollar amount goes below a minimum value (typically $0.01 or $0.02 for most cryptocurrencies) or when the amount of crypto that the cash gets you is below a minimum threshold value (e.g. 500 Shiba Inu or 0.000001 Bitcoin). Fortunately, these latter minimum cryptocurrency values can be found by running robin_stocks.robinhood.crypto.get_crypto_info(symbol). Unfortunately, I am not able to find the minimum dollar amount for a purchase for a specific crypto (i.e. $0.02 for Bitcoin) besides looking it up manually on the Robinhood app on my phone. One solution I can implement is setting a minimum dollar amount to spend on a specific crypto purchase, such as $0.02. In this way, purchase orders can only go through if there is at least $0.02 in cash remaining. Since the buying operations are by price and not by quantity, the scenario in which a buy order fails because it is purchasing too little quantity of crypto does not occur. This is to say that the program never tries to specifically buy exactly 488 Shiba Inu and fails due to the limit being 500 Shiba Inu because all buy operations are by price. In order to make these buy operations more robust, I can implement more buying options to enable the user to decide if they want to buy by price or buy by quantity of cryptocurrency. Interestingly, the reason why this does not happen for the sell operations is because they are sell by quantity. On Robinhood, there are no boundaries for how little cryptocurrency you can sell or for how little money you can receive from selling cryptocurrency. Oddly enough, it is possible to sell a very little amount of crypto for less than one cent and after everything has settled you will receive nothing, i.e. $0.00. After giving these problems more thought as I have been writing this message, I think that it would also be good to give the user more freedom in their sell operations by making them both by price and by quantity. Of course, these changes to the sell operations and the buy operations depend on the supporting package robin_stocks having the necessary functions.

In regards to the slow drying up of funds, I think this is simply due to the strategy not being that effective. I am curious as to which strategy you used. Although my original central goal for this project was not to find a perfect strategy but rather produce a very modular and secure program to automatically trade cryptocurrency, I want to make this project as profitable as possible. If you know of any better strategies or have any ideas that can be implemented into a strategy, please let me know. I think that this project would be much better if the strategy used to make purchase orders and sell orders was very lucrative.

I strongly recommend using the Python package instead of the independent code used from cloning this repository, but ultimately, the choice is up to you. Tonight, I have updated the repository for the Python package (tyler-pruitt/robinhood_crypto_trader) to handle precision and rounding much more carefully. This being said, these changes still need to be tested before updating the Python package on PyPI. I still need to implement the changes to the buy and sell operations that I have mentioned earlier in this message. Thank you for the update!

from robinhood-crypto-autotrader.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.