What the Source Code Does
This Consistency Calculator is a web application designed to help traders track and analyze their trading performance, ensuring compliance with prop firm consistency rules. Below is an overview of its functionality:
- Consistency Calculator: Allows users to input daily profits/losses and check compliance with prop firm rules (e.g., MyFundedFutures, Topstep, Apex Trader Funding, or Custom). It calculates total profit and ensures no single day's profit exceeds a specified percentage (e.g., 30%–50%) of the total, with customizable profit targets for Custom plans.
- Trade Stats: Enables users to log daily trading results, visualize them in line, bar, or area charts using Chart.js, and toggle visibility of input fields. Trades linked to Nasdaq Trades are protected from deletion.
- Calendar: Displays trading profits/losses from Trade Stats in a monthly calendar starting from the current day (e.g., July 20, 2025), with color-coded profit (green), loss (red), or neutral (blue) days. Users can download the calendar as a PNG.
- Nasdaq Trades: Tracks Nasdaq Mini (NQ) and Micro (MNQ) trades, calculating profit/loss based on entry/closing prices and contracts. It syncs profits with Trade Stats and includes a closing price calculator.
- Local Storage: Persists all data (trades, consistency, Nasdaq trades) in the browser's localStorage, ensuring data is retained across sessions until the cache is cleared.
- Responsive Design: Built with Tailwind CSS, featuring a fixed navbar with smooth transitions, responsive layouts, and hover effects for interactivity.
The source code below is the complete index.html file, which includes HTML, CSS, and JavaScript to power the application. It uses Tailwind CSS for styling, Chart.js for charts, and html2canvas for calendar downloads.