Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bajajcodes/profit-or-loss-on-stocks

Check how much you make profit or how much you lost for stocks you purchased without real time system. Give stock buying price, how many stocks brought and today's price and get to know about your forecast. Keep in mind, Stocks are subject to risk, but this is *a meme*.
https://github.com/bajajcodes/profit-or-loss-on-stocks

css html javascript

Last synced: 13 days ago
JSON representation

Check how much you make profit or how much you lost for stocks you purchased without real time system. Give stock buying price, how many stocks brought and today's price and get to know about your forecast. Keep in mind, Stocks are subject to risk, but this is *a meme*.

Awesome Lists containing this project

README

        

# Profit or Loss on Stocks

## List of Contents
- Description
- Input
- Output
- Processing
- Screenshots
- Link

> Check profit earned or loss gained on stocks bought. Enter required inputs stated below, click on `Give Me Update` button and get to know outcome of your bet. App output section theme get's changed on basis of percentage of profit earned or loss gained. Click on the link below to laugh or cry.


> **Input:** The user has to enter input three times, first stocks buying
price, second number of stocks bought and last current or today's price of stock. User is only allowed to enter positive numbers, quantity cannot be in fractions. If wrong input entered by user, will get informed with message.


> **Output:** Profit earned or Loss gained in absolute number and percentage as well. Output section color get changed based on profit or loss percentage, higher the profit darken the green color and similarly higher the loss darken the red color. If in case no profit or loss, then output section color get changed to yellow indicating peace.


> **Processing:**
>> - Get stocks buying price and check if zero or negative number, if not then move next, else update user.
>> - Get number of stocks, check is zero, negative number or fractinal value, if not then move next, else update user.
>> - Get stocks today's price and procedure repeated same as for stocks buying price.
>> - If every check passed, update the user with outcome and update the output section.
>> - Output section theme color, get decided based on calculated percentage. Percentage is divide into four less 25%, 50%, 75 % and 100%. Profit and Loss color has four variants of colors based on percentage.
>> - Profit percentage is calculated as

Profit Percentage = (Profit/CostPrice)*100

>> - Loss percentage is calculated as
Loss Percentage = (Loss/CostPrice)*100



> **Screenshots**
>> ![Initial(app load) image not available](https://github.com/shmbajaj/profit-or-loss-on-stocks/blob/main/screenshots/initial.png?raw=true)
>>
>> ![Profit image not available](https://github.com/shmbajaj/profit-or-loss-on-stocks/blob/main/screenshots/profit.png?raw=true)
>>
>> ![No Profit No Loss image not available](https://github.com/shmbajaj/profit-or-loss-on-stocks/blob/main/screenshots/no_profit_loss.png?raw=true)
>>
>> ![Loss image not available](https://github.com/shmbajaj/profit-or-loss-on-stocks/blob/main/screenshots/loss.png?raw=true)
>>


> **Link:** [Profit or Loss on Stocks](https://profit-or-loss-on-stocks.netlify.app/)