Back to Dashboard

Help & Reference

Rules, indicators, and settings at a glance

Trading rules

BUY trailing rules

  • StatesBUY starts as STAGED (trigger order); when trigger hits → OPEN (live) or COMPLETE (paper).
  • Reverse trailRuns every buy_moving_trail_sec. For each STAGED BUY: gap = trigger − LTP. If gap > 0, move trigger down by buyTrailMovingPercent% of gap (min step 0.05). Disabled if buyTrailMoving = N/No.
  • Trigger hitWhen trigger_price ≤ LTP, place BUY (Live: MARKET or LIMIT per Buy at Market; Paper: mark COMPLETE and activate SELL STAGED).
  • Trail-upIf trigger > LTP but gap ≥ buyTrail% of LTP, move trigger up to LTP + buyTrail% (keeps trigger from firing too early).
  • Duplicate preventionIf market_order_id already set, skip placing again (race guard).

SELL trailing rules

  • StatesSELL becomes STAGED after BUY fills. When LTP ≤ trigger_price → exit (OPEN then fill, or COMPLETE for paper).
  • Auto Exit trailOnly for rows with sell_auto_exit = Y. Runs every sell_moving_trail_sec. Initial floor = entry − (entry × sellTrail%). Trigger never goes below floor.
  • Trail From % gainTrailing starts only when profit% ≥ sell_trail_from. Then trigger moves up by sellTrailMovingPercent% of (LTP − trigger) gap.
  • Exit conditionprocessSellTriggers: when LTP ≤ trigger_price, place SELL (Live: LIMIT at LTP−0.25; Paper: COMPLETE). Applies to all STAGED SELLs.
  • Exit at MarketManual EXIT button places MARKET SELL immediately; no trigger wait. Anti-short: safe quantity from filled BUY before placing SELL.

Order placement rules

  • QuantityOrder by Lot Y → quantity = lot_per_trade × lot_size. N → quantity = floor(invPerTrade / costPerLot) × lot_size. Chunks: whole lots only; max 1800 per exchange order.
  • Live fundsTotal cost must be ≤ 70% of invTotal for Live; else "Insufficient funds for LIVE order".
  • PaperIf quantity 0 (short amount), fallback to 1 lot for paper only.
  • TriggerInitial BUY trigger = last_price + (last_price × buyTrail%). SELL trigger = last_price − (last_price × sellTrail%) (set when BUY completes in paper).
  • ProductStored per order at creation (I/D). Buy at Market: Yes → MARKET BUY; No → LIMIT at trigger+0.05.
Auto Buy & order limits

Holding back repeated orders

  • Auto BuyAllowed only if user.auto_buy = Yes. Checks: (1) Same instrument already has BUY or SELL in STAGED/OPEN → blocked. (2) 30s cooldown from last completed order for same instrument → blocked. (3) Next order delay per instrument_token.
  • Auto Buy auto-offIf the last 3 completed trades (order_book + archive, by created_at) are all losses (PnL < 0), Auto Buy is set to No automatically. Re-enable from Settings.
  • Click AutoChecks same instrument STAGED/OPEN (BUY or SELL); no 30s cooldown or next_order_delay.
  • DirectFor 1min-scalp: mutex + re-check order_book (same instrument open, same side open). Can reuse group_id if same tradingsymbol already has STAGED order with group_id.
Features

Exit alarms & other features

  • Exit alarms A/B/C/DSound alerts only. When LTP ≥ buy_price + (buy_price × alarm%), frontend can play sound. No order exit or auto-exit change.
  • Paper vs LiveSeparate P/L in header. Mode from user.live or request; stored per order as live_paper.
  • ArchiveCompleted (BUY+SELL COMPLETE) or CANCELLED/REJECTED orders moved to order_book_archive. Archive uses its own primary key. Triggers cache invalidation.
  • Archived Order BookRight panel tabs: Order Book and Archived Order Book. Archived tab = same table layout, read-only (no CANCEL/EXIT/AE).

Technical indicators

  • SignalCombined weight vs trigger weightage (default 35) → STRONG_BUY, BUY, WEAK_BUY, HOLD.
  • SourceINDEX or INSTRU candles. Each indicator: enable, weightage, period/params. Stored in user indicator_settings.
  • General & ScalpRSI, BB, EMA, VWAP, Supertrend, MABBRSI. Scalp: 9/21 EMA, Market Structure, Volume Spike, LTP Momentum, Volume Acceleration. 3 Min Scalp optional.
UI & reports

Order book & UI

  • Option ChainNear-ATM, indicator signals, Buy (direct/auto). Option Grid: CE/PE grid; cell = combo, header = single.
  • Order BookGroups by group_id. AE = Auto Exit; EXIT = at market; CANCEL = cancel leg. P/L shown as solid circle badges (amber P, green L) in group headers.
  • Archived tabSecond tab in right panel; same structure as Order Book, read-only.
  • Order cardsSuccessful indicators (positive weightage) in row below order. Header: Logo, clock (2 lines), indices, Refresh, P/L, Auto Buy/Exit, Upload Tokens, Restart WS, theme, Analysis (new tab), Help, Settings.

Analysis & reporting

  • Analysis pageSettled orders (win/loss), total P&L, win rate. Opens in new tab from Analysis icon in header.
  • Date rangeFrom/To filters (default last 90 days). "Apply & Refresh" to filter.
  • Current weightageShows trigger weight and total indicator weight (enabled) from settings — use with Indicator performance to tune.
  • By day (IST)Win rate and P&L by weekday (Sun–Sat) in Indian Standard Time.
  • By time (IST)Win rate and P&L by hour slot in IST.
  • Indicator performancePer indicator: in wins, in losses, win rate (%), suggestion. Hover suggestion for explanation.
Auto order rules

Auto order enhancements

  • Max ordersMax 1 order on CE side, max 1 on PE side. Each side limited independently.
  • Nearest OTM onlyAuto orders at nearest OTM only. CE: smallest strike > spot. PE: largest strike < spot. Never ITM.
  • Same instrumentDo not place if that instrument already has BUY or SELL in STAGED or OPEN.
  • 30s cooldownAfter same-instrument order exits (COMPLETE or archived), wait 30s before next order for that instrument.
  • Frontend grey-outOption Chain greys out ITM (except nearest ITM). Auto order skips greyed instruments.
  • MutexOnly one 1min-scalp auto order placement at a time.
  • Auto-off after 3 lossesWhen last 3 completed trades are all negative, Auto Buy set to No. Re-enable from Settings.
Reference

Settings & quick reference

  • ProfileDropdown = tbl_settings by name. On change: copy to user, set active_setting.
  • Synced to profileinvPerTrade, order_by_lot, lot_per_trade, trails, trigger_weightage, exit_alarm A–D, remark.
  • User-onlyBuy at Market, Auto Buy, Product, Default expiries, LTP Alert. Save updates tbl_user and selected tbl_settings.
  • APIPOST instruQuotes: add-order-direct, add-order-auto, add-order-click-auto, exit-sell-order, edit_auto_exit. GET/POST trading-settings, POST option-indicators.
  • DBtbl_user + active_setting; tbl_settings = profiles; indicator_settings in user (JSON).