PnlTracker
Developer

Plugins

Plugin compilation and packaging guide for PnlTracker.

PnlTracker has a plugin system that allows you to extend its features without modifying the application's source code. Plugins are developed in the plugins-dev/ folder and compiled into .zip format to be imported into the application. This is very convenient for adding custom features while keeping a clean codebase.

Prerequisites

  • Node.js ≥ 20
  • pnpm installed

Compile a plugin

Replace hello-plugin with your plugin's name:

PLUGIN=hello-plugin npx vite build --config plugins-dev/vite.config.plugin.ts

Examples with included plugins:

PLUGIN=trade-stats-plugin npx vite build --config plugins-dev/vite.config.plugin.ts

PLUGIN=file-processor-plugin npx vite build --config plugins-dev/vite.config.plugin.ts

PLUGIN=instrument-type-fixer npx vite build --config plugins-dev/vite.config.plugin.ts

Included examples

The plugins-dev/ folder contains several example plugins you can use as a starting point:

PluginDescription
hello-pluginDemonstration plugin showing modals, toasts, and page slots on the dashboard, trades, calendar, and daily views.
trade-stats-pluginDisplays a quick summary of recent trading performance in a modal.
file-processor-pluginUpload, process, and download files directly in the browser.
instrument-type-fixerBulk-fix the instrument type for all trades of an account.
tradingview-converterConverts TradingView exports (backtests) to PnlTracker's Standard CSV format.

Compile a release version

The release version is optimized and minified. It is intended for distribution.

PLUGIN=hello-plugin RELEASE=true npx vite build --config plugins-dev/vite.config.plugin.ts

Installation in PnlTracker

  1. Go to Settings > Plugins.
  2. Click Import plugin and select the generated .zip file.
  3. Enable the plugin, then click Run.
The complete source code of the plugin system is available in the plugins-dev/ folder. See the README files and examples to create your own extensions.

Page slots

Plugins can inject content into existing pages via slots. Each slot is identified by an ID. Available slots:

SlotPageDescription
page-dailyDaily viewInjection into the Daily page
page-calendarCalendarInjection into the Calendar page
trade-filtersTrade filtersInjection into the TradeFilters component

UI components

Plugins have access to ready-to-use UI components:

  • UIButton: button
  • UIInput: input field
  • UISelect: dropdown select

SDK

The SDK exposes calculation functions (P&L, APPT, winrate, profit factor, recovery factor, Sharpe ratio, etc.), API access (get/post/put/delete), toast notifications, theme detection, and i18n locale.

Copyright © 2026