name: tradetron description: Monitor and analyze Tradetron.tech algo trading strategies — portfolio status, P&L, positions, and deep trade analysis. user-invocable: false disable-model-invocation: false metadata: {"openclaw":{"requires":{"config":["plugins.entries.tradetron.enabled"]}}}
Tradetron Trading Platform Integration
You have access to Tradetron.tech, an Indian algo trading platform. Use the tradetron tools to answer questions about trading strategies, P&L, positions, and performance.
Authentication
Before any Tradetron query, check auth with tradetron_auth_status. If not authenticated, offer two options:
Option A: Browser Login (Recommended)
I can log into Tradetron for you using the headless browser. Just provide your email and password.
Flow:
- Call
tradetron_browser_open(opens login page) - Use
tradetron_browser_actto type email, password, and submit - Check snapshot for captcha/errors — if captcha appears, tell user and work through it
- After successful login, call
tradetron_browser_extract_authto save cookies
Option B: Manual Cookie Paste
To connect Tradetron, I need your session cookies. Please:
- Log into tradetron.tech in your browser
- Open DevTools (F12) → Application → Cookies → tradetron.tech
- Copy the values for
tradetron_sessionandXSRF-TOKEN- Send them to me and I'll set them up
Cookies expire ~17 hours after login. If any tool returns an auth error, re-authenticate using either method.
Tool Selection Priority
ALWAYS prefer API tools over browser/scrape tools. The API tools are faster, more reliable, and return structured data. Only use browser scraping when the API tools genuinely cannot provide the requested information.
| User asks about... | Use this tool | Do NOT use scrape |
|---|---|---|
| Strategy overview, status, counter P&L | tradetron_portfolio |
- |
| Open positions, real-time M2M | tradetron_positions |
- |
| P&L by broker or strategy type | tradetron_pnl_breakdown |
- |
| Single strategy deep dive, greeks | tradetron_strategy_detail |
- |
| Win rate, trade stats, monthly trends | tradetron_trade_analysis |
- |
| Individual executed trades, raw trade rows | tradetron_trade_analysis (with include_trades: true) |
- |
| Overall P&L report, date range filters | tradetron_report |
- |
| Notification/alert history | tradetron_browser_scrape |
API doesn't cover this |
| Order execution logs | tradetron_browser_scrape |
API doesn't cover this |
| Strategy settings/configuration page | tradetron_browser_scrape |
API doesn't cover this |
Rule: If an API tool can answer the question, NEVER use tradetron_browser_scrape instead. Scraping is ONLY for data that lives exclusively on browser-rendered pages with no API equivalent.
Available Tools
Auth
- tradetron_auth_status — Check if Tradetron session is authenticated. Always call this first before any other tool.
API Tools (ALWAYS prefer these)
- tradetron_portfolio — Overview of all strategies with status and counter P&L. Use this first for any general "how are things going" question.
- tradetron_positions — Current open positions with real-time M2M P&L. Only useful when markets are open (9:15 AM - 3:30 PM IST weekdays).
- tradetron_pnl_breakdown — P&L grouped by broker and strategy type (positional vs intraday). Good for "how much am I making on Finvasia?" type questions.
- tradetron_strategy_detail — Deep dive into one strategy including positions with greeks.
- tradetron_trade_analysis — Downloads full trade history CSV and computes comprehensive stats: win rate, avg win/loss, repair impact analysis, monthly P&L trends, max drawdown, streaks. This is slow (fetches large CSVs) but gives the best insights. Use
strategy_name_patternto search by name. Setinclude_trades: trueto also get the raw trade rows (optionally limit withlast_n_trades). - tradetron_report — Export P&L report across all strategies with optional filters (date range, exchange, deployment type). Returns per-strategy P&L totals. Good for "what's my overall P&L?" or "how did NFO strategies do this month?" type questions.
Browser Tools (for login and browser-only operations)
- tradetron_browser_open — Open a Tradetron.tech page in the headless browser. Returns an AI-readable snapshot with element refs. Use for login or any browser-only operations.
- tradetron_browser_act — Interact with the browser page: click (ref), type (ref+text), press (key), evaluate (JS), wait. Refs come from snapshot.
- tradetron_browser_snapshot — Get current page state as an AI-readable snapshot. Use to check page after actions.
- tradetron_browser_extract_auth — After browser login, extract session cookies via CDP and save as API auth for this group.
- tradetron_browser_scrape — LAST RESORT ONLY. Navigate to any Tradetron SSR page and extract structured data. Auto-injects auth cookies. Only use when the API tools above genuinely cannot provide the requested data (e.g., notification history, order logs, strategy settings pages).
Strategy Management (DANGEROUS — read safety rules below)
- tradetron_start_strategy — Start/resume a paused strategy. Affects live trading.
- tradetron_stop_strategy — Stop/pause a running strategy. Existing positions remain open.
- tradetron_exit_strategy — Exit ALL open positions for a strategy. IRREVERSIBLE. Market orders placed immediately.
Key Concepts
P&L Types
- Counter P&L (
sum_of_pnl): Cumulative P&L since the current counter (trade cycle) started. For positional strategies this can span days. - Expiry P&L: M2M from margin endpoint — today's entries valued from fill price, overnight positions from yesterday's close.
- Today P&L: Only positions entered today, from margin endpoint with
type="day"filter.
Strategy Types
- Intraday: Enter and exit same day (e.g., Dual Berettas, straddles/strangles)
- Positional: Hold across days/weeks (e.g., Iron Condors, monthly strategies)
Repairs
A "Repair Once" in trade data means the strategy adjusted (closed losing leg and re-entered). High repair frequency correlates strongly with losing periods.
Brokers
- Finvasia/Shoonya (ID: 358) — Primary broker
- 5 Paisa/Xstream (ID: 933) — Secondary
- FlatTrade (ID: 361) — Tertiary
- TT Paper Trading (ID: 1) — Paper/test
Response Formatting
When presenting P&L data, use Indian Rupee format (₹) with commas. Format large numbers readably:
- ₹1,23,456 (Indian numbering)
- Show percentages for win rates
- Use tables for multi-strategy comparisons
- Highlight wins in positive tone, losses neutrally
Safety Rules for Strategy Management
These rules are ABSOLUTE and MUST be followed for tradetron_start_strategy, tradetron_stop_strategy, and tradetron_exit_strategy:
- NEVER call these tools proactively. Only when the user EXPLICITLY asks to start, stop, or exit a specific strategy.
- ALWAYS call WITHOUT the
confirmparameter first. This returns a preview showing the strategy name, status, broker, open positions, and P&L. Present this to the user. - ALWAYS show the user what will happen and ask for explicit confirmation. Example:
You're about to STOP the strategy "Dual Berettas" on Finvasia (3 open positions, counter P&L: ₹2,450). This will prevent new trades but existing positions stay open. Are you sure? Please confirm.
- Only set
confirm: "YES I CONFIRM"after the user explicitly confirms with words like "yes", "do it", "confirm", "go ahead". Vague responses like "ok" or "sure" are NOT sufficient — ask again clearly. - For EXIT: be extra cautious. This closes ALL positions with real money impact. Warn about:
- Number of open positions that will be closed
- Current unrealized P&L that will be locked in
- That market orders are placed immediately and this is IRREVERSIBLE
- NEVER batch multiple control actions. One strategy at a time. Wait for each to complete before proceeding.
- NEVER auto-confirm. Even if the user says "stop all my strategies", process them one at a time with individual confirmations.
Browser Login Flow
When using browser tools to log into Tradetron:
- Open login page:
tradetron_browser_openwith no URL (defaults to login page) - Read the snapshot: Identify the email field, password field, and login button refs
- Type credentials: Use
tradetron_browser_actwith action=type for email, then password - Submit: Click the login button or use action=press with key=Enter
- Check result: Use
tradetron_browser_snapshotto verify login succeeded (look for dashboard content or error messages) - Handle captcha: If ALTCHA or other captcha appears, describe it to the user and work through it
- Extract cookies: Once logged in, call
tradetron_browser_extract_authto save session cookies for API use
The browser tools are restricted to tradetron.tech URLs only. For browser-only operations (things the API doesn't support), use tradetron_browser_open to navigate and tradetron_browser_act to interact.
Scraping SSR Pages (Last Resort Only)
Only use tradetron_browser_scrape when the API tools cannot provide the data. Most questions about portfolio, P&L, positions, and trade history are fully covered by the API tools above. The scrape tool is slow (launches a browser) and should only be used for pages with no API equivalent.
Valid use cases for scraping:
/notifications— Trade notifications and alert history (no API for this)- Order execution logs or audit trails (no API for this)
- Strategy configuration/settings pages (no API for this)
Do NOT scrape for:
- Strategy list/status → use
tradetron_portfolio - P&L data → use
tradetron_pnl_breakdownortradetron_report - Positions → use
tradetron_positions - Trade history/stats → use
tradetron_trade_analysis
The scrape tool extracts:
- Tables: Parsed into arrays of
{header: value}objects (up to 500 rows per table) - Headings: All h1-h4 elements for page structure
- Key-Value metrics: Dashboard cards, summary stats, totals
- Page text: Full text content (up to 8000 chars, configurable)
Use wait_for to wait for dynamic content (e.g. wait_for: "table") and extract_selector to focus on a specific part of the page (e.g. extract_selector: ".main-content").