├── .github └── FUNDING.yml ├── FiAi.png ├── FiAi.py ├── LICENSE └── README.md /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | 2 | github: [CorvusCodex] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 3 | patreon: # Replace with a single Patreon username 4 | open_collective: # Replace with a single Open Collective username 5 | ko_fi: corvuscodex 6 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 7 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 8 | liberapay: corvuscodex 9 | issuehunt: # Replace with a single IssueHunt username 10 | otechie: # Replace with a single Otechie username 11 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /FiAi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CorvusCodex/FiAi/97e84804dae8ca20d260700ff6e7771d4b18c31e/FiAi.png -------------------------------------------------------------------------------- /FiAi.py: -------------------------------------------------------------------------------- 1 | import yfinance as yf 2 | from sklearn.model_selection import train_test_split 3 | from sklearn.linear_model import LinearRegression 4 | from sklearn import metrics 5 | import numpy as np 6 | import datetime 7 | from art import text2art 8 | 9 | today = datetime.date.today() 10 | 11 | # Generate ASCII art as logo 12 | ascii_art = text2art("FiAi") 13 | 14 | print("============================================================") 15 | 16 | # Print the generated ASCII art 17 | print(ascii_art) 18 | print("Simple price prediction artificial intelligence") 19 | print("============================================================") 20 | print("Created by: Corvus Codex") 21 | print("Github: https://github.com/CorvusCodex/") 22 | print("Licence : MIT License") 23 | print("Support my work:") 24 | print("BTC: bc1q7wth254atug2p4v9j3krk9kauc0ehys2u8tgg3") 25 | print("ETH & BNB: 0x68B6D33Ad1A3e0aFaDA60d6ADf8594601BE492F0") 26 | print("Buy me a coffee: https://www.buymeacoffee.com/CorvusCodex") 27 | print("============================================================") 28 | print("For Symbols use https://finance.yahoo.com/lookup/") 29 | print("============================================================") 30 | 31 | # Ask the user for the stock or currency symbol 32 | symbol = input("Enter the symbol of the stock or currency: ") 33 | 34 | # Download historical data 35 | print("Downloading historical data for training...") 36 | today = datetime.date.today() 37 | data = yf.download(symbol, start='2010-07-17', end=today) 38 | print("Downloaded.") 39 | print("Training...") 40 | 41 | # Prepare data for model and make predictions for high, low, and close prices 42 | predictions = {} 43 | for price_type in ['High', 'Low', 'Close']: 44 | temp_data = data.copy() 45 | temp_data['Prediction'] = temp_data[price_type].shift(-1) 46 | temp_data.dropna(inplace=True) 47 | X = np.array(temp_data.drop(['Prediction'], axis=1)) 48 | Y = np.array(temp_data['Prediction']) 49 | 50 | # Split data into training set and test set 51 | x_train, x_test, y_train, y_test = train_test_split(X, Y, test_size=0.2) 52 | 53 | # Train the model 54 | model = LinearRegression() 55 | model.fit(x_train, y_train) 56 | 57 | # Make predictions 58 | temp_data['Prediction'] = model.predict(np.array(temp_data.drop(['Prediction'], axis=1))) 59 | 60 | # Store predictions 61 | predictions[price_type] = temp_data['Prediction'] 62 | 63 | # Print the predicted price for tomorrow, 7 days, 30 days, 1 year and 10 years from now 64 | print("Training complete.") 65 | print("============================================================") 66 | 67 | for i in [1, 7, 30, 365, 3650]: 68 | if len(data) > i: 69 | print(f"Predicted prices for {i} day(s) from now:") 70 | print(f"High: {predictions['High'].iloc[-i]}") 71 | print(f"Low: {predictions['Low'].iloc[-i]}") 72 | print(f"Close: {predictions['Close'].iloc[-i]}") 73 | print("============================================================") 74 | 75 | print("If you love this program, buy me a coffee: https://www.buymeacoffee.com/CorvusCodex") 76 | print("============================================================") 77 | 78 | # Prevent the window from closing immediately 79 | input('Press ENTER to exit') 80 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 CorvusCodex 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | 5 | # FiAi (Under Development) 6 | Simple Finance Forecasting Ai. This Ai Model uses historical price data to forecast future prices. The model is trained on data downloaded from Yahoo Finance using the yfinance library, and predictions are made using a linear regression Ai model from sklearn. The model supports all the symbols supported by Yahoo Finance. https://finance.yahoo.com/lookup/ 7 | The model is trying to forecast prices for next 24h, 7 days, 1 month and 1 year. 8 | 9 | ## For people who need Standalone Advanced Financial Forecast Ai that contains 18 different models for prediction in one, buy application for windows from here: 10 | https://www.buymeacoffee.com/corvuscodex/e/170309 11 | 12 | 13 | ## Installation 14 | 15 | Before running the script, you need to install the necessary Python libraries. You can do this with pip: 16 | '''pip install yfinance sklearn''' 17 | 18 | ## Usage 19 | To run the script, simply navigate to the directory containing the script in your terminal and run: 20 | '''python FiAi.py''' 21 | 22 | 23 | >Support my work:
24 | >BTC: bc1q7wth254atug2p4v9j3krk9kauc0ehys2u8tgg3
25 | >ETH & BNB: 0x68B6D33Ad1A3e0aFaDA60d6ADf8594601BE492F0
26 | >Buy me a coffee: https://www.buymeacoffee.com/CorvusCodex 27 | 28 | ## Support my work for month or year so i can continue to work on my projects: 29 | https://www.buymeacoffee.com/corvuscodex/membership 30 | 31 | ## Buy me some equipment: 32 | https://www.buymeacoffee.com/corvuscodex/wishlist 33 | 34 | ## Disclaimer 35 | 36 | The code within this repository comes with no guarantee, the use of this code is your responsibility. I take NO responsibility and/or liability for how you choose to use any of the source code available here. By using any of the files available in this repository, you understand that you are AGREEING TO USE AT YOUR OWN RISK. Once again, ALL files available here are for EDUCATION and/or RESEARCH purposes ONLY. 37 | 38 | Forecasting Financial prices is extremely complex and should not be done solely based on historical prices. Factors such as market trends, global economic indicators, and company financials should also be considered. This script is a very basic example and should and will be expanded upon for more accurate forecasts. Always consult with a financial advisor before making investment decisions. It is important to use FiAi responsibly and not rely on its predictions. 39 | 40 | MIT License 41 | 42 | Copyright (c) 2025 CorvusCodex 43 | 44 | Permission is hereby granted, free of charge, to any person obtaining a copy 45 | of this software and associated documentation files (the "Software"), to deal 46 | in the Software without restriction, including without limitation the rights 47 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 48 | copies of the Software, and to permit persons to whom the Software is 49 | furnished to do so, subject to the following conditions: 50 | 51 | The above copyright notice and this permission notice shall be included in all 52 | copies or substantial portions of the Software. 53 | 54 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 55 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 56 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 57 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 58 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 59 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 60 | SOFTWARE. 61 | 62 | 63 | --------------------------------------------------------------------------------