There's a lot of details about the project in the ReadMe or Luis' Medium blog make sure you read it.
Welcome to the setup guide for the project. Here, you will find step-by-step instructions to set up the project on your system. The guide assumes you are using Windows, but the steps are similar for Mac OS and Linux.
Before you begin, please make sure you have the following prerequisites:
- Anaconda Python (recommended) or Python version < 3.10
- Visual C++ installed for Tensorflow on Windows
- An IDE of your choice, such as PyCharm or Visual Studio Code
- Clone this repository
- Optional step - Setup your python virtual environment
-
Installing the TA-Lib Python package may be slightly tricky. You can try the instructions provided on their GitHub or directly from their source. If you are a Windows user, you can also download the version applicable to your Python from the University of California, Irvine archive.
-
Next, depending on your system (Python or Python3), run the following command to install the required Python packages (from the project directory):
python -m pip install -r requirements.txt
Note: If you encounter a warning or a message saying "tensorflow-gpu" couldn't be installed, you can ignore it for now. If there were no major errors, you should have everything installed and ready to go.
Before running the project, you need to configure a few settings:
-
Setting up Stock Tickers - Open the file
_KEYS_DICT.py
and go to line 13. You will see a line like this:["UBER", "PYPL"],
Here, you can enter the stock tickers you are interested in from NASDAQ or DOW Jones.
If you have a suitable GPU that you wish to use for computation, find line 62 in _KEYS_DICT.py
and change the value of USE_GPU
to "Yes"
.
Additionally, on line 63 of _KEY_DICT.py
you can adjust the PER_PROCESS_GPU_MEMORY_FRACTION
value. This step is optional but can be useful if you only want to use a fraction of your GPU resource.
2. Setting up Telegram Bot - To set up your own Telegram Bot, follow the tutorial
Once you have obtained the Bot token, your admin user ID, and the recipient's ID number, update the credentials in the file ztelegram_send_message_handle.py
.
3. Setting up Twitter Handle - If you want to set up a Twitter handle, you can raise an issue on GitHub or reach out through the details given in the README file for twi_credential.py
-
If you have followed the above steps correctly, you should now be able to run the project files. Start by running the files named from 0 to 5 in sequential order.
If you encounter any missing files, refer to the README file for further instructions.
If you encounter an error similar to the one shown below, follow the steps below; otherwise, it is not required:
Traceback (most recent call last):
File "C:\Users\user\projects\stocks-prediction-Machine-learning-RealTime-telegram\get_technical_indicators.py", line 46, in <module>
df_download = yhoo_history_stock.get_favs_SCALA_csv_stocks_history_Download_list(list_stocks, CSV_NAME, opion, GENERATED_JSON_RELATIONS = GENERATED_JSON_RELATIONS)
...
AttributeError: 'Series' object has no attribute 'append'. Did you mean: '_append'?
-
Go to the location of your virtual environment. For example:
File "C:\Users\user\projects\virtualenv\stocks-prediction-Machine-learning-RealTime-telegram\lib\site-packages\pandas_ta\overlap\mcgd.py", line 24, in mcgd mcg_ds = close[:1].append(mcg_cell[1:])
-
Make a copy of the file
pandas_ta\overlap\mcgd.py
-
Change this line from
mcg_ds = close[:1].append(mcg_cell[1:])
tomcg_ds = close[:1]._append(mcg_cell[1:])
Notice the addition of the underscore before append.