/StockAvg

A web application to calculate the additional shares needed to reach a desired average price of a stock.

Primary LanguageJavaScriptMIT LicenseMIT

StockAvg

StockAvg is a simple web application that helps calculate the number of additional shares to buy in order to achieve a desired average share price.

Table of Contents

Features

  • Calculates the number of additional shares required to reach the desired average share price.
  • Dynamically updates the result as input values change.
  • Provides a user-friendly interface to input previous shares, average price, current price, and desired average price.
  • Displays the result in whole numbers.

Getting Started

These instructions will help you set up and run the StockAvg application on your local machine.

Prerequisites

  • Web browser (Chrome, Firefox, Safari, etc.)

Installation

  1. Clone the repository or download the source code.
  2. Open the index.html file in your preferred web browser.

Usage

  1. Fill in the input fields with the following information:
    • Previous shares: Number of shares you already own.
    • Previous average price: Average price per share of the shares you already own.
    • Current price: Current price per share of the stock.
    • Desired average price: The average price per share you want to achieve.
  2. Click the "Calculate" button to calculate the number of additional shares required.
  3. The result will be displayed below the input fields, showing the number of additional shares you should buy to achieve the desired average price.
  4. If you want to reset the form, click the "Reset" button.

Contributing

Contributions to StockAvg are welcome! If you find any issues or have suggestions for improvement, please open an issue or submit a pull request.

License

This project is licensed under the MIT License.