# OpenMarket > OpenMarket is a trading analytics platform providing real-time and historical market data for crypto and Polymarket prediction markets. These docs cover the product surface — terminal, order flow, charting, indicators, kScript, Hub, Academy, referrals. OpenMarket Data API reference. REST and WebSocket endpoints for crypto market data and Polymarket analytics. kScript is OpenMarket's scripting language for building technical indicators, trade-flow analytics, order-book visualizations, and backtested strategies. These docs cover the language reference: core concepts (including the v3 collections, lambdas, user-defined types, na semantics, and multi-timeframe), the function library (drawing objects and primitives, styling, control flow, the reference-validated TA library, typed inputs, libraries, foreign-domain panes), releases, and the migration guides (v1 to v2, v2 to v3). ## User Guides - **Getting Started —** [Introduction](https://openmarket.xyz/learn/getting-started/introduction.md): OpenMarket is a social, professional-grade charting platform that lets you see, build, and share how money actually moves—across crypto, equities, and prediction markets. - **Getting Started —** [Creating an Account](https://openmarket.xyz/learn/getting-started/how-to-sign-up.md): To unlock the full platform — saved workspaces, custom indicators, and personalized settings — you must register an account. We support three secure methods: - **Getting Started —** [Is there a mobile app?](https://openmarket.xyz/learn/getting-started/faq/is-there-a-mobile-app.md) - **Getting Started —** [Stuck on Enable Hardware Acceleration screen](https://openmarket.xyz/learn/getting-started/faq/hardware-acceleration-stuck.md): If you have already enabled hardware acceleration in your browser settings but still cannot bypass the notification, your browser may be blocking specific graphics features due to driver compatibility or internal flags. - **Getting Started —** [Is there an API key?](https://openmarket.xyz/learn/getting-started/faq/is-there-an-api-key.md): How to get an API key for the OpenMarket Data API. - **Terminal —** [Overview](https://openmarket.xyz/learn/core/terminal/overview.md) - **Terminal —** [News Feed](https://openmarket.xyz/learn/core/terminal/news-feed.md): Monitor real-time market sentiment and breaking news across crypto and macro sectors. - **Terminal —** [Tape](https://openmarket.xyz/learn/core/terminal/tape.md): Monitor real-time transaction flow with granular trade execution data. - **Terminal —** [Order Book](https://openmarket.xyz/learn/core/terminal/order-book.md): Analyze real-time market depth and liquidity with our advanced aggregated order book. - **Terminal —** [Order Book Delta](https://openmarket.xyz/learn/core/terminal/order-book-delta.md): Track real-time changes in market depth to identify where liquidity is being added or removed. - **Terminal —** [Order Book DOM](https://openmarket.xyz/learn/core/terminal/order-book-dom.md): Master real-time execution and liquidity shifts with the Depth of Market (DOM) interface. - **Terminal —** [Volume Stats](https://openmarket.xyz/learn/core/terminal/volume-stats.md): Monitor trading volume trends and buy/sell pressure with granular 24-hour market activity. - **Terminal —** [Liquidity Stats](https://openmarket.xyz/learn/core/terminal/liquidity-stats.md): Analyze market depth stability and order book balance over a rolling 24-hour period. - **Terminal —** [Market Stats](https://openmarket.xyz/learn/core/terminal/market-stats.md): Monitor real-time market microstructure including trade frequency, book depth, and volume flow. - **Terminal —** [Trade & Liquidations](https://openmarket.xyz/learn/core/terminal/trade-and-liquidations.md): Monitor real-time aggressive execution activity and forced liquidations across multiple symbols. - **Terminal —** [Watchlist](https://openmarket.xyz/learn/core/terminal/watchlist.md): Organize and track multiple assets across exchanges with real-time streaming data and customizable metrics. - **Core —** [Liquidations](https://openmarket.xyz/learn/core/liquidations.md): Track real-time forced liquidations across the entire crypto market. - **Core —** [kScript](https://openmarket.xyz/learn/core/k-script.md): Build and share high-performance indicators with direct access to raw market data. - **Core —** [Academy](https://openmarket.xyz/learn/core/academy.md): Master market mechanics and advanced trading strategies. - **Hub —** [Overview](https://openmarket.xyz/learn/core/hub/overview.md): Discover and manage community-built indicators and suites. - **Hub —** [kScript Hub](https://openmarket.xyz/learn/core/hub/k-script-hub.md): The kScript Hub is the definitive library for custom-coded indicators and suites developed within the kScript ecosystem. - **Order Flow —** [Order flow on OpenMarket, which tool when](https://openmarket.xyz/learn/order-flow.md): A map of OpenMarket's order-flow suite — footprint, TPO, heatmap, DOM, tape, and CVD — and which tool answers which question. - **Order Flow —** [Meet the footprint](https://openmarket.xyz/learn/order-flow/footprint.md): Open a candle up and read the fight inside it — bid/ask volume at every price level, delta, imbalances, and the POC. - **Order Flow —** [Footprint playbook](https://openmarket.xyz/learn/order-flow/footprint/playbook.md): The handful of footprint patterns traders actually act on — absorption, stacked imbalances, exhaustion, unfinished auctions, and delta divergence. - **Order Flow —** [Footprint settings reference](https://openmarket.xyz/learn/order-flow/footprint/settings-reference.md): Every option in the Volume Footprint dialog, tab by tab — display modes, imbalance detection, value area and POC, stats rows, liquidation markers, and colors. - **Order Flow —** [Meet TPO (Market Profile)](https://openmarket.xyz/learn/order-flow/tpo.md): Read where the market accepts and rejects value with OpenMarket's TPO (Market Profile) indicator — letters, POC, value area, and structure. - **Order Flow —** [TPO playbook](https://openmarket.xyz/learn/order-flow/tpo/playbook.md): The Market Profile patterns worth marking on OpenMarket — value-area rotation, the 80% rule, poor extremes, single prints, and initial balance. - **Order Flow —** [TPO settings reference](https://openmarket.xyz/learn/order-flow/tpo/settings-reference.md): Every option in OpenMarket's TPO (Market Profile) settings dialog, documented tab by tab — General, Color, Profile, and Volume. - **Charting —** [Charting on OpenMarket](https://openmarket.xyz/learn/charting.md): The chart and the tools around it — chart types, drawing tools, price alerts, and keyboard control, with links into the full charting guides. - **Charting —** [Drawing tools](https://openmarket.xyz/learn/charting/drawing-tools.md): OpenMarket's 99 drawing tools across nine toolbar groups — how to draw, edit, favorite, and snap them, plus the magnet, per-tool settings, and hotkeys. - **Charting —** [Themes and appearance](https://openmarket.xyz/learn/charting/themes-and-appearance.md): How OpenMarket's appearance stacks — dark or light mode, six color themes, and per-chart color overrides — and what saves to your account versus your workspace. - **Charting —** [Workspaces, layouts, and widgets](https://openmarket.xyz/learn/charting/workspaces-and-widgets.md): Workspaces as complete trading setups — creating and managing them, the multi-chart grid, the terminal's widgets, and applying or publishing community layouts. - **Indicators —** [Indicators](https://openmarket.xyz/learn/indicators.md): Add funding, open interest, liquidations, order flow, volume profiles, and the classic oscillators to your chart from one searchable library. - **Options —** [The options suite](https://openmarket.xyz/learn/options.md): Twelve chart-native indicators built from Deribit's live options board — dealer positioning, walls and magnets, the volatility surface, and live options flow. - **Options —** [How the options math works](https://openmarket.xyz/learn/options/concepts.md): The one primer for the whole suite: how dealer hedging moves price, the greeks and GEX math, and how dealer inventory is estimated from the trade tape. - **Options —** [Options dashboard](https://openmarket.xyz/learn/options/dashboard.md): The dashboard is a tile panel of eleven positioning KPIs, all computed from the same live options board as the rest of the suite. - **Options —** [GEX profile](https://openmarket.xyz/learn/options/gex-profile.md): The options board drawn onto your price chart — a bar at every strike, plus call wall, put wall, gamma flip and max pain. - **Options —** [GEX heatmap](https://openmarket.xyz/learn/options/gex-heatmap.md): The options board's history painted behind your candles: strike bands and how dealer exposure at each strike evolved over time. - **Options —** [GEX curve](https://openmarket.xyz/learn/options/gex-curve.md): The GEX curve draws the gamma board in its own pane under the chart, over the strike axis instead of time. - **Options —** [Options flow](https://openmarket.xyz/learn/options/flow.md): Traded options volume drawn on your chart — a column at every strike, sized by how much actually changed hands over the visible range. - **Options —** [Flow by expiry](https://openmarket.xyz/learn/options/flow-by-expiry.md): Flow by expiry puts one bar under your chart for every live expiry, showing net traded options volume over a trailing window. - **Options —** [Flow pulse](https://openmarket.xyz/learn/options/flow-pulse.md): Flow pulse is a six-tile scoreboard of net options buying: net call flow and net put flow over the last hour, four hours, and twenty-four hours. - **Options —** [IV smile](https://openmarket.xyz/learn/options/iv-smile.md): Implied volatility across strikes, up to three expiries at once: the nearest, roughly one week out, and roughly one month out. - **Options —** [Term structure](https://openmarket.xyz/learn/options/term-structure.md): The term structure plots each expiry's at-the-money IV against its days to expiry: the volatility yield curve. - **Options —** [Options surface](https://openmarket.xyz/learn/options/surface.md): The whole vol landscape as a strike-by-expiry matrix, each cell colored and valued by the metric you choose. - **Options —** [Vol matrix](https://openmarket.xyz/learn/options/vol-matrix.md): The vol matrix is a compact table, one row per expiry with the front row highlighted, five numbers per row: ATM IV, two risk reversals, a butterfly, and open interest. - **Options —** [Implied move](https://openmarket.xyz/learn/options/implied-move.md): Implied move translates each expiry's implied volatility into the number you actually want: how big a move is the options market pricing in by that date? - **Referrals —** [Overview](https://openmarket.xyz/learn/referrals/overview.md): Grow the OpenMarket community and unlock institutional-grade features by inviting other traders. ## API: Getting Started - **Intro —** [OpenMarket Data API](https://openmarket.xyz/docs/index.md): Programmatic access to crypto market data across multiple exchanges. Candles, open interest, funding rates, liquidations, heatmaps, volume profiles, and TPO. - **Intro —** [Quickstart](https://openmarket.xyz/docs/quickstart.md): From zero to streaming cross-exchange data in 5 minutes. - **Intro —** [Quick Examples](https://openmarket.xyz/docs/quick-examples.md): Real queries with real responses. Each card is a single API call you can copy and run. ## API: Basics - **Reference —** [Authentication](https://openmarket.xyz/docs/authentication.md): How to authenticate with the OpenMarket Data API using API keys. - **Reference —** [Parameters & Enums](https://openmarket.xyz/docs/exchanges.md): Exchanges, symbols, intervals, time ranges, sort direction, and transforms for the OpenMarket Data API. - **Reference —** [Rate Limits](https://openmarket.xyz/docs/rate-limits.md): Weight-based rate limiting, tier budgets, and response headers. - **Reference —** [Errors](https://openmarket.xyz/docs/errors.md): Error codes, formats, and troubleshooting for the OpenMarket Data API. - **Reference —** [Best Practices](https://openmarket.xyz/docs/best-practices.md): Tips for building reliable, performant integrations with the OpenMarket Data API. ## API: Crypto - **REST —** [Candles](https://openmarket.xyz/docs/rest/candles.md): OHLCV candlestick data via the OpenMarket Data API. - **REST —** [Open Interest](https://openmarket.xyz/docs/rest/open-interest.md): Open interest data as OHLC candles via the OpenMarket Data API. - **REST —** [Funding Rate](https://openmarket.xyz/docs/rest/funding-rate.md): Perpetual futures funding rate data via the OpenMarket Data API. - **REST —** [Liquidations](https://openmarket.xyz/docs/rest/liquidations.md): Aggregated liquidation volume data via the OpenMarket Data API. - **REST —** [Volume Profile](https://openmarket.xyz/docs/rest/volume-profile.md): Volume distributed across price levels via the OpenMarket Data API. - **REST —** [TPO / Market Profile](https://openmarket.xyz/docs/rest/tpo.md): Time Price Opportunity data -- an OpenMarket exclusive. Not available on any other crypto data API. - **REST —** [Orderbook Heatmap](https://openmarket.xyz/docs/rest/orderbook-heatmap.md): Orderbook depth data bucketed by price level for heatmap rendering. - **REST —** [Liquidation Heatmap](https://openmarket.xyz/docs/rest/liquidation-heatmap.md): Liquidation data aggregated by price level for heatmap rendering. Advanced and Enterprise tiers only. - **REST —** [TP/SL Heatmap](https://openmarket.xyz/docs/rest/tp-sl-heatmap.md): Take-profit and stop-loss trigger liquidity aggregated by price level for heatmap rendering. Advanced and Enterprise tiers only. - **REST —** [Bitcoin Dominance](https://openmarket.xyz/docs/rest/bitcoin-dominance.md): Bitcoin market cap dominance and token supply data via the OpenMarket Data API. Advanced tier only. - **REST —** [Implied Volatility](https://openmarket.xyz/docs/rest/implied-volatility.md): Option summary implied volatility via the OpenMarket Data API. Advanced tier only. - **REST —** [Skew](https://openmarket.xyz/docs/rest/skew.md): Option summary skew via the OpenMarket Data API. Advanced tier only. - **REST —** [Metadata & Discovery](https://openmarket.xyz/docs/rest/metadata.md): Endpoints for discovering available exchanges, symbols, markets, block sizes, tenors, and checking API usage. - **WebSocket —** [WebSocket API Overview](https://openmarket.xyz/docs/ws/overview.md): Real-time streaming market data via persistent WebSocket connections. - **WebSocket —** [Connecting](https://openmarket.xyz/docs/ws/connecting.md): Establish a WebSocket connection and authenticate with the API. - **WebSocket —** [Subscribing](https://openmarket.xyz/docs/ws/subscribing.md): Subscribe to channels, manage subscriptions, and configure Brotli compression. - **WebSocket —** [Connection Lifecycle](https://openmarket.xyz/docs/ws/lifecycle.md): Heartbeat, reconnection strategies, and best practices for WebSocket connections. - **WebSocket —** [Trades (WebSocket)](https://openmarket.xyz/docs/ws/trades.md): Real-time individual and aggregated trade streams via WebSocket. - **WebSocket —** [Orderbook (WebSocket)](https://openmarket.xyz/docs/ws/orderbook.md): Real-time orderbook depth snapshots via WebSocket. - **WebSocket —** [Funding Rate (WebSocket)](https://openmarket.xyz/docs/ws/funding.md): Real-time funding rate and predicted funding rate streams via WebSocket. - **WebSocket —** [Open Interest (WebSocket)](https://openmarket.xyz/docs/ws/open-interest.md): Real-time open interest updates via WebSocket. - **WebSocket —** [Liquidations (WebSocket)](https://openmarket.xyz/docs/ws/liquidations.md): Real-time liquidation events via WebSocket. - **WebSocket —** [Volume Profile (WebSocket)](https://openmarket.xyz/docs/ws/volume-profile.md): Real-time volume profile aggregated from live trades via WebSocket. ## API: Polymarket - **REST —** [Polymarket Analytics](https://openmarket.xyz/docs/rest/polymarket-analytics.md): Bounded Polymarket leaderboard, trader profile, positions, market summary, user categories, and platform-wide endpoints. ## kScript: Getting Started - **Intro —** [Introducing kScript v3](https://openmarket.xyz/kscript/getting-started/introduction.md): kScript is designed to be intuitive whether you're coming from PineScript or learning to code for the first time. Create technical indicators, analyze market trends, and study order flow with powerful yet accessible tools. The syntax is straightforward and easy to learn — you'll be building working indicators in minutes. - **Intro —** [kScript v3 Overview](https://openmarket.xyz/kscript/getting-started/overview.md): A complete guide to understanding how kScript works. Covers core concepts, rules, and patterns for building indicators. - **Intro —** [Quick Start Guide](https://openmarket.xyz/kscript/getting-started/quick-start.md): Get started with kScript in 5 minutes. Build your first EMA Difference indicator step by step. ## kScript: Strategies - **Backtesting —** [Strategies Overview](https://openmarket.xyz/kscript/strategies/overview.md): Turn a kScript into a backtest. Declare strategy(), place orders with strategy.*, and get trades, an equity curve, and performance stats. - **Backtesting —** [Build Your First Strategy](https://openmarket.xyz/kscript/strategies/first-strategy.md): A complete walkthrough, from a trading idea to a backtested result you can read critically. Write it, run it, read the disclosures, tune it. - **Backtesting —** [Reading the Strategy Tester](https://openmarket.xyz/kscript/strategies/reading-the-tester.md): A tour of the Strategy Tester panel: the Overview, Performance, and Trades tabs, the chart markers, the run-details disclosures, and compare mode. - **Backtesting —** [Writing Strategies](https://openmarket.xyz/kscript/strategies/writing-strategies.md): The strategy() declaration, the strategy.* order API, position rules, and sizing. - **Backtesting —** [Perps and Leverage](https://openmarket.xyz/kscript/strategies/perps-and-leverage.md): Declare perps strategies, understand leveraged margin sizing, liquidation, maker/taker fees, funding, and the perps-specific stats. - **Backtesting —** [Fill Simulation](https://openmarket.xyz/kscript/strategies/fill-simulation.md): How the backtester decides when and at what price orders fill, how intrabar ordering questions are resolved with finer data, and how precision is reported. - **Backtesting —** [Slippage and Costs](https://openmarket.xyz/kscript/strategies/slippage-and-costs.md): Commission (spot), maker/taker fees (perps), flat slippage, and slippageModel="bookEstimate", which prices fills from recorded order-book depth where the platform has it. - **Backtesting —** [Perps: Margin, Liquidation, and Funding](https://openmarket.xyz/kscript/strategies/perps.md): instrument="perps" switches the broker emulator to isolated-margin perpetual futures - leverage, maker/taker fees, funding settlement, and liquidation, each with disclosed counts. - **Backtesting —** [Stats Reference](https://openmarket.xyz/kscript/strategies/stats-reference.md): Every performance stat the Strategy Tester reports, its exact formula, and its edge cases. All formulas are locked by engine tests. - **Backtesting —** [Examples: Spot Strategies](https://openmarket.xyz/kscript/strategies/examples-spot.md): Three complete spot strategies you can paste and run, from a two-line trend follower to bracketed exits, each one an executed example from this documentation's probe suite. - **Backtesting —** [Examples: The Five Perps Scenarios](https://openmarket.xyz/kscript/strategies/examples-perps.md): The five canonical perps strategies behind the engine's acceptance battery, covering liquidation on both sides, fee classification, funding erosion, and bankruptcy accounting. - **Backtesting —** [Backtest a Hyperliquid Perp Strategy](https://openmarket.xyz/kscript/strategies/examples-hyperliquid.md): A complete Hyperliquid perps backtest: leverage, maker/taker fees, and funding settled from recorded venue data, in twenty lines of kScript. ## kScript: Core Concepts - **Reference —** [Data Types](https://openmarket.xyz/kscript/core-concepts/data-types.md): Understanding kScript's type system and the fundamental data types available for building trading algorithms. - **Reference —** [Variables: var, timeseries, persist](https://openmarket.xyz/kscript/core-concepts/core-variables.md): Variable declaration and bar-state behavior in kScript: var, timeseries, and persist. - **Reference —** [Type System](https://openmarket.xyz/kscript/core-concepts/type-system.md): A comprehensive guide to kScript's hybrid type system, covering type inference, variable declarations, and data types. - **Reference —** [Collections](https://openmarket.xyz/kscript/core-concepts/collections.md): Arrays and maps in kScript, the reducer methods that iterate them, in-place sorting with comparators, and the two limits that keep them safe. - **Reference —** [Lambdas & Reducers](https://openmarket.xyz/kscript/core-concepts/lambdas-and-reducers.md): Arrow-function lambdas, closures, and the reducer methods (map, filter, reduce, forEach, find, some, every) that replace most explicit loops. - **Reference —** [User-Defined Types](https://openmarket.xyz/kscript/core-concepts/user-defined-types.md): Define your own typed structs with fields and methods. Construct with named fields, call methods, and mutate state with this. Model trading state in the shape of the problem. - **Reference —** [na and Color](https://openmarket.xyz/kscript/core-concepts/na-and-scalar-types.md): Working with missing values in kScript: the na helpers (isna, nz, fixnan), how NaN behaves, and building colors with color.rgb and color.new. - **Reference —** [Named Streams](https://openmarket.xyz/kscript/core-concepts/named-streams.md): Multi-output indicators like bb, macd, and stoch return a result whose components you read by name, such as bb.upper, macd.signal, and stoch.k. No positional guessing. - **Reference —** [Multi-Timeframe](https://openmarket.xyz/kscript/core-concepts/multi-timeframe.md): Read higher and lower timeframes from any script with htf(), ltf(), and request(). Higher-timeframe values are confirmed and repaint-free by default, with calendar periods (1D/1W/1M/1Q/1Y) and confirmed/developing/offset modes. - **Reference —** [Multi-Source & Aggregation](https://openmarket.xyz/kscript/core-concepts/multi-source.md): Combine multiple data sources in one script: other symbols, other venues, other data types, aggregated metrics like cross-exchange CVD, and the request(), ltf(), and requestBars() helpers. - **Reference —** [Data Sources](https://openmarket.xyz/kscript/core-concepts/data-sources.md): The market feeds kScript can subscribe to, their column members, and how to load them with source() and ohlcv(). - **Reference —** [Execution Model](https://openmarket.xyz/kscript/core-concepts/execution-model.md): How kScript runs your code bar by bar, where barIndex and isLastBar come from, and how history indexing works. - **Reference —** [Keyword Arguments](https://openmarket.xyz/kscript/core-concepts/keyword-arguments.md): Learn how to use keyword arguments (kwargs) in kScript v3 for clear, readable, and maintainable function calls with named parameters. - **Reference —** [Color Constants](https://openmarket.xyz/kscript/core-concepts/color-constants.md): Predefined color constants available in kScript for chart visualization and plotting. - **Reference —** [User-Defined Functions](https://openmarket.xyz/kscript/core-concepts/user-functions.md): Learn how to create custom, reusable functions in kScript v3 using the func keyword for modular and maintainable code. ## kScript: Functions - **Reference —** [Script Definition](https://openmarket.xyz/kscript/functions/script-definition.md): Define an indicator's metadata and surface user-configurable inputs. Plus debugging and data-source helpers. - **Reference —** [Strategy Functions](https://openmarket.xyz/kscript/functions/strategy-functions.md): The strategy() declaration and every strategy.* method - orders, brackets, cancellation, and position getters - with full parameter tables. - **Reference —** [Control Flow](https://openmarket.xyz/kscript/functions/control-flow.md): if/else, for loops, ternary expressions, and switch, the building blocks of per-bar logic in kScript. - **Reference —** [Moving Averages](https://openmarket.xyz/kscript/functions/moving-averages.md): Moving averages and price-band helpers — SMA, EMA, ALMA, SWMA, HMA, WMA, VWMA, RMA, LinReg, Bollinger, Keltner, Donchian. - **Reference —** [Oscillators](https://openmarket.xyz/kscript/functions/oscillators.md): Momentum and volume oscillators — RSI, WPR, CMO, TSI, MACD, Stochastic, CCI, MFI, Momentum, ADX, and OBV. - **Reference —** [Trend Indicators](https://openmarket.xyz/kscript/functions/trend-indicators.md): ADX, Ichimoku Cloud, MACD, and Parabolic SAR — trend strength, momentum, and reversal indicators. - **Reference —** [Special Indicators](https://openmarket.xyz/kscript/functions/special-indicators.md): Anchored VWAP, Ichimoku Cloud, Supertrend, and Parabolic SAR. - **Reference —** [Volume Indicators](https://openmarket.xyz/kscript/functions/volume-indicators.md): Money Flow Index and On-Balance Volume — volume-weighted indicators that confirm price moves and flag divergences. - **Reference —** [TA Library](https://openmarket.xyz/kscript/functions/ta-library.md): The v3 technical-analysis library: the full indicator catalog, multi-output indicators, warmup and forward-fill conventions, and reference-validated accuracy. - **Reference —** [Volume Profile Functions](https://openmarket.xyz/kscript/functions/volume-profile.md): Accessor functions for the volume_profile source — extract buy/sell volume, delta, point of control, and price range from each bar's price-level ladder. - **Reference —** [Orderbook Functions](https://openmarket.xyz/kscript/functions/orderbook-functions.md): Order-flow analytics functions for measuring bid and ask depth at configurable depth percentages. - **Reference —** [Plotting & Visualization](https://openmarket.xyz/kscript/functions/plotting.md): Render lines, bars, histograms, candles, shapes, text, labels, tables, and rectangles on the chart. - **Reference —** [Foreign-Domain Panes](https://openmarket.xyz/kscript/functions/foreign-panes.md): Offchart panes that ignore the time axis: categorical grids (plotMatrix), numeric-X curves (plotCurve), and KPI tile dashboards (plotTiles), plus the shared structural rules and caps. - **Reference —** [Drawing Objects](https://openmarket.xyz/kscript/functions/drawing-objects.md): Create, restyle, and delete chart drawings you own — lines, boxes, labels, polylines, fills, and tables. - **Reference —** [Drawing Primitives](https://openmarket.xyz/kscript/functions/drawing-primitives.md): Per-bar visual primitives: the plotShape marker set with locations and character markers, barcolor(), fillBetween(), and rich table cells. - **Reference —** [Styling](https://openmarket.xyz/kscript/functions/styling.md): Size tiers, tooltips, alignment vocabulary, z-order, color palettes, and the value-driven styling pattern (per-element gradients, opacity, and glow). - **Reference —** [Typed Inputs](https://openmarket.xyz/kscript/functions/typed-inputs.md): Expose script settings with input(), covering number, select, color, slider, boolean, source, and more. - **Reference —** [Alerts](https://openmarket.xyz/kscript/functions/alerts.md): Define configurable notifications with alert() and alertcondition(). - **Reference —** [Libraries](https://openmarket.xyz/kscript/functions/libraries.md): Share functions and types across your scripts: create a library in the editor, import it with @owner/name, pin versions, and publish when it is ready. Library code is frozen into your scripts at save, so charts never depend on a registry at runtime. - **Reference —** [Math Functions](https://openmarket.xyz/kscript/functions/math-functions.md): The math namespace, covering abs, rounding, powers, logs, trig, and hyperbolics for numeric work in kScript. - **Reference —** [Color Functions](https://openmarket.xyz/kscript/functions/color-functions.md): Build and transform colors with rgb, new, opacity, lighten, darken, blend, and data-driven gradients. - **Reference —** [String Functions](https://openmarket.xyz/kscript/functions/string-functions.md): String manipulation and transformation methods available in kScript v3 for text processing. - **Reference —** [Series Functions](https://openmarket.xyz/kscript/functions/series-functions.md): Crossovers, rolling extremes, change, percentile, correlation, and na handling for time series. - **Reference —** [Utility Functions](https://openmarket.xyz/kscript/functions/utility-functions.md): Series statistics, crossover detection, and value validation helpers used across indicators and signals. - **Reference —** [Conditionals & Loops](https://openmarket.xyz/kscript/functions/loops.md): Learn how to use for loops, while loops, and conditional statements in kScript v3 for iterative calculations and control flow logic within the per-bar execution model. ## kScript: Cookbook - **Recipes —** [Cookbook](https://openmarket.xyz/kscript/cookbook/overview.md): Complete, working kScript v3 recipes you can copy, run, and adapt. From a volume-spike detector to a four-venue aggregated CVD. - **Recipes —** [Volume Spike Detector](https://openmarket.xyz/kscript/cookbook/volume-spike.md): Flag bars whose volume blows past its trailing average, scored as a z-score against a rolling mean and standard deviation. - **Recipes —** [Anchored VWAP](https://openmarket.xyz/kscript/cookbook/anchored-vwap.md): Weekly and daily VWAP that reset on real UTC session boundaries, with bands and a live stretch readout for mean-reversion context. - **Recipes —** [Regime Filter (4h Trend Gate)](https://openmarket.xyz/kscript/cookbook/regime-filter.md): A no-repaint higher-timeframe trend gate that tints candles by regime and only marks entries when the confirmed 4h trend agrees with the signal. - **Recipes —** [Key Levels](https://openmarket.xyz/kscript/cookbook/key-levels.md): Prior-day and prior-week highs and lows plus the running day open, drawn as labeled horizontal levels that are calendar-correct on any chart interval. - **Recipes —** [Aggregated CVD](https://openmarket.xyz/kscript/cookbook/aggregated-cvd.md): One cumulative volume-delta line summed across four exchanges, with volatility bands and a live venue count. The multi-source recipe Pine can't easily write. - **Recipes —** [Whale vs Retail CVD](https://openmarket.xyz/kscript/cookbook/tape-reader.md): Separate whale flow from retail flow using the tape pre-bucketed into real USD order-size bands, with months of history and per-bar trade counts. - **Recipes —** [Zone Tracker](https://openmarket.xyz/kscript/cookbook/zone-tracker.md): Supply and demand zones as typed structs in a persisted collection, drawn as boxes that delete themselves when price mitigates them, with a live dashboard. - **Recipes —** [Historical Returns Matrix](https://openmarket.xyz/kscript/cookbook/historical-returns.md): Month-by-year percentage returns as a foreign-domain matrix pane: rows are years, columns are months, with AVG / MED / WIN% summary rows and the forming month highlighted. Identical on every chart interval. ## kScript: FAQ - **Topics —** [General FAQ](https://openmarket.xyz/kscript/faq/general.md): Frequently asked questions about kScript, covering everything from basic syntax to advanced topics. - **Topics —** [Best Practices](https://openmarket.xyz/kscript/faq/best-practices.md): Guidelines and recommendations for writing efficient, maintainable, and error-free kScript code. - **Topics —** [Limitations](https://openmarket.xyz/kscript/faq/limitations.md): What kScript does not do yet, and where to find the sandbox numbers. - **Topics —** [Common Errors](https://openmarket.xyz/kscript/faq/common-errors.md): The kScript errors you are most likely to hit, what causes each one, and how to fix it. - **Topics —** [Exchange & Symbol Format](https://openmarket.xyz/kscript/faq/symbol-format.md): Complete list of supported exchanges and their symbol format syntax for use in kScript. ## kScript: Reference - **Lookup —** [Reference](https://openmarket.xyz/kscript/reference/quick-reference.md): Comprehensive reference for all kScript functions, variables, and data types. Build powerful trading algorithms with our extensive library of technical indicators and utilities. - **Lookup —** [Limits Reference](https://openmarket.xyz/kscript/reference/limits.md): The sandbox limits every kScript runs under, what each one protects, and when you will hit it. ## kScript: Releases - **Docs —** [Overview](https://openmarket.xyz/kscript/releases/overview.md): How kScript versions are documented, what to expect in each release entry, and where to find migration context when upgrading from older language versions. - **Docs —** [Release Notes](https://openmarket.xyz/kscript/releases/changelog.md): kScript release history: features, fixes, and breaking changes, listed newest first with anchor links into full entries. ## kScript: Migration - **Guide —** [kScript v1 vs v2 — Key Differences](https://openmarket.xyz/kscript/migrations/v1-vs-v2.md): Major improvements and design changes between kScript v1 and v2. Learn what's new in the latest version. - **Guide —** [v2 vs v3](https://openmarket.xyz/kscript/migrations/v2-vs-v3.md): A migration guide for v2 script authors. v3 is additive (your scripts keep running), but TA builtins, negative timeseries subscripts, and a few conveniences need checking.