Skip to main content

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
  • Logging to file and console

Requirements

  • Python 3.7–3.12 (not compatible with Python 3.13)
  • See requirements.txt for 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, or large

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 dist folder as StockSim.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 command error, 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 stocksim again.


License

This project is licensed under the MIT License. See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stocksim-1.3.3.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stocksim-1.3.3-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file stocksim-1.3.3.tar.gz.

File metadata

  • Download URL: stocksim-1.3.3.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for stocksim-1.3.3.tar.gz
Algorithm Hash digest
SHA256 684ba2cc22df92d05273694931580968d7b81dc4f23bcd9182ec6b3e43cb1883
MD5 f41fc4a0741f1ca665245ab87760b898
BLAKE2b-256 cbc33cf1617a1b64eaf6ee7a7fb9aedd3aba37a44320788777c93c7b2a0dd886

See more details on using hashes here.

Provenance

The following attestation bundles were made for stocksim-1.3.3.tar.gz:

Publisher: python-publish.yml on ElementalPublishing/StockSim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file stocksim-1.3.3-py3-none-any.whl.

File metadata

  • Download URL: stocksim-1.3.3-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for stocksim-1.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3530a23324bda2b448cf5b139a7da6fcccb51809272698a0a1a77d7b87372274
MD5 04281caaeccf006319cfae4c96139d4c
BLAKE2b-256 d445ebb342bbc56444b8d26bcc9dc290e4a348c201eaf96dc35ad2d584e1c752

See more details on using hashes here.

Provenance

The following attestation bundles were made for stocksim-1.3.3-py3-none-any.whl:

Publisher: python-publish.yml on ElementalPublishing/StockSim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page