Skip to content

Averages your purchased stocks with current market prices to incrementally display your new potential averages.

License

Notifications You must be signed in to change notification settings

Mas9311/stock-average

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compute Your Potential Average

image

Program to display your potential averages if you were to buy additional shares or coins today.
Note: the symbols/ folder will be created to store each of your entries so you can reuse them later.

Usage

Prerequisite: pip3 install matplotlib

Select your Operating System for information on downloading and running:

Linux / Unix 1. Open a Terminal window and paste: git clone https://github.com/Mas9311/stock-average.git
2. cd stock-average/
3. Run the program: python3 run.py
Append the -h | --help argument to view all accepted arguments.
Windows 1. Open a Terminal window. If you don't know how, use the default: [Windows + r] "cmd" [Enter]
2. Paste: cd Desktop && git clone https://github.com/Mas9311/stock-average.git
If you encounter an error 'git' is not recognized as an internal or external command, operable program or batch file.
Means that you either:

Have not downloaded git yet

- Download git by visiting https://git-scm.com/download/win
- Install the executable. If you don't know, use the default value.
- For the terminal emulator (MinTTY | cmd), I recommend "Use Windows' default console window".

You need to set the PATH variable. This guide will help you:

https://stackoverflow.com/a/4493004/10344943
3. cd stock-average/
4. Run the program: python.exe run.py
Append the -h | --help argument to view all accepted arguments.

Methodology

Have you ever wanted to take the mean of N items, then wanted to see the impact for (N + 1) items?

  • i.e. Finding what you need to score on the final exam to attain a desired letter grade.

Thankfully, you don't need to re-enter those items every time if you record the numerator and denominator beforehand.

Scenario:

  • You previously purchased some shares of a stock at a high price, and the price has dropped since then.
  • Because the stock is "on sale", you are willing to spend some money today to help lower your current average.
  • You now need to quantify how many shares you would need to purchase at the current price.

This program will display your potential averages incrementally, so you can gauge for yourself.

  • Command Line Interface will print a wall of text.
  • Graphical User Interface has an option to display as a T-Chart or a Graph.

Formula:

n represents the amount of shares you previously purchased at the oldPrice.
x represents the amount of shares you would potentially need to buy at the currentPrice.

(n * oldPrice) + (x * currentPrice)
-----------------------------------
              (n + x)

About

Averages your purchased stocks with current market prices to incrementally display your new potential averages.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages