Giter Site home page Giter Site logo

gran4 / ai-investibot Goto Github PK

View Code? Open in Web Editor NEW
17.0 5.0 5.0 191.5 MB

Innovative, high quality stock bot

License: MIT License

Python 100.00%
algorithmic-trading artificial-intelligence cloud-computing deep-learning finance keras machine-learning matplotlib-pyplot python quantitative-finance

ai-investibot's Introduction

Hi there , I'm Gran4 (Grant Hur)

πŸ”₯ Passionate Software Engineer

Grant Hur | Python Developer | AI Enthusiast

Hi there! πŸ‘‹ I'm Grant Hur, a Python developer with a passion for AI and seeking internship opportunities(for next summer). I'm currently working on an innovative stock bot called AI-InvestiBot to predict stock movements, automatically trade stock, manage risk, and optimize your stock portfolio.

I won the 2024 1st place in Lockheed Martin's coding competition called code quest.

🀝 Seeking exciting summer internship opportunities in the Silicon Valley area


πŸ“¬ Let's get in touch [![Support me on Patreon](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3DGrantHur%26type%3Dpatrons&style=flat)](https://patreon.com/GrantHur)
πŸ˜„ About Me
  • πŸ“ Location: San Jose, CA, US
  • 🌱 Currently, I'm building an open sourced AI powered stock bot called AI-InvestiBot
  • 🧠 I know python, c, c++, iOS, and java
  • πŸ† I won the 2024 1st place in Lockheed Martin's coding competition called code quest
  • 🀝 I am seeking exciting summer internship opportunities in the Silicon Valley area
  • ⚽️ I play premier level, competitive soccer
πŸ“ˆGitHub Stats

Grant's GitHub Stats

Languages Used

Skills
πŸ—οΈ Active project(s)

AI-InvestiBot: I created an innovative, high quality stockbot still in testing. This is currently my main project. A testing version is available on GitHub.

Python arcade: I contribute to the arcade game library that gets 5.6k downloads a month

ai-investibot's People

Contributors

alexpvpmindustry avatar caidol avatar dependabot[bot] avatar gran4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ai-investibot's Issues

Make the project more friendly to being a library

What is wrong and why is it wrong
The project can not really be used as a library currently. It is structured solely for the bot. However, it should be easy to change it so it can be used for any stock related thing. Like getting the relevant years, etc.

Where is it wrong?
Just everywhere

Check List

  • Update type hints and docstrings
  • Return values
  • Option to not download the heavy Stocks Folder
  • Add a read the docs
  • Update Readme
  • Add tests
  • Finish Alpha version project
  • Add a way to pip install
  • Update requirements.txt

Higher close prices are far less accurate

Describe the bug
Higher close prices are predicted far lower then they should. This is because the stock data has less high data since stocks tend to move in an upwards trend.

To Reproduce
Test model

Expected behavior
Equal accuracy

What version of this library is it?
Latest

OS/Device + version
Mac 2020, but it will obviously happen on all versions

invite link is dead

Why does it not fit into the other categories

in the README.md, discord link is dead.

Describe your problem

image

cant run implementation.py

Describe the bug
i ran the implementation.py after installing requirements.txt.

(.venv) C:\Users\aatan\Documents\Github\AI-InvestiBot>c:/Users/aatan/Documents/Github/AI-InvestiBot/.venv/Scripts/python.exe c:/Users/aatan/Documents/Github/AI-InvestiBot/AI-InvestiBot/implementation.py
Traceback (most recent call last):
  File "c:\Users\aatan\Documents\Github\AI-InvestiBot\AI-InvestiBot\implementation.py", line 300, in <module>
    models, total_info_keys = load_models(strategys=[RSI_indicators])
  File "c:\Users\aatan\Documents\Github\AI-InvestiBot\AI-InvestiBot\implementation.py", line 91, in load_models
    model = model_class(stock_symbol=company, information_keys=strategy)
  File "c:\Users\aatan\Documents\Github\AI-InvestiBot\AI-InvestiBot\models.py", line 842, in __init__
    super().__init__(start_date=start_date,
  File "c:\Users\aatan\Documents\Github\AI-InvestiBot\AI-InvestiBot\models.py", line 88, in __init__
    with open(f'Stocks/{stock_symbol}/dynamic_tuning.json', 'r') as file:
FileNotFoundError: [Errno 2] No such file or directory: 'Stocks/AAPL/dynamic_tuning.json'

To Reproduce

Expected behavior
it should work.....??

What version of this library is it?
latest

OS/Device + version
windows 11, python3.10, vscode with venv installed with requirements.txt.

Refactor Model

Is your feature request related to a problem? Please describe.
Live trading is not working.

Describe the solution you'd like
Change the way the models, especially PriceModel. It should not use 4d data.

Describe alternatives you've considered
I attempted to fix lave trading with 4d data, but it seems impossible.

Additional context
None

specify which versions of modules used.

Is your feature request related to a problem? Please describe.

specify which versions of tensorflow used....
and also for other modules.

Describe the solution you'd like
image
use pip freeze> requirements.txt to save the versions of modules that was used.
and upload that requirements.txt file

save figures instead of showing them in browser.

Is your feature request related to a problem? Please describe.
most times, I don't want to just view the figures.
i like to save them instead, or at least the code have to have an option to do so.

Describe the solution you'd like
maybe add a save_graph attribute? to the basic model class?

Describe alternatives you've considered
IMO, models class should be purely models, and plotting should have been another completely separate module.

Additional context
maybe we can use mplfinance to do part of the plottings.

Verify high accuracy rate

Why does it not fit into the other categories
It is not a bug or an enhancement or bad structure. It is a possible bug.

Describe your problem
There is very little chance the model is 95% accurate.

Fix pylint issues

None worked so far. It broke after I made pylint only scan changed files.

Add a quick start guide

Is your feature request related to a problem? Please describe.
how to start using this?

Describe the solution you'd like
A quick start guide

Describe alternatives you've considered
A reading the code, but I don't see an entry point

Additional context
using google colab would be a great start

Improve some of the model's performance(How correct it is, not speed)

DayTradeModel is wrong more then it is right on the direction of the stock(like 48% correct).
ImpulseMACDModel is slightly more accurate then 50%(like 50-55% correct).

Problems/enhancements:

  • Stopping overfitting(early stop):
  • Getting better architecture(currently LSTM):
  • Specific stock training period for each stock
  • Add more Data Augmentation
  • Transfer learning

Which api to use(Choose)

Leaning towards Alpaca.
Pro's and Con's of Each

Alpaca (https://alpaca.markets/): Alpaca is a commission-free stock trading platform that offers a developer-friendly API for algorithmic trading. While they do have a free tier with limited functionality, you may need to upgrade to a paid plan for full trading capabilities.

TD Ameritrade (https://developer.tdameritrade.com/): TD Ameritrade provides a comprehensive API for accessing account data, placing trades, and retrieving market data. While their API is free to use, it requires an active TD Ameritrade brokerage account.

Robinhood API (unofficial): Robinhood is a commission-free brokerage platform, but they do not provide an official API for trading. However, there are unofficial third-party libraries and APIs available that allow limited access to Robinhood's trading functionality.

Add XGBoost

Is your feature request related to a problem? Please describe.
The ai is not as accurate as one would hope.

Describe the solution you'd like
Add XGBoost and mix it with tensorflow. This would increase accuracy by build multiple models one after the other. Each new model tries to correct the mistakes made by the previous models.

OVER FITTING

Is this a bug?

P.S: Chatgpt says it is because overfitting and I think that is the most likely case

Add a new model base

Is your feature request related to a problem? Please describe.
The accuracy on higher features is low. Look at: #77
Will partial fix it

Describe the solution you'd like
I would like the model to min-max scale per time frame(like past num_days) and the output as accuracy. This would make the model more stable. A way to add this to the existing model would be even better.

Describe alternatives you've considered
More methods to increase original one.

make api keys a separate file, (its easier for others to contribute code as well)

Is your feature request related to a problem? Please describe.
API keys and secrets should not be hard coded onto github. one way is the following:

Describe the solution you'd like
create a text file with keys inside as json.
image
then load the keys within the script.
(after import json)
image

use .gitignore to ignore the file, so that it doesn't get pushed into the public repo for everyone to see.
image

Describe alternatives you've considered
other libraries/methods are available, but this is the simplest solution imo.

Add more Data Augmentation

BY:

  • Shifting the timeframe
    This will simulate different timeframes(I like this idea the least).
  • Scaling data
    To simulate different magnitudes and make the model become more robust to different stock price ranges.
  • Injecting noise
    This will mimic real-world fluctuations.

Through multiple trains on each piece of changed data.

Transfer Learning

Describe the solution you'd like
Models learn off diff stocks. Should be easy since it is already scaled between 0 and 1. Just a bool into the train function.
This will make the model more generalized with more information.
It has to be trained on the actual stock last so it is fined tuned to it.

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.