Monte Carlo Stock/Crypto Price Simulation Tool
Project description
StockSim
Monte Carlo Stock & Crypto Price Simulation Tool
StockSim is a Python command-line tool for estimating the probability of gain for stocks, cryptocurrencies, or indices using Monte Carlo simulation and real historical data.
Features
- Simulate future price paths for stocks, crypto, or indices
- Uses real historical data via yfinance
- Multiprocessing for fast simulations
- Command-line interface
Requirements
- Python 3.7–3.12 (not compatible with Python 3.13)
- See
requirements.txtfor required packages
Installation
From PyPI (recommended)
pip install stocksim
From source
git clone https://github.com/ElementalPublishing/StockSim.git
cd StockSim
pip install -e .
Usage
After installation, run from the command line:
stocksim
Or, if running from source:
python -m stocksim.main
Command-Line Options
You can run StockSim with the following options:
-
--symbol
Ticker symbol (e.g.,BTC-USD,ETH-USD,AAPL,SPX:IND,EURUSD:CUR) -
--years
Investment period in years (e.g.,1) -
--simsize
Simulation size:small,medium, orlarge
Examples:
stocksim --symbol BTC-USD --years 5 --simsize large
stocksim --symbol AAPL --years 3 --simsize medium
If you omit any option, the program will prompt you for input interactively.
Build Windows Executable (Optional)
To build a Windows executable with your custom icon:
pyinstaller --icon=shaggy.ico --name=StockSim stocksim/main.py
- The EXE will be in the
distfolder asStockSim.exe.
Notes
- Compatible with Python 3.7–3.12, PyInstaller 5.13.2, and setuptools <80 (tested with 79.0.1).
- Note: Logging to files has been removed due to compatibility issues. All output is now printed to the console.
- For issues or feature requests, please use the GitHub Issue Tracker.
Note:
If you get a'stocksim' is not recognized as an internal or external commanderror, you may need to add your Python Scripts directory to your system PATH.For a typical Python installation on Windows, add:
C:\Users\<YourUser>\AppData\Local\Programs\Python\<Your Python Version>\Scripts(Replace
<YourUser>with your actual username and<Your Python Version>with your installed Python version, e.g.,Python312.)After updating your PATH, restart your terminal or Command Prompt and try running
stocksimagain.
License
This project is licensed under the MIT License. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file stocksim-2.0.5.tar.gz.
File metadata
- Download URL: stocksim-2.0.5.tar.gz
- Upload date:
- Size: 83.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f13b5f87fe76e300391551c50bd2d06976308803814d55c28fcd701f7a151a8
|
|
| MD5 |
839472a8c9bfd519646a33c0d67f9356
|
|
| BLAKE2b-256 |
dc56168d05d9440b9aa5a188157b30592246af57c1e5ecbeb5f9d7283c0293bf
|
Provenance
The following attestation bundles were made for stocksim-2.0.5.tar.gz:
Publisher:
python-publish.yml on ElementalPublishing/StockSim
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stocksim-2.0.5.tar.gz -
Subject digest:
3f13b5f87fe76e300391551c50bd2d06976308803814d55c28fcd701f7a151a8 - Sigstore transparency entry: 230473965
- Sigstore integration time:
-
Permalink:
ElementalPublishing/StockSim@949d643bcc7eaa5f444a8e73a2d9c6df848cafab -
Branch / Tag:
refs/tags/v2.0.5 - Owner: https://github.com/ElementalPublishing
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@949d643bcc7eaa5f444a8e73a2d9c6df848cafab -
Trigger Event:
release
-
Statement type: