Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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*.
- Host: GitHub
- URL: https://github.com/bajajcodes/profit-or-loss-on-stocks
- Owner: bajajcodes
- Created: 2021-09-13T13:27:43.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-09-21T17:52:45.000Z (about 3 years ago)
- Last Synced: 2024-10-11T12:10:19.223Z (about 1 month ago)
- Topics: css, html, javascript
- Language: JavaScript
- Homepage: https://profit-or-loss-on-stocks.netlify.app/
- Size: 333 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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 asProfit Percentage = (Profit/CostPrice)*100
>> - Loss percentage is calculated asLoss 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/)