NeoCharts

JSON Schemas

Wire-format JSON schemas for trading, market data, and alerts.

Every trading and market-data value crosses the wire as a JSON-encoded string — this page documents those shapes. For the exact Flutter member list and signatures, see the API Reference.


JSON Schemas

symbolInfo

{
  "id":        "RELIANCE",
  "name":      "Reliance Industries",
  "lotSize":   1,
  "precision": 2,
  "tickSize":  0.05,
  "exchange":  "NSE",
  "expiry":    "",
  "strike":    "",
  "optType":   "",
  "weekly":    "",
  "undID":     ""
}
FieldTypeDescription
idStringUnique symbol ID used for all data operations
nameStringDisplay name shown on the chart
lotSizeintMinimum tradeable unit
precisionintDecimal places for price display
tickSizedoubleMinimum price movement
exchangeStringExchange identifier (e.g. "NSE", "BSE")
expiryStringExpiry date for derivatives ("YYYY-MM-DD"); empty for equities
strikeStringStrike price for options; empty otherwise
optTypeString"CE", "PE", or empty
weeklyString"true" for weekly expiry; empty otherwise
undIDStringUnderlying symbol ID for derivatives; empty for equities

marketTiming

{
  "timezone": "Asia/Kolkata",
  "sessions": [
    ["0915-1530"],
    ["0915-1530"],
    ["0915-1530"],
    ["0915-1530"],
    ["0915-1530"],
    [],
    []
  ],
  "holidays": ["20250126"],
  "special": {
    "20251002": ["1000-1400"]
  }
}

sessions is indexed by weekday — index 0 is Monday, index 6 is Sunday. Each entry is a list of "HHMM-HHMM" session ranges (multiple sessions per day are supported); an empty list marks a non-trading day. holidays and the keys of special are dates in YYYYMMDD format.

loadData response

Return a JSON-encoded array of arrays, ordered oldest first. Each bar is [time, open, high, low, close, volume]:

[
  [1700000000000, 2400.0, 2420.0, 2390.0, 2410.0, 150000],
  [1700000060000, 2410.0, 2430.0, 2405.0, 2425.0, 80000]
]

time = bar open timestamp in epoch milliseconds; open/high/low/close = OHLC prices; volume = traded volume.

Live ticks

Each emitted event is a JSON array of tick objects:

[
  { "symbolId": "RELIANCE", "ltp": 2411.5, "ltq": 100, "chng": 11.5, "chngPer": 0.48, "ltt": 1700001234 }
]

Include symbolId so the chart routes ticks to the correct panel.

ordersStreamer

productType is required — a symbol can have simultaneous orders under different product types, and this field disambiguates which one an order belongs to.

[
  {
    "orderID":      "ORD123",
    "type":         "limit",
    "orderAction":  "buy",
    "productType":  "normal",
    "avgPrice":     2405.0,
    "netQty":       10,
    "fillQty":      0,
    "ordTime":      "2025-11-20T09:15:00",
    "orderStatus":  "open",
    "triggerPrice": 0.0,
    "symbol":       { "id": "RELIANCE", "name": "Reliance Industries", "...": "see symbolInfo" }
  }
]

type: "market" · "limit" · "stopMarket" · "stopLoss"

triggerPrice: only meaningful for stop-type orders; omit or 0 for market/limit orders.

symbol: full symbolInfo shape (see above).

orderStatus: "open" · "completed" · "rejected" · "cancelled"

positionsStreamer

productType is required — the same symbol can have two simultaneous positions under different product types, and this field disambiguates them.

[
  {
    "symID":          "RELIANCE",
    "displayName":    "Reliance Industries",
    "netQty":         10,
    "avgPrice":       2405.0,
    "netOrgAvgPrice": 2405.0,
    "pnl":            65.0,
    "realizedPnl":    0.0,
    "realizedOrgPnl": 0.0,
    "unrealizedPL":   65.0,
    "mtm":            65.0,
    "multiplier":     1.0,
    "priceFactor":    1.0,
    "productType":    "intraday",
    "symbol":         { "id": "RELIANCE", "name": "Reliance Industries", "...": "see symbolInfo" }
  }
]

symbol: full symbolInfo shape (see above).

positionSide (derived, not sent): "long" · "short" — inferred from netQty's sign.

positionTypes (derived, not sent): "Open" · "Close" — inferred from whether netQty is non-zero.

actionFeedbackStreamer

Must be a broadcast stream (Flutter) or pushed via EventChannel sink (native). Emits feedback for any user-initiated action (order or alert create/modify/cancel). type is a render-color discriminator, not a success/failure flag — a deliberate cancel/delete is "negative" too.

{ "type": "positive", "message": "Order placed successfully" }
{ "type": "negative", "message": "Insufficient margin" }

ocoOrdersStreamer

Pending OCO trigger pairs — SL+TP legs not yet real orders. Once a leg fires, the broker reports it on ordersStreamer instead as a plain order. productType is top-level, not nested per leg — both legs of one pair always protect the same position.

[
  {
    "groupId": "OCO001", "symID": "RELIANCE", "name": "Reliance Industries",
    "exchange": "NSE",   "side": "buy",       "productType": "normal",
    "stopLoss": { "type": "stopLoss", "side": "sell", "triggerPrice": 2350.0, "qty": 10, "price": 2340.0, "fillQty": 0 },
    "target":   { "type": "limit",    "side": "sell", "triggerPrice": 0.0,    "qty": 10, "price": 2450.0, "fillQty": 0 }
  }
]

placeOrder params

{
  "symID": "RELIANCE", "price": 2400.0, "orderType": "limit",
  "orderAction": "buy", "qty": 10, "productType": "normal", "triggerPrice": 0.0
}

modifyOrder is the same shape plus "orderID".

placeOCOOrder params

{
  "side": "buy", "productType": "normal", "stopPrice": 2350.0, "stopQty": 10,
  "symID": "RELIANCE", "targetPrice": 2450.0, "targetQty": 10,
  "targetTriggerPrice": 2440.0, "groupId": "OCO001"
}

modifyOCOOrder is the same shape. groupId is optional — only required for modify flows. cancelOCOOrder takes just the groupId string.

groupAdjustOrders params

{
  "exit": [
    { "action": "Buy", "id": "NIFTY2560023000PE", "ordType": "market", "price": 120.5, "quantity": 50 }
  ],
  "add": [
    { "action": "Sell", "id": "NIFTY2560024000CE", "ordType": "limit", "price": 85.0, "quantity": 50 }
  ]
}

exit — exit legs for currently held positions (action inverted from the position side). add — new entry legs selected from the option chain.

AlertParams

Used by createAlert and modifyAlert:

{
  "alertId": "371966778953728",
  "symbolId": "IDX_-20_NSE",
  "ltp": "79500.00",
  "triggerPrice": "80000.00"
}

alertId is only present for modifyAlert. ltp is the current LTP at request time — the host app decides above/below-market from it, not the SDK. deleteAlert takes just {"alertId": "..."}.

alertsStreamer

[
  {
    "alertId": "357807025062912",
    "symbolInfo": { "id": "IDX_-1_NSE", "name": "NIFTY", "...": "see symbolInfo" },
    "triggerPrice": "25003",
    "enabled": true,
    "triggered": false,
    "createdAt": 1769509922000
  }
]

symbolInfo is a full symbolInfo object (see above) — an alert can be for any symbol, not just one on screen. createdAt is epoch milliseconds (UTC).


Native Channel Reference

Android and iOS embed NeoCharts via the same platform channels — the wire protocol is identical on both; only the native syntax to call it differs (see the Android and iOS guides).

ChannelTypeDirectionPurpose
nxtchart/dataMethodChannelbidirectionalMetadata init + order/OI/alert actions
nxtchart/marketDataEventChannelnative → chartLive tick stream
nxtchart/symbolSearchEventChannelnative → chartSymbol search results (one emission per query)
nxtchart/ordersEventChannelnative → chartOrders list stream
nxtchart/ocoOrdersEventChannelnative → chartPending OCO trigger pairs stream
nxtchart/positionsEventChannelnative → chartPositions list stream
nxtchart/tradeEventsEventChannelnative → chartAction feedback (order/alert outcome) notifications
nxtchart/alertsEventChannelnative → chartAlerts list stream

nxtchart/data method calls

MethodArgsReturnsWhen called
symbolInfoString (JSON)Once, on init
underlyingSymbolInfoString? (JSON)Once, on init
optionSymbolsString (JSON array)Once, on init
futureSymbolsString? (JSON array)Once, on init
indexSymbolsString? (JSON array)Once, on init
marketTimingString (JSON)Once, on init
hasOCOboolOnce, on init
storageKeyStringOnce, on init
atmSymbolsString? (JSON array)Awaited on scalper right-panel init (not cached at startup)
chartTopOptionsString (JSON array)Used by scalper; top options ranked by volume
loadDatafrom, to, intervalSeconds, requiredBarsString (JSON array)On scroll / interval change
fetchOptionDetailsunderlyingSymbolIdString (JSON array)User opens the option chain
fetchOIAnalysisunderlyingSymbolId, expiry, timeFrom, timeToString? (JSON)OI Analysis screen
fetchOIChangeunderlyingSymbolId, expiries, timeFrom, timeToString? (JSON)OI Profile change values / OI Change Analysis
fetchOIunderlyingSymbolId, expiriesString? (JSON)OI Profile current-OI bars
fetchPcrIntradayString (JSON array)Analysis screen's PCR tab
fetchAtmStraddleIntradayString (JSON)Analysis screen's ATM straddle tab
fetchAtmIvIntradayString (JSON array)Analysis screen's ATM IV tab
placeOrderJSON string — see placeOrder paramsUser places order
modifyOrderJSON string — see placeOrder paramsUser modifies order
cancelOrderorderIDUser cancels order
placeOCOOrderJSON string — see placeOCOOrder paramsUser places an OCO (SL+TP) bracket
modifyOCOOrderJSON string — see placeOCOOrder paramsUser modifies an OCO bracket
cancelOCOOrdergroupIdUser cancels an OCO pair (both legs)
groupAdjustOrdersJSON string — see groupAdjustOrders paramsUser adjusts a position via the option chain
createAlertJSON string — see AlertParamsUser creates a price alert
modifyAlertJSON string — see AlertParamsUser modifies a price alert
deleteAlertalertIdUser deletes a price alert

See Indicators & Drawing Tools for the full list of built-in indicators and drawing tools.

On this page