Skip to content

iamwebwiz/spscalc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Synthetic Position Size Calculator

A Vue 3 application for calculating position sizes when trading synthetic indices. This tool helps traders determine the appropriate position size based on their account balance, risk tolerance, entry price, and stop loss level.

Features

  • Searchable Synthetic Index Selector - Easily find and select from all available synthetic indices with a searchable dropdown
  • Real-time Calculations - Position size updates automatically as you input values
  • Input Validation - Helpful error messages guide you to enter valid data
  • Modern UI - Beautiful gradient design with faded background text decoration
  • Responsive Design - Works seamlessly on desktop, tablet, and mobile devices
  • Detailed Results - Shows Risk Amount, Price Risk, and Position Size with proper formatting

Setup

  1. Install dependencies:
npm install
  1. Start the development server:
npm run dev
  1. Build for production:
npm run build
  1. Preview production build:
npm run preview

How to Use

  1. Select Synthetic Index - Choose the synthetic index you want to trade from the searchable dropdown (or type to search)
  2. Enter your Account Balance - Your total trading capital in dollars
  3. Enter Risk Per Trade - The percentage of your account you're willing to risk (e.g., 0.5, 1, 2, 5, 10, 50)
  4. Enter Entry Price - The price at which you plan to enter the trade
  5. Enter Stop Loss Price - The price at which you'll exit if the trade goes against you

The calculator will automatically compute:

  • Risk Amount: The dollar amount you're risking (Account Balance Γ— Risk Percentage)
  • Price Risk: The absolute difference between entry and stop loss prices
  • Position Size: The number of units you should trade (formatted to 4 decimal places)

Supported Synthetic Indices

  • VIX Indices: VIX 10 1s, VIX 10, VIX 25 1s, VIX 25, VIX 50 1s, VIX 50, VIX 75 1s, VIX 75, VIX 100 1s, VIX 100, VIX 150 1s, VIX 200 1s, VIX 250 1s, VIX 300 1s
  • Step Index
  • Boom Indices: Boom 300, Boom 500, Boom 1000
  • Crash Indices: Crash 300, Crash 500, Crash 1000
  • Jump Indices: Jump 10, Jump 25, Jump 50, Jump 75, Jump 100
  • Range Break Indices: Range Break 100, Range Break 200

Technology Stack

  • Vue 3 - Composition API for reactive, modern component architecture
  • Vite - Fast build tool and development server
  • @vueform/multiselect - Searchable dropdown component for synthetic index selection
  • Modern CSS - Gradient backgrounds, animations, and responsive design

Project Structure

spscalc/
β”œβ”€β”€ public/
β”‚   └── favicon.png          # Uptrend chart favicon
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   └── PositionSizeCalculator.vue  # Main calculator component
β”‚   β”œβ”€β”€ App.vue              # Root component with background decoration
β”‚   β”œβ”€β”€ main.js              # Application entry point
β”‚   └── style.css             # Global styles
β”œβ”€β”€ index.html               # HTML template
β”œβ”€β”€ vite.config.js           # Vite configuration
└── package.json             # Dependencies and scripts

Development

The app uses Vue 3's Composition API with reactive refs and computed properties for real-time calculations. Input validation ensures data integrity, and the UI provides immediate feedback through helpful error messages.

License

MIT

About

A Vue 3 application for calculating position sizes when trading synthetic indices πŸ“ˆ

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors