https://github.com/zaironjacobs/stock-position-calc
A simple program to manage risk and calculate the right amount of shares to buy.
https://github.com/zaironjacobs/stock-position-calc
buy-shares pypi risk stock stock-market
Last synced: about 1 year ago
JSON representation
A simple program to manage risk and calculate the right amount of shares to buy.
- Host: GitHub
- URL: https://github.com/zaironjacobs/stock-position-calc
- Owner: zaironjacobs
- License: mit
- Created: 2020-08-12T09:40:09.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2021-11-09T21:54:48.000Z (over 4 years ago)
- Last Synced: 2025-02-19T09:24:34.742Z (over 1 year ago)
- Topics: buy-shares, pypi, risk, stock, stock-market
- Language: Python
- Homepage:
- Size: 39.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Stock Position Calculator
=================
[](https://pypi.python.org/pypi/stock-position-calc)
[](https://pypi.python.org/pypi/stock-position-calc)
[](https://pypi.python.org/pypi/stock-position-calc)
[](https://pypi.python.org/pypi/stock-position-calc)
A simple program to manage risk and calculate the right amount of shares to buy.
## Install with pip
To install:
```console
$ pip install stock-position-calc
```
To upgrade:
```console
$ pip install stock-position-calc --upgrade
```
For some Linux distributions you will need to install the tkinter package:
```console
$ sudo apt update
$ sudo apt install python3-tk
```
Launch program:
```console
$ stock-position-calc
```
## Or create a file to run the program
Windows:
```console
$ git clone https://github.com/zaironjacobs/stock-position-calc
$ cd stock-position-calc
$ pipenv install --dev
$ pipenv run pyinstaller stock_position_calc/app.py --onefile --windowed
```
Linux:
```console
$ git clone https://github.com/zaironjacobs/stock-position-calc
$ cd stock-position-calc
$ pipenv install --dev
$ pipenv run pyinstaller stock_position_calc/app.py --onefile --windowed
$ sudo chmod +x dist/app
```
The output file can be found in the dist folder.
## Usage
#### Fixed Cash Amount:
Will calculate the number of shares solely based on the amount you want to invest in a trade.
Example: You have $10,000 to invest in a stock and you would like to buy shares of that stock when the price falls down to $20.
The amount of shares you will buy will be 500 ($10,000 / $20).
#### Fixed Risk:
Will calculate the number of shares based on how much you are willing to risk.
Example: You have an account size of $10,000 and you would like to buy shares of a stock when the price falls down to $20.
You decide on a stop loss of 15% ($17) and you want to risk only 1% ($100) of your account size.
The amount of shares you will buy will be 33 ($100 / ($20 - $17)).
\