How skmbatha/forex-math works
ForexMath is a small wxWidgets desktop calculator for forex trade risk and margin. The user enters price, lot size, digit count, leverage, and leaves a target value blank; Calculate validates inputs, derives the missing take-profit/stop-loss or lot/profit-loss value, and can compute margin. A toggle converts displayed profit/loss and margin between price-relative and absolute amounts. The sampled sources show the GUI and calculation flow; no persistence or external services are evident.
Main entry points: ForexMathMain.cpp Calculator Window · GUIFrame.cpp Calculator Form · ForexMathApp.cpp App Startup
Components 9
Desktop Application
- App Startup
ForexMathApp.cpp - Calculator Window
ForexMathMain.cpp - Calculator Form
GUIFrame.cpp
Forex Calculations
- Input Validation
ForexMathMain.cpp - Trade Risk Math
ForexMathMain.cpp - Margin Math
ForexMathMain.cpp - Currency Toggle
ForexMathMain.cpp - Field Helpers
ForexMathMain.cpp
Other components
- User
Connections 12
- App Startup → Calculator Window: creates
ForexMathApp.cpp - Calculator Window → Calculator Form: inherits
- User → Calculator Form: enters values
GUIFrame.cpp - Calculator Form → Calculator Window: dispatches actions
ForexMathMain.cpp - Calculator Window → Input Validation: validates inputs
ForexMathMain.cpp - Calculator Window → Trade Risk Math: calculates missing value
ForexMathMain.cpp - Calculator Window → Margin Math: calculates margin
ForexMathMain.cpp - Calculator Window → Currency Toggle: handles toggle
ForexMathMain.cpp - Input Validation → Field Helpers: highlights fields
ForexMathMain.cpp - Trade Risk Math → Field Helpers: shows answer
ForexMathMain.cpp - Margin Math → Field Helpers: shows answer
ForexMathMain.cpp - Currency Toggle → Field Helpers: reads field values
ForexMathMain.cpp