Buffet is part of a sophisticated Trading AI trained to perform and outperform human traders. Buffet V2 is an advanced trading algorithm that derives, tests, and optimizes trading strategies. It can perform paper trading or live trading on actual accounts, utilizing different optimizations to find the best parameters for trading. In this version we are focused on rebuilding the software architecture and letting Buffet run on a paper trading brokerage.
-
Clone the repository:
git clone https://github.com/KenSu2003/Buffet.git cd Buffet git checkout branchForV2
-
Install the required dependencies:
pip install -r requirements.txt
-
If the installation does not work follow these steps:
< Install TA-Lib > pip install numpy==1.26.4 brew install ta-lib pip install TA-Lib < Install Bayesian Optimization > pip install bayesian-optimization < Install Alapaca API > pip install alpaca-py < Install Other Tools > pip install pandas pip install matplotlib pip install apscheduler
PI USERS: Refer to the TA-Lib Installation Guide for detailed instructions on resolving any issues related to the TA-Lib C library or Python wrapper installation.
-
Set the Correct Parameters:
Ensure you’ve correctly configured key parameters like timeframes, thresholds, and risk limits inpaper_trading.py
. -
Switch or Write a New Strategy:
- Pick or write a strategy in
strategies.py
. - Modify the
strategy
variable inpaper_trading.py
to select the appropriate strategy.
- Pick or write a strategy in
-
Modify Optimizers (If Needed):
- Edit or switch optimizers in the
optimizers.py
file. - Update the corresponding optimizer reference in
paper_trading.py
.
- Edit or switch optimizers in the
-
Run
paper_trading.py
:
Execute thepaper_trading.py
script to start paper trading with the selected strategy and parameters.python Buffet/Code/paper_trading.py
-
Run the Shell File:
Use the providedautomated_testing.sh
to automate the execution ofpaper_trading.py
with background logging../Buffet/automated_testing.sh
-
Find the process ID (PID):
To identify the process running thepaper_trading.py
script, use one of the following commands:-
Using
ps
andgrep
:ps aux | grep paper_trading.py
This will display a list of matching processes, showing their PIDs in the second column.
-
Using
pgrep
:pgrep -f paper_trading.py
This command will return the PID(s) directly.
-
-
Kill the process:
To terminate the process, use thekill
command:kill PID
For example:
kill 12345
-
Force kill (if necessary):
If the process does not terminate with the standardkill
command, use the-9
option to force termination:kill -9 PID
For example:
kill -9 12345
-
Verify the process has been terminated:
Check that the process is no longer running:ps aux | grep paper_trading.py
If no process appears, the termination was successful.
- Technical Indicators: Utilizes various technical indicators to predict market movements.
- Simulated Trading: Allows for backtesting and strategy optimization in a simulated environment.
- Risk Management: Includes modules for setting take-profit and stop-loss levels to manage risk.
- Paper Trading: Capable of executing trades in a paper trading environment.
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes and commit them (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature-branch
). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.