Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aleff-github/organize-btc-target-prices
Simulation of scheduled sales of your BTC. No data you enter will be acquired, analyzed, stored, or sold. I am working on adding the ability to set targets to your liking.
https://github.com/aleff-github/organize-btc-target-prices
bitcoin btc btc-simulator gplv3 price-target price-target-btc
Last synced: 17 days ago
JSON representation
Simulation of scheduled sales of your BTC. No data you enter will be acquired, analyzed, stored, or sold. I am working on adding the ability to set targets to your liking.
- Host: GitHub
- URL: https://github.com/aleff-github/organize-btc-target-prices
- Owner: aleff-github
- License: gpl-3.0
- Created: 2024-08-19T11:01:44.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-08-21T14:55:16.000Z (3 months ago)
- Last Synced: 2024-09-26T13:23:42.359Z (about 2 months ago)
- Topics: bitcoin, btc, btc-simulator, gplv3, price-target, price-target-btc
- Homepage: https://aleff-github.github.io/Organize-BTC-Target-Prices/
- Size: 1.14 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# BTC Price Target Simulator
No data you enter will be captured, analyzed, stored or sold.
The **BTC Price Target Simulator** is a web application that allows users to simulate Bitcoin value outcomes based on specified target prices. Users can input the amount of BTC they own, the anticipated peak price, and choose from different selling strategies. The application displays the results in a table, highlighting reserves, values, and cash reserves at various price targets.
## Features
- **Data Input:** Users can enter the amount of BTC they hold and the anticipated peak price.
- **Selling Strategies:** Choose between 1, 5, or 10 target prices with varying selling percentages.
- **Simulation:** Calculates and displays simulation results in a table, including reserves, values, and cash reserves.## Requirements
- Internet connection to retrieve the current Bitcoin price via the CoinGecko API.
## Project Structure
The project consists of the following files:
- **`index.html`**: The main HTML file containing the structure and layout of the app.
- **`style.css`**: The CSS stylesheet for formatting and styling the app.
- **`script.js`**: The JavaScript file managing the app's logic and price target simulation.## Technical Details
- **Fetching Bitcoin Price:** The current Bitcoin price is retrieved using the CoinGecko API. An error message is displayed if the request fails.
- **Target Price Calculation:** The simulation calculates the value of BTC at various target prices and updates reserves and cash reserves based on the selling percentages.
- **Data Formatting:** Numerical data is formatted in US dollars using `Intl.NumberFormat`.### Arbitrary Strategy
This section describes the JavaScript functions used to manage and display a list of percentage values that users can select or enter. Here’s a brief overview:
1. **`addIntoTheHTMLTagTheNewValue(value)`**
- Adds a new percentage value to the display area. If it's the first value, it starts with that value; otherwise, it adds the new value to the existing list.2. **`addValue(value)`**
- Adds a percentage value to the list if it’s valid and not already at 100%. Updates the display with the new value.3. **`handleStandardValue(value)`**
- Handles the addition of predefined percentage values from buttons.4. **`handleCustomValue()`**
- Adds a custom percentage value entered by the user.5. **`removeTheLastOne()`**
- Removes the last added percentage value from the list and updates the display.6. **`clean()`**
- Resets the list of values and the display to the initial state.These functions allow users to build, modify, and clear a strategy based on percentage values.
## Example of Arbitrary strategy
### Scenario
- BTC Amount: `0.50`
- Anticipated Peak Price: `150,000 USD`
- Target Prices: `10% - 16% - 30% - 1% - 1% - 1% - 99% - 1% - 100%`![](./assets/2.png)
### Result
The table will display the following data for each step:
- Initial Reserve
- Current Price
- Current Value
- Target Price
- Selling Percentage
- Quantity Sold
- New Reserve
- New Value
- Accumulated Cash Reserve![](./assets/22.png)
## Example of Standard Strategy Usage
### Scenario
- BTC Amount: `0.50`
- Anticipated Peak Price: `150,000 USD`
- Target Prices: `5` (percentages: 10%, 10%, 20%, 30%, 100%)### Result
![](./assets/1.png)
As you can see in purple is shown the dollar value of the amount of Bitcoin that was held, while in yellow is shown how many dollars it was possible to set aside by following this procedure
![](./assets/12.png)
## Contributing
If you would like to contribute to this project, please follow these steps:
1. Fork the repository.
2. Create a new branch for your feature (`git checkout -b feature/new-feature`).
3. Commit your changes (`git commit -am 'Add new feature'`).
4. Push the branch (`git push origin feature/new-feature`).
5. Create a pull request.**OR**
open a topic/issue to suggest new strategies.
## License
This project is licensed under the GPLv3 License. See the `LICENSE` file for more details.