Strategy Builder Documentation
Quatick · Enterprise-Grade Automated Trading Strategy Engine
The Quatick Strategy Builder is a professional-grade visual strategy creation system for automated trading. It provides a comprehensive 9-step wizard that walks you through every aspect of strategy design — from naming and configuration through signal construction, risk management, backtesting, and live deployment. The builder supports 100+ technical indicators, multiple broker integrations, advanced re-entry strategies (Grid/DCA/Pyramid), and a real-time backtesting engine with 30+ performance metrics.
Overview
What Is the Strategy Builder?
The Strategy Builder is a no-code/low-code visual tool that enables traders — from beginners to institutional quants — to design, test, and deploy automated trading strategies without writing a single line of code. It combines a form-based condition editor with a visual node-based flow builder (React Flow) to create complex trading logic using boolean operators, comparisons, crossovers, and flow control (if/elif/else/switch).
Every strategy built in the wizard is backed by a DSL (Domain-Specific Language) that serializes to JSON for portability, sharing, and import/export. Strategies can be published to the Quatick Marketplace for community access or kept private for personal use.
Strategy Design
- • 9-step guided wizard
- • Form-based condition editor
- • Visual node-based flow builder
- • 100+ technical indicators
- • Custom formula engine
- • Signal presets library
Testing & Validation
- • Historical backtesting
- • Forward testing (walk-forward)
- • Real-time paper trading
- • 30+ performance metrics
- • Equity curve & drawdown charts
- • Monthly returns heatmap
Execution & Deployment
- • Multi-broker support
- • Live order execution
- • Paper trading simulation
- • Grid/DCA/Pyramid re-entry
- • Partial exit management
- • Risk limits & circuit breakers
System Architecture
The Strategy Builder is built on a layered architecture with clear separation of concerns. The UI layer (React/Next.js) manages wizard state via a Zustand store (900+ lines). The signal evaluation engine processes candle data through condition groups, applying boolean logic and crossover detection. The backtest engine orchestrates full historical simulation with position lifecycle management, while the executor handles live/paper trading via broker APIs.
The 9-Step Wizard
The Strategy Builder uses a sequential 9-step wizard. Each step builds upon the previous, from basic identification through complex signal logic to final deployment. You can navigate freely between completed steps using the sidebar accordion.
Particulars
Name your strategy, add a description, select tags for categorization, and set visibility (private/public). An auto-generated 8-digit Strategy ID is created from your strategy name.
Settings
Configure global strategy behavior — enable multiple entries/exits, choose a multi-entry strategy type (Grid/DCA/Pyramid/Manual), set spread type and gap connections.
Tagging
Optional step to configure client order ID prefixes for tracking and reconciliation. Define signal tags, conditional tags, and order linking rules.
Symbol Configuration
Select your trading broker, instrument (stock/futures/options/crypto), timeframe (1m to 1W), and session mode (continuous/intraday/positional) with exchange-specific session times.
Quantity & Capital
Define position sizing mode — Fixed Quantity, % of Capital, Risk-Based, or Capital per Position. Set maximum concurrent positions and configure entry allocations for multi-entry strategies.
Entry Signals
Build entry conditions using the form editor or visual node builder. Configure indicators, operators, and thresholds. Set up re-entry strategies (Grid/DCA/Pyramid) with levels, spacing, and cooldown.
Exit Signals & Risk
Define exit conditions, stop loss (percentage/fixed/ATR with optional trailing), take profit (percentage/fixed/risk-reward), partial exit levels, daily loss limits, and retry configuration.
Strategy Testing
Run historical backtests, forward tests (walk-forward analysis), or switch to real-time paper/live trading. View 30+ performance metrics, equity curves, drawdown charts, and monthly returns heatmaps.
Review & Deploy
Review all strategy settings in collapsible sections. Export/import strategy as DSL JSON. View the human-readable HSL format. Deploy to paper trading or live broker execution.
Quick Start Guide (5 Minutes)
Build Your First Strategy
- Open the Strategy Builder from the Automated Trading section
- Step 0: Enter a strategy name (e.g., 'Golden Cross NIFTY') — the ID auto-generates
- Step 1: Leave default settings unless using multi-entry — proceed to next step
- Step 2: Skip tagging (optional) — proceed to next step
- Step 3: Select Broker → Symbol (e.g., NIFTY) → Timeframe (e.g., 5m) → Session Mode
- Step 4: Choose 'Fixed Quantity', set quantity to 1 lot
- Step 5: Add Entry — Left: SMA(50) → Operator: crossesAbove → Right: SMA(200)
- Step 6: Add Exit — Left: SMA(50) → Operator: crossesBelow → Right: SMA(200) + Set SL: 2%
- Step 7: Run Backtest — set date range, capital, and hit 'Run Backtest'
- Step 8: Review results and deploy to Paper Trading
Key Concepts
Signal
A named set of conditions that triggers an entry or exit action. Each signal evaluates on every candle bar and fires when all conditions are met.
Condition Group
Multiple conditions joined by AND/OR logic. AND requires all conditions true; OR requires at least one. Groups can be nested for complex boolean expressions.
Crossover
A special comparison that fires once when a value crosses from one side to another — crossesAbove or crossesBelow. Only triggers on the exact bar of crossing.
Risk Management
Stop Loss, Take Profit, partial exits, trailing stops, max daily loss limits, and position size constraints that protect capital during execution.
Backtest Engine
Processes historical candle data through your strategy logic, tracking positions, P&L, and computing 30+ metrics including Sharpe ratio, max drawdown, and win rate.
DSL (Domain-Specific Language)
The JSON serialization format for strategies. Enables import/export, sharing, and version control of strategy configurations.
Step 0 — Particulars
The Particulars step is the foundation of every strategy. Here you define the identity, metadata, and access controls for your strategy. A well-named and tagged strategy is easier to find, maintain, and share.
Strategy Name
The strategy name is the primary identifier visible throughout the platform — in the strategy list, execution dashboard, marketplace, and backtest reports. Choose a descriptive name that communicates the strategy's approach. When you type a name, an 8-digit numeric Strategy ID is auto-generated using a hash function. This ID is immutable and used internally for tracking orders, positions, and execution logs.
| Field | Type | Default | Description |
|---|---|---|---|
| name* | string | — | The human-readable name of your strategy. Must be unique within your workspace. Max 100 characters. Examples: 'Golden Cross NIFTY', 'RSI Mean Reversion BTC', 'Supertrend Scalper'. |
| strategyId | string (8 digits) | — | Auto-generated 8-digit numeric ID derived from the name hash. Used for internal order tracking and references. Read-only. |
[Signal Type] [Indicator] [Instrument] — e.g., "Trend Following Supertrend BANKNIFTY" or "Mean Reversion RSI BTCUSDT". Consistent naming helps when managing dozens of strategies.Description
A multi-line text field for documenting your strategy's logic, rationale, and expected behavior. This is displayed in the strategy list, review step, and marketplace listing. A thorough description helps future-you (and other users if published) understand the strategy's intent without reading every condition.
| Field | Type | Default | Description |
|---|---|---|---|
| description | string | — | Free-form text describing the strategy logic, market conditions it targets, and expected behavior. Supports multiple lines. Displayed in strategy list and marketplace. |
Tags
Tags categorize your strategy for filtering, search, and marketplace discovery. Select from built-in tags or create custom ones. Multiple tags can be applied — use them to describe the strategy type, instrument class, timeframe, and approach.
| Field | Type | Default | Description |
|---|---|---|---|
| tags | string[] | [] | One or more category tags. Built-in options include: momentum, trend-following, mean-reversion, scalping, swing, breakout, grid, dca, intraday, positional, futures, options, equity, crypto, and more. Custom tags can be typed in. |
Visibility & Access Control
Control who can see and use your strategy. Private strategies are visible only to you. Public strategies can be discovered by other users. Marketplace-enabled strategies appear in the Quatick Strategy Marketplace for community use.
| Field | Type | Default | Description |
|---|---|---|---|
| access* | "private" | "public" | "private" | Visibility scope. Private: only you can see/use. Public: discoverable by other users in the platform. |
| marketplace | boolean | false | Whether to list this strategy on the Quatick Marketplace. Requires 'public' access. Other users can browse, copy, and adapt your strategy. |
Strategy Figure
Upload an optional image or chart screenshot as the strategy's visual thumbnail. This image appears in the strategy list, marketplace cards, and review step. Supported formats: PNG, JPG, WebP. Recommended size: 400x300px.
Saved Strategies
The Particulars step also provides access to your saved strategies list. You can load a previously saved strategy to continue editing, duplicate an existing strategy as a starting point, or delete strategies you no longer need. Strategies are saved with all their configuration from every step.
Particulars Step Checklist
- Enter a clear, descriptive strategy name using the naming convention
- Verify the auto-generated Strategy ID is displayed
- Write a thorough description explaining the strategy's logic and market target
- Add relevant tags for categorization (at least 2-3 tags recommended)
- Set visibility to 'Private' during development, switch to 'Public' when ready
- Upload a strategy figure (optional but recommended for marketplace listing)
Step 1 — Settings
The Settings step configures global strategy behavior that affects how entries and exits interact. This is where you decide whether your strategy uses single or multiple entry/exit points, define the re-entry strategy type, and configure spacing between levels.
Multiple Entries & Exits
By default, strategies use a single entry and single exit. Enabling multiple entries allows the strategy to build a position incrementally across different price levels or conditions. Multiple exits enable staged profit-taking with partial closes at different targets.
| Field | Type | Default | Description |
|---|---|---|---|
| multipleEntries | boolean | false | Enable multiple entry signals. When true, the strategy can place additional entry orders at different levels or conditions. Each entry set has its own conditions, order type, and capital allocation. |
| multipleExits | boolean | false | Enable multiple exit signals. When true, you can define partial exit levels at different price targets or conditions. Works with the Partial Exit panel in the Exit step. |
Multi-Entry Strategy Type
When multiple entries are enabled, you must choose a re-entry strategy that defines how and when additional entries are placed. Each strategy type has distinct behavior and risk characteristics:
| Field | Type | Default | Description |
|---|---|---|---|
| reEntryMode | "grid" | "dca" | "pyramid" | "manual" | "manual" | The multi-entry management strategy. Grid: equally-spaced levels. DCA: scale into losing positions. Pyramid: add to winning positions. Manual: each entry set is independently triggered. |
Grid Trading
Places buy/sell orders at fixed intervals around a central price. Profits from range-bound markets by buying low and selling high within a defined grid. Best for sideways markets with clear support/resistance.
DCA (Dollar Cost Averaging)
Adds to a losing position at progressively lower prices to reduce average entry cost. 'Safety orders' trigger as price drops. Works in markets with expected recovery. Risk: deeper drops multiply losses.
Pyramid (Scale-In)
Adds to a winning position as price moves favorably. Captures larger profits in strong trends by increasing size while in profit. Trailing stops protect accumulated gains.
Manual
Each entry set has independent conditions — no auto-spacing or scaling. Full control over when and how each entry fires. Use when entries are triggered by different signals or indicators.
Spread Configuration
Spread defines the distance between the first entry and subsequent entries in multi-entry strategies. This controls how far apart your grid/DCA/pyramid levels are placed.
| Field | Type | Default | Description |
|---|---|---|---|
| spreadType | "fixed" | "variable" | "atr" | "fixed" | How the distance between entry levels is calculated. Fixed: constant price offset. Variable: user-defined per level. ATR: automatic based on Average True Range volatility. |
| spreadValue | number | — | The spread amount. For 'fixed': absolute price units or percentage. For 'atr': multiplier of ATR value (e.g., 1.5 = 1.5 × ATR). |
Dynamic Gap Connection
Gap connections link entry and exit signals so that when an entry fires, its corresponding exit is automatically armed. This prevents orphaned positions and ensures every entry has a defined exit path.
| Field | Type | Default | Description |
|---|---|---|---|
| gapConnections | boolean | false | When enabled, entry sets are connected to exit sets via gap links. An exit only activates after its linked entry has fired. Prevents exit conditions from triggering before entry. |
Starting Counter
The starting counter is a read-only field showing the initial order counter value configured in the Tagging step. It's displayed here for reference — each new order increments this counter for unique order identification.
Settings Step Checklist
- Decide whether your strategy needs multiple entries (Grid/DCA/Pyramid) or single entry
- If using multi-entry, select the appropriate re-entry strategy type
- Configure spread between levels (Fixed for simple, ATR for adaptive)
- Enable Gap Connections if you want entry-exit linking
- Review the starting counter from the Tagging step
- For simple strategies, default settings (single entry/exit) work well — skip to Symbol step
Step 2 — Tagging
The Tagging step is an optional but powerful configuration for order tracking, reconciliation, and audit trails. It lets you define custom Client Order IDs, attach signal-level metadata tags, set conditional tags based on order direction, and link buy/sell orders for paired tracking. This step is crucial for institutional-grade order management.
Client Order ID
The Client Order ID is a unique identifier sent with every order to the broker for tracking and deduplication. It follows a customizable template format with segments that encode instrument, direction, broker, and sequence information.
| Field | Type | Default | Description |
|---|---|---|---|
| clientOrderIdPrefix | string | — | Base prefix for all order IDs generated by this strategy. Combined with order context and counter to create unique IDs. Example: 'GC-NIFTY' becomes 'GC-NIFTY-LE-001'. |
| counterTemplate | string | — | The template pattern for building order IDs. Segments: I (instrument), D (direction), B (broker), LE/LX/SE/SX (order context). Example format: '{prefix}-{context}-{counter}'. |
| counterPadding | "YYYY" | "MMDD" | custom | — | Number padding format for sequential counter. YYYY pads to 4 digits (0001-9999). MMDD uses date-based numbering. Custom allows arbitrary length. |
Order Context (LE/LX/SE/SX)
Every order is automatically tagged with a directional context that identifies whether it's an entry or exit, and whether it's long or short. This context is appended to the Client Order ID and used for order linking and reconciliation.
| Field | Type | Default | Description |
|---|---|---|---|
| LE | context tag | — | Long Entry — A buy order opening a new long position. |
| LX | context tag | — | Long Exit — A sell order closing an existing long position. |
| SE | context tag | — | Short Entry — A sell order opening a new short position. |
| SX | context tag | — | Short Exit — A buy order closing an existing short position. |
Signal Tags
Signal tags are custom metadata labels attached to orders based on which signal triggered them. They help identify which specific condition set caused an order — useful for performance attribution analysis by signal.
| Field | Type | Default | Description |
|---|---|---|---|
| signalTags | Record<string, string> | {} | Mapping of signal names to tag labels. When a signal fires, its associated tag is included in the order metadata. Example: { 'rsi_oversold': 'RSI-30', 'macd_cross': 'MACD-BULL' }. |
Conditional Tags
Conditional tags apply additional metadata based on runtime conditions — such as the order direction, market session, or time of day. These rules evaluate at order placement time and enrich the order metadata for downstream analysis.
Order Linking
Order linking connects entry orders with their corresponding exit orders using shared reference IDs. When Auto Order ID Linking is enabled, the system automatically generates link references between LE↔LX and SE↔SX pairs, enabling trade reconstruction and P&L attribution at the order level.
| Field | Type | Default | Description |
|---|---|---|---|
| autoOrderIdLinking | boolean | false | Automatically link entry and exit orders by generating shared reference IDs. Entry ID 'GC-LE-0001' links to exit 'GC-LX-0001' via a common trade reference. |
Tagging Step Checklist
- Define a meaningful Client Order ID prefix for your strategy
- Select appropriate order context segments (LE/LX/SE/SX)
- Configure counter padding (YYYY for up to 9999 orders)
- Add signal tags if running multiple entry signals for attribution analysis
- Enable Auto Order ID Linking for paired entry/exit tracking
- Skip this step entirely if you're only backtesting — tags are for live execution
Step 3 — Symbol Configuration
The Symbol step defines your trading context — which broker, instrument, product type, timeframe, and session mode to use. These choices fundamentally affect how your strategy operates, what data is available, and when trades execute. Get this step right before building signals.
Broker Selection
Select the broker that will provide market data and execute orders. Each broker supports different asset classes, exchanges, and order types. The broker selection determines which instruments appear in the symbol picker and what order types are available.
| Field | Type | Default | Description |
|---|---|---|---|
| broker* | string | — | The broker/exchange to connect. Options: Zerodha (NSE/BSE/MCX), Fyers (NSE/BSE), Delta Exchange (Crypto Futures/Options), Binance (Crypto Spot/Futures), and more as supported. |
Indian Brokers
- • Zerodha (NSE, BSE, MCX)
- • Fyers (NSE, BSE)
- • Angel One (NSE)
- • Upstox (NSE, BSE)
Crypto Exchanges
- • Binance (Spot, Futures)
- • Delta Exchange (Futures, Options)
- • WazirX (Spot)
- • CoinDCX (Spot)
Supported Markets
- • Equities (Cash)
- • Equity Futures
- • Equity Options
- • Commodity Futures
- • Currency Futures
- • Crypto Spot & Futures
Sub-Asset Type & Product Type
After selecting a broker, choose the sub-asset type (segment) and product type. The sub-asset determines the exchange segment (e.g., equity, commodity, currency), while product type specifies whether you're trading spot, futures, or options.
| Field | Type | Default | Description |
|---|---|---|---|
| subAssetType* | string | — | The market segment — e.g., 'stock' (equity cash), 'commodity' (MCX), 'currency' (forex). Available options depend on the selected broker. |
| productType* | "spot" | "futures" | "options" | — | The derivative type. Spot: direct instrument. Futures: expiry-dated contracts. Options: strike price + expiry contracts with call/put. |
Instrument Selection
Use the instrument search modal to find and select trading symbols. The modal provides a searchable list of instruments from the selected broker and segment. For futures, you'll also select an expiry date. For options, you'll configure strike type and offset.
| Field | Type | Default | Description |
|---|---|---|---|
| symbols* | Symbol[] | — | Array of selected instruments. Each contains: symbol name, product type, and optionally expiry, strikeType, and strikeLevelOffset for derivatives. |
| symbol.symbol* | string | — | The instrument ticker — e.g., 'NIFTY', 'RELIANCE', 'BTCUSDT', 'BANKNIFTY'. |
| symbol.expiry | string | — | Expiry date for futures/options contracts. Format: YYYY-MM-DD. Required for futures and options product types. |
| symbol.strikeType | "ATM" | "ITM" | "OTM" | — | Strike selection type for options. ATM: At The Money. ITM: In The Money. OTM: Out of The Money. |
| symbol.strikeLevelOffset | number | 0 | Offset from ATM strike in number of levels. 0 = exactly ATM, +1 = 1 strike OTM, -1 = 1 strike ITM. |
Timeframe
The timeframe determines the candle interval for strategy evaluation. Each candle bar represents this time period's price action (open, high, low, close, volume). Shorter timeframes generate more signals but more noise; longer timeframes are smoother but slower to react.
| Field | Type | Default | Description |
|---|---|---|---|
| timeframe* | string | — | Candle interval. Options: 1m, 3m, 5m, 15m, 30m, 1H, 4H, 1D, 1W, tick, multi. The 'tick' option evaluates on every trade. 'multi' allows multi-timeframe analysis. |
Very short-term, high frequency. Requires tight spreads and fast execution. More noise, more trades. Suitable for liquid instruments only.
Medium-term intraday trades. Good balance of signal quality and frequency. Most popular for day trading strategies.
Multi-day positions. Smoother signals, fewer false positives. Lower trade frequency but higher conviction per trade.
Weekly candles for long-term trend following. Very few signals — suitable for portfolio-level strategies with large position sizes.
Session Mode
Session mode controls when the strategy is active and how positions are managed across trading sessions. This is critical for determining whether positions carry overnight.
| Field | Type | Default | Description |
|---|---|---|---|
| sessionMode* | "continuous" | "intraday" | "positional" | — | Trading session behavior. Continuous: 24/7 operation (crypto). Intraday: auto-square-off before session end. Positional: carry positions overnight. |
| sessionStart | string (HH:MM) | — | Session start time for intraday mode. Auto-filled from exchange defaults — NSE: 09:15, MCX: 09:00, Crypto: N/A. |
| sessionEnd | string (HH:MM) | — | Session end time for intraday mode. Positions are force-closed before this time. NSE: 15:30, MCX: 23:30. |
Symbol Step Checklist
- Select the correct broker for your target exchange
- Choose the appropriate sub-asset type (equity/commodity/currency/crypto)
- Search and select your instrument from the symbol picker
- For futures: verify the correct expiry date is selected
- For options: configure strike type (ATM/ITM/OTM) and offset
- Set timeframe matching your trading style (scalping: 1-5m, intraday: 15m-1H, swing: 4H-1D)
- Choose session mode — Intraday for day trading, Continuous for crypto, Positional for swing
- If Intraday: verify session start/end times from exchange defaults
Step 4 — Quantity & Capital
The Quantity step defines how much capital is allocated per trade and how position sizes are calculated. Proper position sizing is the cornerstone of risk management — it determines how much you risk on each trade and how drawdowns affect your portfolio. The builder supports four sizing modes with configurable capital allocation across multiple entry sets.
Position Sizing Mode
Choose the method for calculating order quantity. Each mode has different risk characteristics and use cases:
| Field | Type | Default | Description |
|---|---|---|---|
| mode* | "fixed" | "percentOfCapital" | "riskBased" | "capitalPerPosition" | — | The position sizing calculation method. Determines how quantity is derived from capital, risk tolerance, and market conditions. |
Fixed Quantity
Quantity = user_defined_valueSet an exact number of shares/lots/contracts per trade. The simplest mode — quantity stays constant regardless of price or capital changes. Best for: testing, small accounts, single-instrument strategies.
Example: Always buy exactly 1 lot of NIFTY futures
% of Capital
Quantity = (portfolio_value × percent) / current_priceSize each position as a percentage of total portfolio value. As portfolio grows or shrinks, position sizes adjust proportionally. Implements automatic compounding.
Example: Risk 5% of ₹10,00,000 portfolio = ₹50,000 per trade
Risk-Based
Quantity = (capital × risk%) / (entry_price − stop_loss)Calculate position size based on the maximum acceptable loss per trade. Uses the distance between entry price and stop loss to determine how many units to buy. Requires a stop loss to be configured in the Exit step.
Example: Risk 1% of capital, entry=100, SL=95 → size = capital×0.01/5
Capital Per Position
Quantity = capital_per_position / current_priceAllocate a fixed capital amount per trade. With leverage, the effective position can be larger than the capital nominated. Useful for creating equal-weight position portfolios.
Example: ₹1,00,000 per position with 5x leverage = ₹5,00,000 notional
Quantity Fields
| Field | Type | Default | Description |
|---|---|---|---|
| quantity | number | — | For Fixed mode: the exact number of units per trade. For % of Capital: the percentage value (e.g., 5 for 5%). |
| capital | number | — | Total trading capital. Used as the base for percentage and risk-based calculations. Also sets the initial capital for backtesting. |
| leverage | number | 1 | Leverage multiplier for Capital Per Position mode. 1 = no leverage, 5 = 5x leverage. Amplifies both gains and losses. |
| maxPositions | number | 1 | Maximum number of concurrent open positions. Limits total exposure. For multi-entry strategies, this caps the number of pyramid/grid levels that can be active simultaneously. |
Strategy Profile
The Strategy Profile is automatically detected from your Settings step configuration. It displays a summary of how the strategy manages positions — Single Entry, Grid Trading, DCA, or Pyramid. This is read-only and reflects your multi-entry settings.
Entry Allocations
When using multiple entry sets, you can allocate a percentage of total capital to each entry signal. This controls how capital is distributed across different entry triggers. The last entry set automatically receives the residual percentage.
| Field | Type | Default | Description |
|---|---|---|---|
| entryAllocations | { entrySetId: string, percent: number }[] | — | Percentage capital allocation per entry signal set. Sum should equal 100%. Last entry gets residue. Example: Entry 1 = 60%, Entry 2 = 40%. |
| multipleEntryMode | boolean | false | Enable allocation editing. When false, all capital goes to a single entry set. |
Quantity Step Checklist
- Choose the position sizing mode that matches your risk management approach
- For beginners: start with Fixed Quantity for simplicity
- For risk management: use Risk-Based sizing (requires stop loss in Exit step)
- Set appropriate capital amount matching your trading account
- Configure maxPositions to limit total exposure
- If using multiple entries, allocate capital percentages to each entry set
- If using leverage, ensure stop losses are configured to prevent margin calls
- Verify the Strategy Profile matches your intended trading approach
Step 5 — Entry Signals
The Entry step is the heart of the Strategy Builder — here you define the exact conditions that trigger buy/sell orders. Using the form-based condition builder or the visual node-based flow editor, you construct boolean logic trees with technical indicators, price data, and custom formulas. The step also houses re-entry configuration for Grid/DCA/Pyramid strategies.
Building Entry Conditions
Each condition is a comparison between two values: Left Operand → Operator → Right Operand. The left and right sides can be any indicator, price variable, constant number, or custom formula. Multiple conditions are joined with AND/OR logic to form condition groups.
Nested condition groups allow arbitrarily complex logic. You can nest an OR group inside an AND group to express: "RSI oversold AND (MACD bullish OR Supertrend flip)". The nesting depth is unlimited, but keep it under 3 levels for maintainability.
Comparison Operators
| Field | Type | Default | Description |
|---|---|---|---|
| > | comparison | — | Greater Than — True when left value exceeds right value. Re-evaluates every bar. Example: RSI(14) > 70 (overbought). |
| < | comparison | — | Less Than — True when left value is below right value. Example: RSI(14) < 30 (oversold). |
| >= | comparison | — | Greater Than or Equal — True when left value is at or above right value. |
| <= | comparison | — | Less Than or Equal — True when left value is at or below right value. |
| == | comparison | — | Equal — True when left and right values are exactly equal. Use with caution on floating-point indicator values. |
| != | comparison | — | Not Equal — True when left and right values differ. |
| crossesAbove* | crossover | — | Fires ONCE on the exact bar where the left value crosses from below to above the right value. The previous bar must have Left < Right, and the current bar must have Left >= Right. Does not fire on subsequent bars where Left remains above Right. |
| crossesBelow* | crossover | — | Fires ONCE on the exact bar where the left value crosses from above to below the right value. The previous bar must have Left > Right, and the current bar must have Left <= Right. |
crossesAbove/crossesBelow for entry signals — they fire once at the crossing point. Use >/< for filter conditions that must remain true. Example: "SMA(50) crossesAbove SMA(200) AND RSI(14) > 30" — the cross triggers entry, RSI filters timing.Available Indicators (100+)
Trend (Moving Averages)
- • SMA(period)
- • EMA(period)
- • WMA(period)
- • DEMA(period)
- • TEMA(period)
- • HMA(period)
- • KAMA(p, fast, slow)
- • VWMA(period)
Trend (Advanced)
- • Supertrend(period, mult)
- • Parabolic SAR(step, max)
- • Ichimoku(conv, base, span)
- • ADX(period)
- • DI+(period)
- • DI-(period)
- • TRIX(period)
Momentum
- • RSI(period)
- • MACD(fast, slow, signal)
- • Stochastic(%K, %D)
- • CCI(period)
- • Williams %R
- • ROC(period)
- • MFI(period)
- • Stochastic RSI
Volatility
- • ATR(period)
- • Bollinger Bands(p, std)
- • Keltner Channel
- • Donchian Channel
- • NATR(period)
Volume
- • OBV
- • VWAP
- • Money Flow Index
- • AD Line
- • CMF
- • Volume EMA
- • VPTC
Math & Statistics
- • abs()
- • sqrt()
- • log()
- • StdDev()
- • ZScore()
- • Correlation()
- • LinReg Slope
- • Percentile()
Signal Combination Patterns
Effective strategies combine multiple indicator types for confirmation. Here are proven multi-indicator patterns with their logic structure and when to use them.
When an entry condition fires, an order is placed with these parameters. The order side is automatically set based on the signal type.
| Field | Type | Default | Description |
|---|---|---|---|
| orderType | "market" | "limit" | "market" | Market: execute immediately at current price. Limit: place at a specified price, waits for fill. |
| orderSide | "buy" | "sell" | — | Auto-set based on signal direction. Buy = Long Entry. Sell = Short Entry. |
| timeInForce | "day" | "fill-or-kill" | "IOC" | "day" | How long the order remains active. Day: valid until session end. FOK: fill entirely or cancel. IOC: fill what's available, cancel rest. |
| limitPrice | number | — | Required for limit orders. The maximum buy price or minimum sell price. Can reference indicators. |
Multiple Entry Sets
When Multiple Entries is enabled in the Settings step, you can create multiple independent entry sets. Each set has its own conditions, order configuration, and label. Entry sets fire independently — a trade opens when any entry set's conditions are fully satisfied.
| Field | Type | Default | Description |
|---|---|---|---|
| entries | EntrySet[] | — | Array of entry configurations. Each contains: id, label, conditions (ConditionGroup), and order configuration. |
| entry.label | string | — | Human-readable label — e.g., 'RSI Oversold', 'MACD Cross'. Appears in backtest trade logs. |
| entry.priority | number | 0 | When multiple sets fire on the same bar, higher priority fires first. Equal priority = all fire. |
Re-Entry Configuration
Re-entry settings control when and how the strategy places additional entry orders after the initial entry. This powers Grid, DCA, and Pyramid strategies.
| Field | Type | Default | Description |
|---|---|---|---|
| reEntry.enabled | boolean | false | Enable re-entry logic. |
| reEntry.mode | "cooldown" | "grid" | "dca" | "pyramid" | — | Re-entry trigger behavior. |
| reEntry.cooldownBars | number | 5 | Minimum bars between consecutive entries. |
| reEntry.maxReEntries | number | 3 | Total re-entries allowed before position must close. |
| reEntry.distanceFromEntry | number | — | Minimum price distance from first entry. |
| reEntry.distanceType | "fixed" | "percentage" | "atr" | "percentage" | Fixed: absolute price. Percentage: % move. ATR: multiples of ATR. |
| reEntry.spreadFilter | number | — | Maximum bid/ask spread for re-entry orders. |
Signal Presets
Signal presets are pre-built condition templates that can be applied with one click. They provide proven entry strategies you can customize.
Golden Cross
SMA(50) crossesAbove SMA(200)Classic long-term trend following
Supertrend Buy
Close crossesAbove Supertrend(10,3)ATR-based trend reversal
RSI Oversold Bounce
RSI(14) crossesAbove 30Mean reversion from oversold
MACD Bull Cross
MACD(12,26) crossesAbove Signal(9)Momentum shift bullish
Bollinger Bounce
Close crossesAbove BB_Lower(20,2)Price recovers from lower band
Donchian Breakout
Close > Highest_High(20)Price breaks 20-day high
Triple Confirmation
RSI>30 AND MACD>0 AND Close>SMA(50)Multi-indicator confirmation
Flow Control (if/elif/else)
For advanced strategies, the Inline Flow Editor supports conditional branching within signals. You can define if/elif/else logic where different actions execute based on which condition block evaluates true first. This enables context-dependent entries.
Visual Node Builder & Chart Preview
As an alternative to the form-based editor, the Visual Node Builder provides a drag-and-drop canvas where you connect indicator nodes, condition nodes, logic gates (AND/OR/NOT), and signal output nodes. Nodes generate equivalent condition groups that sync bidirectionally with the form editor.
Data Nodes
- • Indicator Node — Configurable indicator with period/params. Output: numeric value per bar.
- • Condition Node — Two inputs + operator. Output: boolean (true/false) per bar.
Logic Nodes
- • Logic Gate Node — AND/OR/NOT gate combining multiple boolean inputs.
- • Signal Output Node — Terminal node that emits entry/exit signal when input is true.
Filter & Layout
- • Time Filter Node — Filters signals by HourOfDay, DayOfWeek, or session status.
- • Group Box — Visual container for organizing related nodes. No logic effect.
Entry Step Checklist
- Start with a single entry condition — add complexity gradually
- Use crossesAbove/crossesBelow for trigger conditions (fire once)
- Use > / < for filter conditions that must remain true
- Add a confirmation filter to reduce false signals (e.g., RSI > 30)
- Combine 2-3 indicator types: trend + momentum + volume
- For multi-entry: configure re-entry limits and cooldown periods
- Test with Signal Presets first, then customize parameters
- Verify entry signals appear as arrows on the chart preview
- If using Grid/DCA/Pyramid, verify level spacing and quantities
- Keep total conditions per signal under 5 — complex signals overfit
- Run a quick backtest to validate signal frequency (50-200 trades ideal)
Step 6 — Exit Signals & Risk Management
The Exit step is where risk management meets trade execution. Define the conditions that close your positions, configure stop loss and take profit levels, set up partial exit targets for staged profit-taking, and establish portfolio-level risk limits. A well-configured exit strategy protects capital and locks in profits.
Exit Conditions
Exit conditions follow the same structure as entry conditions — a condition group with Left → Operator → Right comparisons joined by AND/OR logic. When the exit condition group evaluates to true, a sell order is placed to close the position. Exit conditions are evaluated independently from stop loss and take profit — whichever triggers first closes the position.
| Field | Type | Default | Description |
|---|---|---|---|
| conditions | ConditionGroup | — | The exit condition tree. Same structure as entry conditions — indicators, comparisons, AND/OR logic. Example: SMA(50) crossesBelow SMA(200) for a trend reversal exit. |
| order | OrderConfig | — | Exit order configuration — order type (market/limit), time-in-force. Order side is auto-set to the opposite of entry (sell for long exit, buy for short exit). |
Stop Loss Configuration
A stop loss (SL) automatically exits the position when price moves against you by a specified amount. It limits the maximum loss per trade and is the most important risk management tool. Three calculation modes are supported:
| Field | Type | Default | Description |
|---|---|---|---|
| stopLoss.enabled | boolean | false | Toggle stop loss on/off. Strongly recommended to always enable. |
| stopLoss.type* | "percentage" | "fixed" | "atr" | — | How the stop loss distance is calculated from entry price. |
| stopLoss.value* | number | — | Stop loss distance. For 'percentage': % below entry (e.g., 2 = 2% loss). For 'fixed': absolute price units (e.g., 50 = ₹50 below entry). For 'atr': ATR multiplier (e.g., 2 = 2 × ATR(14) below entry). |
| stopLoss.trailing | boolean | false | Enable trailing stop. The SL follows price as it moves favorably, locking in profits. Never moves backwards (against favorable direction). |
| stopLoss.trailingAmount | number | — | Distance the trailing stop stays behind the peak favorable price. When price advances, the SL ratchets up; when price retreats, SL stays at the high watermark minus this amount. |
| stopLoss.trailingType | "percentage" | "fixed" | "percentage" | How the trailing distance is measured. Percentage: % from peak. Fixed: absolute price units from peak. |
Take Profit Configuration
Take profit (TP) automatically locks in gains when price reaches a favorable target. Like stop loss, it can be calculated as a percentage, fixed amount, or risk-reward ratio.
| Field | Type | Default | Description |
|---|---|---|---|
| takeProfit.enabled | boolean | false | Enable automatic take profit. When price reaches the TP level, the full remaining position is closed. |
| takeProfit.type* | "percentage" | "fixed" | "riskReward" | — | Calculation mode. Percentage: % above entry. Fixed: absolute price units. Risk:Reward: TP = SL distance × RR multiplier. |
| takeProfit.value* | number | — | TP distance. Percentage: e.g. 4 = 4% profit. Fixed: e.g. 100 = ₹100 above entry. Risk:Reward: e.g. 2 = TP is 2× the SL distance. |
Partial Exit Levels
Partial exits allow staged profit-taking at multiple levels instead of closing the entire position at once. This is a professional risk management technique that locks in partial profits while letting remaining shares run.
| Field | Type | Default | Description |
|---|---|---|---|
| partialExits | PartialExit[] | — | Array of partial exit levels. Each level specifies what percentage of the position to close and at what target. |
| partialExit.percent* | number | — | Percentage of total position to close at this level. All partial exits should sum to 100% or less (remainder rides to final TP/SL/condition exit). |
| partialExit.targetType* | "percent_move" | "fixed_price" | "rr" | "indicator" | — | How the exit trigger is calculated. Percent move: % from entry. Fixed price: exact price level. RR: risk-reward multiples of SL. Indicator: dynamic level from indicator value. |
| partialExit.targetValue* | number | — | The trigger value for this level. For percent_move: e.g. 2 = exit at 2% profit. For rr: e.g. 1.5 = exit at 1.5× SL distance. |
Portfolio Risk Limits
| Field | Type | Default | Description |
|---|---|---|---|
| maxDailyLoss | number | — | Maximum daily loss as a percentage of capital. When breached, the strategy pauses all trading for the rest of the day. Example: 3 = pause after 3% daily loss. |
| maxOpenPositions | number | — | Maximum number of positions open across all strategies. Portfolio-level limit that prevents over-concentration. |
Exit Retry Configuration
If an exit order fails (due to broker rejection, insufficient liquidity, or network issues), the retry panel configures automatic retry behavior:
| Field | Type | Default | Description |
|---|---|---|---|
| retryMaxAttempts | number | 3 | Maximum number of retry attempts before alerting and pausing. |
| retryDelayBars | number | 1 | Number of bars to wait between retry attempts. |
| retryCondition | "re-evaluate" | "force-exit" | — | Whether to re-check exit conditions on retry (may cancel if conditions changed) or force exit regardless. |
Exit Step Checklist
- ALWAYS configure a Stop Loss — never deploy without one
- Set SL between 1-5% for equities, 3-8% for crypto (ATR-based recommended)
- Add a Take Profit — even if using condition-based exits
- Consider trailing stop for trend-following strategies
- For Risk:Reward TP, target at least 2:1 ratio (TP = 2× SL distance)
- Add partial exit levels if you want staged profit-taking
- Set maxDailyLoss limit to prevent catastrophic drawdowns
- Define exit conditions as a backstop — SMA crossBelow or RSI overbought
- Test exit behavior in backtesting before live deployment
- Configure retry settings for live execution reliability
Step 7 — Strategy Testing
The Testing step validates your strategy against real market data before risking capital. Three testing modes are available: historical backtesting (test against past data), forward testing (walk-forward analysis to detect overfitting), and real-time execution (paper or live trading). The built-in backtest engine processes candle data through your conditions, tracks positions, and computes 30+ performance metrics.
Historical Backtesting
Backtesting simulates your strategy on historical candle data. It processes each bar sequentially — evaluating entry/exit conditions, managing positions, applying stop loss/take profit, and recording every trade. After completion, comprehensive metrics and visualizations are generated.
| Field | Type | Default | Description |
|---|---|---|---|
| startDate* | string (YYYY-MM-DD) | — | Backtest start date. Determines how far back to test. Longer periods give more statistical significance but require more data. |
| endDate* | string (YYYY-MM-DD) | — | Backtest end date. Typically today or a recent date. For forward testing, this is the train/test split point. |
| initialCapital* | number | — | Starting capital for the simulation. Affects position size calculations for % of Capital and Risk-Based sizing modes. |
| commission | number | 0 | Commission per trade as a percentage. Example: 0.03 = 0.03% per trade. Applied to both entry and exit orders. |
| slippage | number | 0 | Expected slippage in ticks/points. Models the difference between expected and actual fill price. Higher for illiquid instruments. |
Performance Metrics (30+)
After a backtest completes, the engine computes comprehensive performance metrics across four categories:
P&L Metrics
- • Total P&L (₹ / %)
- • Average Win / Loss
- • Largest Win / Loss
- • Profit Factor
- • Expectancy
- • Annualized Return
Trade Statistics
- • Total Trades
- • Winning / Losing Trades
- • Win Rate (%)
- • Max Consecutive Wins
- • Max Consecutive Losses
- • Average Trade Duration
Risk Metrics
- • Max Drawdown (₹ / %)
- • Sharpe Ratio
- • Sortino Ratio
- • Calmar Ratio
- • Ulcer Index
- • Recovery Factor
Advanced
- • System Quality Number
- • Monthly Returns Grid
- • Drawdown Periods
- • Annualized Volatility
- • Skewness / Kurtosis
- • Win/Loss Ratio
| Field | Type | Default | Description |
|---|---|---|---|
| totalPnl | number | — | Absolute profit/loss in currency units. The bottom line — how much the strategy made or lost over the test period. |
| totalPnlPercent | number | — | P&L as a percentage of initial capital. A 10% return on ₹10,00,000 = ₹1,00,000 profit. |
| winRate | number | — | Percentage of winning trades. A 55% win rate with a 2:1 risk-reward ratio is already highly profitable. |
| profitFactor | number | — | Gross profit / Gross loss. Values > 1.5 indicate a robust strategy. Value of 1 = break-even. Below 1 = unprofitable. |
| maxDrawdown | number | — | Largest peak-to-trough decline in equity. Measures the worst-case capital erosion. Target < 20% for conservative strategies. |
| sharpeRatio | number | — | Risk-adjusted return metric. (Return − Risk-Free Rate) / Standard Deviation of Returns. Above 1 = good, above 2 = excellent. |
| sortinoRatio | number | — | Like Sharpe but only penalizes downside volatility. Better for strategies with asymmetric returns (large wins, small losses). |
| calmarRatio | number | — | Annualized return / Max drawdown. Measures return per unit of max drawdown risk. Above 1 is acceptable, above 3 is excellent. |
Visualization Charts
Five interactive charts provide visual insight into strategy performance:
Equity Curve
Shows portfolio value over time. An upward-sloping curve with minimal volatility indicates a consistent strategy. Look for smooth progression without sharp drops.
Cumulative P&L
Running total of profits and losses. Separates gross profit from gross loss to visualize the contribution of winning and losing trades over time.
Drawdown Chart
Visualizes peak-to-trough equity declines. Shows how deep and long each drawdown period lasted. Critical for understanding worst-case scenarios.
Monthly Returns Heatmap
Grid of monthly returns color-coded by P&L. Green = profit, red = loss. Quickly spot seasonal patterns or inconsistent months.
Trade Table
Detailed log of every trade: entry time/price, exit time/price, reason (signal/SL/TP), P&L, duration. Sortable and filterable for analysis.
Forward Testing (Walk-Forward Analysis)
Forward testing splits your data into train and test periods. The strategy is optimized on the training period and then validated on the unseen test period. This detects overfitting — if training performance is excellent but test performance drops significantly, the strategy is likely curve-fitted to historical data.
| Field | Type | Default | Description |
|---|---|---|---|
| trainTestSplit | number | 70 | Percentage of data used for training. The remaining percentage is the test set. Example: 70 = first 70% for training, last 30% for testing. |
| walkForwardWindows | number | 1 | Number of walk-forward windows. Multiple windows provide more robust out-of-sample validation. Each window uses a different train/test boundary. |
Real-Time Execution
Switch from backtesting to real-time mode to execute the strategy on live market data. Two sub-modes are available:
| Field | Type | Default | Description |
|---|---|---|---|
| Paper Trading | mode | — | Simulated execution with no real money. Orders fill at market price in a virtual account. Perfect for validating live behavior, testing latency, and building confidence before going live. |
| Live Trading | mode | — | Real order execution via broker APIs. Orders are sent to your connected broker account with real capital. Requires valid broker credentials and sufficient account balance. |
Testing Step Checklist
- Run a backtest with at least 6 months of data for statistical significance
- Set realistic commission and slippage values for your broker
- Check: Total trades > 30 (enough sample size for reliable statistics)
- Check: Win rate > 40% with RR > 1.5, or Win rate > 55% with RR > 1
- Check: Max drawdown < 20% for conservative, < 30% for aggressive strategies
- Check: Sharpe ratio > 1.0 (risk-adjusted returns are positive)
- Check: Profit factor > 1.5 (gross profit significantly exceeds gross loss)
- Run forward test to verify performance on unseen data
- If forward test performance drops > 50%, simplify conditions (reduce overfitting)
- Paper trade for at least 1-2 weeks before deploying with real capital
- Monitor drawdown chart for concerning patterns (deep/long drawdown periods)
Step 8 — Review & Deploy
The Review step provides a comprehensive overview of your entire strategy configuration. Every setting from all previous steps is displayed in collapsible sections for final verification. From here, you can export the strategy as DSL JSON, view the human-readable HSL format, deploy to paper or live trading, or publish to the marketplace.
Review Sections
Eight collapsible sections display your strategy's configuration. Each section shows a completion indicator (checkmark or warning) and can be expanded to view details or navigate back to that step for editing.
Particulars
Name, ID, description, tags, visibility
Settings
Multi-entry/exit, re-entry mode, spread config
Tagging
Client Order ID format, signal tags, linking
Symbol
Broker, instrument, timeframe, session mode
Quantity
Sizing mode, capital, max positions, allocations
Entry
Conditions (humanized), order config, re-entry
Exit
Conditions, SL/TP, partial exits, risk limits
Backtest
Latest backtest results, performance summary
DSL Export & Import
The Strategy DSL (Domain-Specific Language) is a JSON-based format that encodes every aspect of your strategy. Use it for backup, sharing, version control, and cross-platform portability.
| Field | Type | Default | Description |
|---|---|---|---|
| Copy DSL | action | — | Copies the full strategy JSON to your clipboard for pasting into files or sharing. |
| View HSL | action | — | Opens the HSL Viewer Modal with a human-readable plain-text representation of your strategy logic. Useful for review and documentation. |
| Export as File | action | — | Downloads the strategy as a .json file to your local machine. |
| Import DSL | action | — | Loads a previously exported strategy JSON file, populating all wizard steps with the imported configuration. |
Deployment Options
| Field | Type | Default | Description |
|---|---|---|---|
| Deploy to Paper | action | — | Start paper trading with simulated execution. Monitors strategy in real-time without risking real capital. Recommended for at least 1-2 weeks before going live. |
| Deploy to Live | action | — | Connect to your broker and execute real orders. Requires valid broker credentials and sufficient account balance. Risk limits from the Exit step are enforced. |
| Save as Draft | action | — | Save current configuration without deploying. Continue editing later from the Saved Strategies panel. |
| Publish to Marketplace | action | — | List the strategy on the Quatick Marketplace for community discovery. Requires 'Public' visibility. Your strategy configuration is fully visible to other users. |
Pre-Deployment Checklist
Final Review Before Deployment
- Verify strategy name and description are accurate and descriptive
- Confirm broker and symbol are correct for your trading account
- Verify timeframe matches your intended trading style
- Review all entry conditions — check for logic errors
- Confirm stop loss is enabled and at an appropriate level
- Verify take profit or exit conditions are configured
- Review partial exit levels if using staged profit-taking
- Confirm position sizing doesn't exceed your risk tolerance
- Verify backtest results are acceptable (win rate, drawdown, Sharpe)
- Forward test shows consistent performance with backtest
- Start with paper trading — never go live without paper testing first
Variables Reference
Variables are the building blocks of conditions. Every condition compares a left variable against a right variable using an operator. Variables fall into five categories: Math functions, Statistics, Price fields, Date/Time selectors, and Custom expressions.
Math Functions
Math functions operate on numeric values — either raw price data or indicator outputs. They can be composed: Abs(RSI(14) - 50) returns the distance from RSI midline.
| Field | Type | Default | Description |
|---|---|---|---|
| Abs(x) | number | — | Absolute value. Abs(-5) = 5. Useful for distance calculations. |
| Max(x, N) | number | N=14 | Maximum value of x over the last N bars. Max(High, 20) = 20-bar high. |
| Min(x, N) | number | N=14 | Minimum value of x over the last N bars. Min(Low, 20) = 20-bar low. |
| Round(x, D) | number | D=2 | Round x to D decimal places. Round(3.14159, 2) = 3.14. |
| Ceil(x) | number | — | Round up to nearest integer. Ceil(3.2) = 4. |
| Floor(x) | number | — | Round down to nearest integer. Floor(3.9) = 3. |
| Log(x) | number | — | Natural logarithm (base e). Log returns for normalization. |
| Log10(x) | number | — | Base-10 logarithm. Useful for orders of magnitude. |
| Sqrt(x) | number | — | Square root. Sqrt(Variance) = StdDev. |
| Exp(x) | number | — | Euler's number raised to x. Inverse of Log(). |
| Pow(x, N) | number | N=2 | x raised to power N. Pow(StdDev, 2) = Variance. |
| Sign(x) | number | — | Returns -1 if negative, 0 if zero, 1 if positive. Sign(MACD) for direction. |
| Mod(x, N) | number | — | Modulo — remainder after division. Mod(BarIndex, 5) for periodic logic. |
| Clamp(x, lo, hi) | number | — | Restricts x to range [lo, hi]. Values outside are pinned to boundaries. |
Abs(Close - SMA(20)) > 2 * ATR(14) checks if price is more than 2 ATR away from the 20 SMA.Statistics Functions
Statistics functions compute descriptive stats over a rolling window of data. Essential for mean-reversion strategies and anomaly detection.
| Field | Type | Default | Description |
|---|---|---|---|
| Mean(x, N) | number | N=20 | Simple moving average of x over N bars. Equivalent to SMA when applied to Close. |
| Median(x, N) | number | N=20 | Middle value of x over N bars. More robust to outliers than Mean. |
| StdDev(x, N) | number | N=20 | Standard deviation of x over N bars. Measures spread/volatility. |
| Variance(x, N) | number | N=20 | StdDev squared. Useful in portfolio optimization calculations. |
| ZScore(x, N) | number | N=20 | (x - Mean) / StdDev. Values > 2 or < -2 are statistical outliers. |
| Percentile(x, N, P) | number | N=100, P=50 | The P-th percentile of x over N bars. P=90 gives the 90th percentile. |
| Correlation(x, y, N) | number | N=20 | Pearson correlation between x and y over N bars. Range: -1 to +1. |
| Skewness(x, N) | number | N=20 | Asymmetry of distribution. Positive = right tail, Negative = left tail. |
| Kurtosis(x, N) | number | N=20 | Tail heaviness. > 3 = fat tails (more extreme moves than normal). |
| LinRegSlope(x, N) | number | N=14 | Slope of linear regression line over N bars. Positive = uptrend. |
| LinRegIntercept(x, N) | number | N=14 | Y-intercept of the regression line. Used with slope for projections. |
| LinRegR2(x, N) | number | N=14 | R² (coefficient of determination). 0-1; higher = stronger trend fit. |
Price Variables
Price variables reference the current candle's OHLCV data plus common composite prices. Use bracket notation for historical bars: Close[1] = previous bar's close.
| Field | Type | Default | Description |
|---|---|---|---|
| Close | number | — | Current bar's closing price. Most commonly used price variable. |
| Open | number | — | Current bar's opening price. |
| High | number | — | Current bar's highest price. |
| Low | number | — | Current bar's lowest price. |
| Volume | number | — | Current bar's traded volume. |
| OHLC4 | number | — | (Open + High + Low + Close) / 4. Typical price averaged across all four. |
| HL2 | number | — | (High + Low) / 2. Midpoint of the bar's range. |
| HLC3 | number | — | (High + Low + Close) / 3. Typical price used in VWAP and other calculations. |
| Close[N] | number | — | Close price N bars ago. Close[1] = previous close, Close[5] = 5 bars ago. |
| Range | number | — | High - Low. The full range of the current candle. |
| Body | number | — | Abs(Close - Open). The absolute size of the candle body. |
| BarIndex | number | — | Sequential bar number from the start of loaded data. Useful for periodic conditions. |
Price Insights
- • OHLC4 vs HLC3 — OHLC4 includes Open, making it less reactive to close-biased strategies. HLC3 weights the close more.
- • Historical References — Use Close[1] for momentum (close > close[1] = rising). Use Close[N] for rate of change.
Volume & Range
- • Volume Confirmation — Combine Volume > Mean(Volume, 20) with price breakouts for confirmed moves.
- • Range Analysis — Range / ATR(14) > 2 identifies wide-range bars (potential trend days or reversals).
Date & Time Variables
DateTime variables let you add time-based filters to your strategy — avoiding volatile market open/close periods, filtering by day of week, or restricting trading to specific hours.
| Field | Type | Default | Description |
|---|---|---|---|
| HourOfDay | number | — | Current hour (0-23) in exchange timezone. HourOfDay >= 10 AND HourOfDay <= 14 for mid-session only. |
| MinuteOfHour | number | — | Current minute (0-59). Fine-grained intraday filtering. |
| DayOfWeek | number | — | 1 (Monday) through 7 (Sunday). DayOfWeek <= 5 for weekdays only. |
| DayOfMonth | number | — | 1-31. Useful for monthly expiry strategies (e.g. DayOfMonth >= 25). |
| Month | number | — | 1 (Jan) through 12 (Dec). Seasonal filtering. |
| MarketOpen | boolean | — | Returns 1 during the first 15 minutes of market session (9:15-9:30 IST for NSE). |
| MarketClose | boolean | — | Returns 1 during the last 15 minutes of session (15:15-15:30 IST for NSE). |
| IsPreMarket | boolean | — | 1 during pre-market session (if supported by exchange). |
| SessionMinutes | number | — | Minutes elapsed since market open. SessionMinutes > 30 = skip first 30 min. |
Custom Variables & Expressions
You can define custom variables by writing mathematical expressions that combine price data, indicators, and math functions. Custom expressions are evaluated per bar just like built-in variables.
Price & Candle
- • True Range — Max of (H-L), |H-PrevC|, |L-PrevC|. Foundation for ATR and Supertrend.
- • Body Ratio — Candle body as fraction of total range. Near 1 = strong move, near 0 = doji/indecision.
Momentum & Volume
- • Momentum Divergence — RSI(14) - RSI(28) shows short vs long-term momentum divergence.
- • Volume Spike — Volume / SMA(Volume) > 2 means current volume is 2x the average (institutional activity).
Trend & Volatility
- • Trend Strength — Regression slope normalized by deviation. Higher = stronger trend relative to noise.
- • Normalized ATR — ATR as percentage of price. Allows volatility comparison across different-priced instruments.
Indicators Reference
The Strategy Builder includes 100+ technical indicators across trend, momentum, volatility, volume, statistical, and mathematical categories. Each indicator can be used as a left or right operand in conditions, applied to chart overlays, and combined in custom formulas.
Trend Indicators
Trend indicators smooth price data to identify the direction of the market. Moving averages are the foundation — from simple (SMA) to exponential (EMA) to adaptive (KAMA). Advanced trend indicators like Supertrend, Parabolic SAR, and Ichimoku provide trend direction, support/resistance, and entry/exit signals.
| Field | Type | Default | Description |
|---|---|---|---|
| SMA | Simple Moving Average | period=14 | Arithmetic mean of closing prices over N periods. Smooth but lagging. Use SMA(50) and SMA(200) for trend direction. |
| EMA | Exponential Moving Average | period=14 | Weighted average giving more importance to recent prices. Reacts faster than SMA. Standard for MACD calculation. |
| WMA | Weighted Moving Average | period=14 | Linear weighting — most recent bar has highest weight. More responsive than SMA on trending data. |
| DEMA | Double EMA | period=14 | Applies EMA twice to reduce lag further. Formula: 2×EMA(N) − EMA(EMA(N)). Less smoothing, faster reaction. |
| TEMA | Triple EMA | period=14 | Three-layer EMA smoothing. Minimal lag while maintaining smoothness. Best for short-term trend detection. |
| HMA | Hull Moving Average | period=14 | Designed to eliminate lag almost entirely. Uses weighted moving average with square root weighting. Very fast but can be noisy. |
| KAMA | Kaufman Adaptive MA | p=10, fast=2, slow=30 | Adapts smoothing based on market noise. Fast in trending markets, slow in choppy markets. Self-adjusting period. |
| VWMA | Volume Weighted MA | period=14 | Weights price by volume — high-volume bars have more influence. Better trend identification in volume-driven markets. |
| Supertrend | ATR Trend | period=10, mult=3 | ATR-based trend indicator. Plots a line that flips above/below price on trend change. Green = uptrend, Red = downtrend. Popular for automated entries. |
| Parabolic SAR | Stop & Reverse | step=0.02, max=0.2 | Trailing dots above (downtrend) or below (uptrend) price. Accelerates as trend continues. Used as dynamic stop loss level. |
| Ichimoku | Cloud System | conv=9, base=26, span=52 | Multi-line indicator showing trend, momentum, support, and resistance. Components: Tenkan-Sen, Kijun-Sen, Senkou Span A/B (cloud), Chikou Span. |
| ADX | Average Directional Index | period=14 | Measures trend strength (0-100) regardless of direction. Above 25 = trending. Above 50 = strong trend. Below 20 = ranging/choppy. |
| DI+/DI- | Directional Indicators | period=14 | DI+ measures upward pressure, DI- measures downward. DI+ > DI- = bullish, DI+ < DI- = bearish. Use with ADX for trend strength + direction. |
Momentum Indicators
Momentum indicators measure the speed and magnitude of price changes. They oscillate between extremes (overbought/oversold) and are used for timing entries/exits within trends or for mean-reversion strategies.
| Field | Type | Default | Description |
|---|---|---|---|
| RSI | Relative Strength Index | period=14 | Oscillates 0-100. Above 70 = overbought (potential reversal down). Below 30 = oversold (potential reversal up). Standard: 14-period. Use crossesAbove 30 for buy signals. |
| MACD | Moving Avg Convergence Divergence | fast=12, slow=26, sig=9 | Difference between fast and slow EMA. Signal line is EMA of MACD. Histogram = MACD − Signal. Bull cross: MACD crossesAbove Signal. Bear cross: opposite. |
| Stochastic | Stochastic Oscillator | %K=14, %D=3 | %K oscillates 0-100 measuring close relative to high-low range. %D is smoothed %K. Above 80 = overbought. Below 20 = oversold. Cross signals between %K and %D. |
| CCI | Commodity Channel Index | period=14 | Measures price deviation from statistical mean. Above +100 = overbought. Below -100 = oversold. Zero crossings indicate trend changes. |
| Williams %R | Williams Percent Range | period=14 | Similar to Stochastic but inverted (-100 to 0). Above -20 = overbought. Below -80 = oversold. Fast-reacting momentum indicator. |
| ROC | Rate of Change | period=14 | Percentage change from N bars ago. ROC = (Close - Close[N]) / Close[N] × 100. Positive = upward momentum. Momentum divergences signal potential reversals. |
| MFI | Money Flow Index | period=14 | Volume-weighted RSI. Incorporates volume and price for more reliable overbought/oversold signals. Above 80 = overbought with volume confirmation. |
Volatility Indicators
| Field | Type | Default | Description |
|---|---|---|---|
| ATR | Average True Range | period=14 | Measures average price range including gaps. Higher ATR = more volatile. Used for dynamic stop loss (2× ATR), spread sizing, and position sizing. |
| Bollinger Bands | BB(period, stdDev) | period=20, std=2 | SMA ± N standard deviations. Upper = resistance, Lower = support, Width = volatility. Price touching lower band = potential bounce. Squeeze (narrow bands) = breakout imminent. |
| Keltner Channel | KC(period, mult) | period=20, mult=1.5 | EMA ± N × ATR. Similar to Bollinger but uses ATR (volatility) instead of standard deviation. More stable channel width. |
| Donchian Channel | DC(period) | period=20 | Highest high / Lowest low over N periods. Breakout above upper = bullish signal. Below lower = bearish. Classic trend-following channel. |
| NATR | Normalized ATR | period=14 | ATR expressed as a percentage of closing price. Allows comparison of volatility across different-priced instruments. |
Volume Indicators
| Field | Type | Default | Description |
|---|---|---|---|
| OBV | On-Balance Volume | — | Cumulative volume where up-days add volume and down-days subtract. Rising OBV with rising price confirms trend. Divergence warns of reversal. |
| VWAP | Volume-Weighted Avg Price | — | Average price weighted by volume since session start. Institutional benchmark — price above VWAP = bullish bias, below = bearish. |
| CMF | Chaikin Money Flow | period=20 | Measures accumulation/distribution pressure. Above 0 = buying pressure. Below 0 = selling pressure. Confirms price moves with volume. |
| AD Line | Accumulation/Distribution | — | Running total of money flow volume. Rising AD with rising price = strong uptrend. Divergence = potential reversal. |
Math & Statistics Functions
Beyond technical indicators, the builder provides mathematical and statistical functions for custom calculations:
Math Functions
- • abs(x)
- • sqrt(x)
- • log(x)
- • exp(x)
- • pow(x,n)
- • min(a,b)
- • max(a,b)
- • round(x,d)
- • ceil(x)
- • floor(x)
Statistics
- • Mean(N)
- • Median(N)
- • StdDev(N)
- • Variance(N)
- • ZScore(N)
- • Percentile(N,p)
- • Correlation(x,y)
- • LinReg Slope
- • Skewness
- • Kurtosis
Price Variables
- • Close
- • Open
- • High
- • Low
- • Volume
- • HL2 (H+L)/2
- • HLC3 (H+L+C)/3
- • OHLC4 (O+H+L+C)/4
DateTime Variables
- • Year
- • Month
- • Day
- • Hour
- • Minute
- • DayOfWeek
- • MarketOpen
- • MarketClose
- • HourOfDay
Custom Formulas
Write custom mathematical expressions using any combination of indicators, price data, and math functions. Custom formulas are evaluated on each bar and can be used as condition operands.
•
(high - low) / close * 100 — Bar range as % of close•
Math.abs(close - open) / (high - low) — Body-to-range ratio•
(RSI(14) + RSI(28)) / 2 — Multi-timeframe RSI averageIndicator Selection Guide
- Start with ONE primary indicator per condition — don't overcomplicate
- Use trend indicators (SMA/EMA/Supertrend) for direction confirmation
- Use momentum indicators (RSI/MACD) for timing and overbought/oversold levels
- Add volume indicators (OBV/VWAP) for trade confirmation
- Use ATR for dynamic stop loss and position sizing
- Avoid using multiple indicators from the same category (redundant signals)
- Test standard parameters first (RSI=14, SMA=50/200, ATR=14) before optimizing
- Maximum 2-3 indicators per signal to avoid overfitting
Advanced Topics
Deep dives into the Strategy Builder's architecture, DSL format, evaluation engine, performance optimization, and common pitfalls. Essential reading for power users building complex multi-signal strategies.
Strategy DSL Format
Every strategy serializes to a JSON-based DSL (Domain-Specific Language). The DSL captures the complete strategy configuration — from name and tags through every condition, indicator parameter, order setting, and risk limit. Understanding the DSL format enables advanced operations like programmatic strategy generation, version control, and cross-platform sharing.
Evaluator Engine
The Evaluator Engine is the core of strategy execution — both in backtesting and live trading. It processes candle data through condition groups, resolving indicators, applying comparisons, and computing boolean results.
Performance Optimization
For strategies processing large datasets or running on lower-end hardware, these optimizations improve backtest speed:
| Field | Type | Default | Description |
|---|---|---|---|
| Longer Timeframes | optimization | — | Use 15m instead of 1m — reduces candle count by 15×. A 1-year backtest on 1m has ~100K candles; on 15m it's ~7K. |
| Fewer Indicators | optimization | — | Each indicator calculates on every bar. 3 indicators = 3× computation. Use max 3-4 indicators per signal. |
| Shorter Date Ranges | optimization | — | Start with 6 months, validate, then extend to 2+ years for robustness. Don't run 10-year backtests during development. |
| Simpler Conditions | optimization | — | Deeply nested AND/OR groups with 10+ conditions slow evaluation. Keep condition trees flat — max 2 nesting levels. |
Common Pitfalls & Anti-Patterns
Overfitting
Adding many conditions tuned to specific historical patterns. The strategy performs perfectly in backtests but fails on new data. Fix: use fewer conditions (2-3), standard indicator parameters, and validate with forward testing.
No Exit Strategy
Deploying with entry signals only. Positions can remain open indefinitely, accumulating losses during adverse moves. Fix: always configure stop loss + either condition-based exit or take profit.
Survivorship Bias
Testing on instruments that exist today — survivors. Failed/delisted instruments are excluded, creating an optimistic bias. Fix: include a diverse set of instruments and time periods.
Look-Ahead Bias
Using future information in signals — e.g., referencing tomorrow's close in today's condition. The builder prevents most forms, but custom formulas can inadvertently introduce it. Fix: only reference current and past bar data.
Over-Leveraging
Using high leverage without proportional stop losses. A 10× leveraged position with a 2% adverse move = 20% portfolio loss. Fix: always size leverage relative to stop loss width.
Ignoring Commission/Slippage
Backtesting with zero commission and slippage. Results look great but evaporate in live trading. Fix: always set realistic commission (0.01-0.05%) and slippage (1-3 ticks).
Frequently Asked Questions
How many indicators can I use in a single condition?
Technically unlimited, but we recommend 2-3 per signal for optimal performance and to avoid overfitting. Each additional indicator increases computation time and curve-fitting risk.
Does the backtest engine handle partial fills?
No — the engine assumes complete fills at bar close price. Live trading with limit orders may experience partial fills. Use market orders for guaranteed fills, or add slippage buffer in backtest settings.
Can I use the same strategy on multiple instruments?
Yes — you can select multiple symbols in the Symbol step. The strategy evaluates each instrument independently with shared conditions but separate position tracking.
What happens if my broker disconnects during live trading?
The risk limits (stop loss, max daily loss) are monitored server-side. If the connection drops, pending stop loss orders already placed with the broker will still execute. The strategy pauses until reconnection.
Can I edit a strategy while it's running?
You can edit the draft version, but changes don't apply to running instances. Stop the execution, apply changes, and redeploy for the new configuration to take effect.
crossesAbove fires once — what if I need it to fire again?
The crossover resets after the values uncross (left goes below right again). The next time left crosses above right, the signal fires again. Use cooldownBars in re-entry settings to add minimum spacing between signals.