A beautiful web application for simulating cash-secured put options strategies, built with Flask, Chart.js, and modern web technologies.
- Interactive Options Simulator: Add and remove multiple options to visualize potential profit/loss scenarios
- Real-time Stock Data: Fetches current stock prices using Yahoo Finance API
- Beautiful UI: Modern, responsive design with intuitive user interface
- Detailed Analysis: View maximum profit, maximum loss, and break-even points for each option
- Multi-option Comparison: Compare different strike prices and premiums side by side
-
Clone the repository:
git clone https://github.com/yourusername/options-simulator.git cd options-simulator
-
Create and activate a virtual environment (optional but recommended):
python -m venv .venv .venv\Scripts\activate # On Windows source .venv/bin/activate # On macOS/Linux
-
Install the required dependencies:
pip install -r requirements.txt
-
Start the Flask application:
python app.py
-
Open your web browser and navigate to:
http://localhost:5000
-
Enter a ticker symbol, strike price, and premium to add an option to the simulation.
-
Click "Add Option" to add the option to your simulation.
-
Click "Update Simulation" to view the profit/loss chart and summary information.
- Install dependencies:
pip install -r requirements.txt
- Run the development server:
python app.py
- Visit
http://localhost:5000
in your browser
-
Create a new account on Render.com
-
Click "New +" and select "Web Service"
-
Connect your GitHub repository
-
Fill in the following details:
- Name:
options-simulator
(or your preferred name) - Environment:
Python 3
- Build Command:
pip install -r requirements.txt
- Start Command:
gunicorn app:app
- Plan:
Free
- Name:
-
Click "Create Web Service"
Your application will be deployed and available at a URL like: https://your-app-name.onrender.com
options-simulator/
├── app.py # Flask application
├── static/ # Static files
│ ├── css/ # CSS stylesheets
│ │ └── styles.css # Main stylesheet
│ └── js/ # JavaScript files
│ └── app.js # Main JavaScript file
├── templates/ # HTML templates
│ └── index.html # Main page template
├── requirements.txt # Python dependencies
└── README.md # This file
- Backend: Flask (Python)
- Frontend: HTML5, CSS3, JavaScript
- Charts: Chart.js
- Icons: Font Awesome
- Stock Data: Yahoo Finance API (yfinance)
- Styling: Custom CSS with responsive design
MIT
- Yahoo Finance for providing stock data
- Chart.js for the interactive charts
- Font Awesome for the icons