
An app for monitoring investment portfolios in Mexico, including assets such as FIBRAs, ETFs, and other dividend-paying instruments. It generates alerts via Telegram and allows you to simulate financial scenarios using PER and dividend yield.



- Backend: Ruby on Rails (API-only) DONE!!!
- Frontend: ReactJS + Vite (NOT YET)
- Alertas: Telegram Bot API (NOT YET)
- Background Jobs: Sidekiq (NOT YET)
- Base de datos: PostgreSQL (NOT YET)
The application provides the following functionalities:
- View Portfolio: Display current investment positions.
- Simulate Dividends: Estimate potential dividend income.
- Set Price Alerts: Create alerts for specific stock prices.
- Simulate Rebalance: Analyze portfolio rebalancing scenarios.
- Simulate Growth with Dividends: Project portfolio growth over time with reinvested dividends.
- Check Saved Alerts: View all saved price alerts.
- Delete Alert by Ticker: Remove a specific price alert by its ticker.
- Edit Alert Price: Update the target price of an existing alert.
- Exit: Close the application.
The edit_alert_price
method allows users to update the target price of an existing alert. Here's how it works:
- Search Alerts: The user provides criteria (e.g., Ticker) to search for matching alerts.
- Display Matches: All matching alerts are displayed with their details (Ticker, Target Price, Status).
- Select Alert: The user selects the alert they want to edit by entering its corresponding number.
- Update Target Price: The user enters a new target price for the selected alert.
- Validation: The method ensures the input is valid (e.g., within range, positive price).
- Save Changes: The updated alert is saved back to the storage.
Enter the criteria to search alerts (e.g., Ticker): AAPL
Matching Alerts:
1. Ticker: AAPL, Target Price: 200, Status: Active
Enter the number of the alert you want to edit (1-1): 1
Enter the new target price for AAPL: 250
✅ Target price for AAPL has been updated to 250.
The save_alerts
method is responsible for persisting all alerts to a storage file. Here's how it works:
- Purpose: Ensures that all alerts are saved to a file for future retrieval.
- File Format: Alerts are stored in a CSV file format for easy readability and compatibility.
- Overwrite Behavior: Each time the method is called, it overwrites the existing file with the latest alert data.
- Data Saved: Each alert includes the following details:
- Ticker
- Target Price
- Status (e.g., Active, Inactive)
# Example of saving alerts
alerts = [
{ ticker: "AAPL", target_price: 150, status: "Active" },
{ ticker: "GOOGL", target_price: 2800, status: "Inactive" }
]
Ticker,Target Price,Status
AAPL,150,Active
GOOGL,2800,Inactive
The delete_alert_by_ticker
method allows users to remove an alert associated with a specific ticker. Here's how it works:
- Search Alerts: Users provide the ticker symbol of the alert they want to delete.
- Display Matches: All alerts matching the provided ticker are displayed.
- Confirm Deletion: Users confirm whether they want to delete the alert.
- Remove Alert: The selected alert is removed from the storage.
- Save Changes: The updated list of alerts is saved back to the storage file.
Enter the ticker of the alert you want to delete: AAPL
Matching Alerts:
1. Ticker: AAPL, Target Price: 200, Status: Active
Are you sure you want to delete this alert? (yes/no): yes
✅ The alert for AAPL has been successfully deleted.