How amit0rana/betteroptionstrading works
This repository provides browser userscripts that add trading workflows and interface features to Zerodha Kite and several other market platforms. For the main betterKite workflow, a user opens Kite, configures settings, and the script initializes before wiring page interactions to features such as holdings, positions, P&L, and order controls. Separate scripts target Upstox, Sensibull, NSE India, Sharekhan, and other sites. The graph preserves documented product branches; some feature-to-orchestrator links are dashed because the excerpts do not show those calls.
Main entry points: main.js Event wiring · 01-init.js Bootstrap · 31-positions.js Positions · betterKite.user.js Kite userscript
Components 28
Kite startup
- Kite userscript
betterKite.user.js - Bootstrap
src/bootstrap/01-init.js - Event wiring
src/main.js
Shared core
- Settings
src/core/13-settings.js - Stored trading data
src/core/14-stored-data.js - Trading constants
src/core/10-constants.js - DOM paths
src/core/11-dom-paths.js - Utilities
src/core/12-utils.js - Margin API
src/core/15-margin-api.js - Row objects
src/core/16-row-objects.js
Trading features
- Holdings
src/features/30-holdings.js - Positions
src/features/31-positions.js - Watchlist
src/features/33-watchlist.js - P&L
src/features/34-pnl.js - Margin saving
src/features/35-margin-saving.js - Context menu
src/features/36-context-menu.js - Order adjustments
src/features/38-order-bump.js - Order window
src/features/41-order-window.js - Order sending
src/features/42-order-send.js
Other platform scripts
- Other platform scripts
- Upstox
betterUpstox.user.js - Sensibull
betterSensibull.user.js - NSE India
betterNSE.user.js - Sharekhan
betterSharekhan.user.js - Oipulse
betterOipulse.user.js - Stocks Developer
betterStocksDeveloper.user.js - Trading Economics
betterTradingeconomics.user.js
Other components
- Kite user
Connections 26
- Kite user → Kite userscript: opens Kite
betterKite.user.js - Kite userscript → Bootstrap: initializes via
- Bootstrap → Settings: waits for settings
- Bootstrap → Event wiring: starts after init
- Event wiring → Settings: reads settings
- Event wiring → Holdings: wires interactions
- Event wiring → Positions: wires interactions
- Event wiring → Watchlist: wires interactions
- Event wiring → P&L: wires interactions
- Event wiring → Margin saving: wires interactions
- Event wiring → Context menu: wires interactions
- Event wiring → Order adjustments: wires interactions
- Event wiring → Order window: wires interactions
- Event wiring → Order sending: wires interactions
- Holdings → Stored trading data: uses persisted data
- Positions → Stored trading data: uses strategies
src/features/31-positions.js - Positions → Row objects: reads position rows
- Margin saving → Margin API: uses margin calculations
- Order adjustments → Order sending: adjusts pending orders
- Other platform scripts → Upstox: includes
README.md - Other platform scripts → Sensibull: includes
README.md - Other platform scripts → NSE India: includes
README.md - Other platform scripts → Sharekhan: also targets
betterSharekhan.user.js - Other platform scripts → Oipulse: also targets
betterOipulse.user.js - Other platform scripts → Stocks Developer: also targets
betterStocksDeveloper.user.js - Other platform scripts → Trading Economics: also targets
betterTradingeconomics.user.js