Appearance

Personalize your experience

Mode
Accent Color
Layout
Direction
Strategy Builder/Documentation
Strategy Builder v2.0

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.

Strategy Builder Architecture

┌─────────────────────────────────────────────────────────────────────────────┐
│                        STRATEGY BUILDER WIZARD (UI Layer)                    │
│                                                                             │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌──────────┐    │
│  │Particulars│  │ Settings │  │ Tagging  │  │  Symbol  │  │ Quantity │    │
│  │  Step 0   │  │  Step 1  │  │  Step 2  │  │  Step 3  │  │  Step 4  │    │
│  └─────┬─────┘  └─────┬────┘  └─────┬────┘  └─────┬────┘  └─────┬────┘    │
│        │              │              │              │              │         │
│  ┌─────┴─────┐  ┌─────┴────┐  ┌─────┴────┐  ┌─────┴──────────────┘         │
│  │   Entry   │  │   Exit   │  │ Backtest │  │    Review & Deploy           │
│  │  Step 5   │  │  Step 6  │  │  Step 7  │  │       Step 8                 │
│  └─────┬─────┘  └─────┬────┘  └─────┬────┘  └─────────────────────┘        │
│        │              │              │                                       │
│        └──────────────┴──────────────┘                                      │
│                       │                                                     │
├───────────────────────┼─────────────────────────────────────────────────────┤
│                       ▼                                                     │
│              ┌─────────────────┐                                            │
│              │  Zustand Store  │  ← Global state (900+ lines)              │
│              │ useStrategyStore│     All steps, chart, backtest state       │
│              └────────┬────────┘                                            │
│                       │                                                     │
├───────────────────────┼─────────────────────────────────────────────────────┤
│          SIGNAL EVALUATION ENGINE                                           │
│                       │                                                     │
│  ┌───────────┐  ┌─────┴───────┐  ┌────────────┐  ┌────────────────┐       │
│  │ Condition  │  │  Evaluator  │  │ Variables  │  │  Indicators    │       │
│  │  Builder   │──│  Engine     │──│  Resolver  │──│  Library (50+) │       │
│  └───────────┘  └─────┬───────┘  └────────────┘  └────────────────┘       │
│                       │                                                     │
├───────────────────────┼─────────────────────────────────────────────────────┤
│          BACKTEST ENGINE                                                    │
│                       │                                                     │
│  ┌───────────┐  ┌─────┴───────┐  ┌────────────┐  ┌────────────────┐       │
│  │ Position   │  │  Backtest   │  │  Metrics   │  │  Chart Viz     │       │
│  │ Manager    │──│  Runner     │──│ Calculator │──│ (Equity/DD/PnL)│       │
│  └───────────┘  └─────────────┘  └────────────┘  └────────────────┘       │
│                                                                             │
├─────────────────────────────────────────────────────────────────────────────┤
│          EXECUTION LAYER                                                    │
│                                                                             │
│  ┌───────────┐  ┌─────────────┐  ┌────────────┐  ┌────────────────┐       │
│  │  Paper     │  │   Live      │  │  Broker    │  │  Risk Limits   │       │
│  │ Trading    │  │  Executor   │  │  Adapters  │  │  & Breakers    │       │
│  └───────────┘  └─────────────┘  └────────────┘  └────────────────┘       │
└─────────────────────────────────────────────────────────────────────────────┘

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.

0

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.

namedescriptiontagsvisibilitystrategyIdmarketplace
1

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.

multipleEntriesmultipleExitsreEntryModespreadTypegapConnections
2

Tagging

Optional step to configure client order ID prefixes for tracking and reconciliation. Define signal tags, conditional tags, and order linking rules.

clientOrderIdPrefixcounterTemplatesignalTagsconditionalTagsorderLinking
3

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.

brokersubAssetTypesymbolstimeframesessionModesessionStartsessionEnd
4

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.

sizingModequantitycapitalmaxPositionsleverageentryAllocations
5

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.

conditionsorderentriesreEntrycooldownBarsmaxReEntries
6

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.

conditionsstopLosstakeProfitpartialExitsmaxDailyLossretryConfig
7

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.

startDateendDateinitialCapitalcommissionslippagetestingMode
8

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.

reviewSectionsdslExporthslViewerdeploypublish

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
Pro Tip: Use the Signal Presets feature in the Entry step to quickly load proven strategies like Golden Cross, Supertrend Buy, or RSI Oversold Bounce — then customize the parameters to your needs.

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.

FieldTypeDefaultDescription
name*stringThe 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'.
strategyIdstring (8 digits)Auto-generated 8-digit numeric ID derived from the name hash. Used for internal order tracking and references. Read-only.
Naming Convention: Use a pattern like [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.

FieldTypeDefaultDescription
descriptionstringFree-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.

FieldTypeDefaultDescription
tagsstring[][]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.
momentum
trend-following
mean-reversion
scalping
swing
breakout
grid
dca
intraday
positional
futures
options
equity
crypto

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.

FieldTypeDefaultDescription
access*"private" | "public""private"Visibility scope. Private: only you can see/use. Public: discoverable by other users in the platform.
marketplacebooleanfalseWhether to list this strategy on the Quatick Marketplace. Requires 'public' access. Other users can browse, copy, and adapt your strategy.
Privacy Notice: Publishing a strategy to the marketplace exposes its complete configuration — entry/exit signals, indicators, and parameters. Do not publish strategies containing proprietary logic you wish to keep secret.

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.

FieldTypeDefaultDescription
multipleEntriesbooleanfalseEnable 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.
multipleExitsbooleanfalseEnable 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.
When to use multiple entries: Grid trading (buy at interval levels), DCA (buy more as price drops), Pyramid (add to winning positions), or strategies with multiple independent entry signals (e.g., buy on RSI oversold AND on Supertrend flip).

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:

FieldTypeDefaultDescription
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.

Multi-Entry Strategy Comparison

GRID TRADING                    DCA (Dollar Cost Avg)           PYRAMID (Scale-In)

Price ▲                         Price ▲                         Price ▲
      │                               │                               │
  $110│ ── SELL ──────             $100│ ── ENTRY 1 ──             $120│ ── ENTRY 3 (add) ──
      │                               │                               │
  $105│ ── SELL ──────              $95│ ── SAFETY 1 ──            $115│ ── ENTRY 2 (add) ──
      │                               │                               │
  $100│ ── CENTER ────              $90│ ── SAFETY 2 ──            $110│ ── ENTRY 1 (base) ──
      │                               │                               │
   $95│ ── BUY ───────              $85│ ── SAFETY 3 ──                │
      │                               │                               │
   $90│ ── BUY ───────              $80│ ── SAFETY 4 ──                │
      │                               │ (increasing size)              │ (decreasing size)
──────┴────────── Time     ───────┴────────── Time      ──────┴────────── Time

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.

FieldTypeDefaultDescription
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.
spreadValuenumberThe spread amount. For 'fixed': absolute price units or percentage. For 'atr': multiplier of ATR value (e.g., 1.5 = 1.5 × ATR).
ATR-Based Spread: Using ATR adapts the grid spacing to market volatility. In volatile markets, levels space further apart (avoiding premature triggers); in calm markets, they tighten for more granular entries. ATR period is typically 14.

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.

FieldTypeDefaultDescription
gapConnectionsbooleanfalseWhen 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.

When to use Tagging: Skip this step for simple backtesting. Use it when deploying to live brokers where order tracking, deduplication, and reconciliation matter — especially for production strategies handling real capital.

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.

FieldTypeDefaultDescription
clientOrderIdPrefixstringBase 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'.
counterTemplatestringThe 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" | customNumber padding format for sequential counter. YYYY pads to 4 digits (0001-9999). MMDD uses date-based numbering. Custom allows arbitrary length.
Client Order ID Structure

Template:  {Prefix} - {OrderContext} - {Counter}

Prefix:        GC-NIFTY       (user-defined)
OrderContext:  LE              (Long Entry / LX=Long Exit / SE=Short Entry / SX=Short Exit)
Counter:       0001            (auto-increment, padded)

Result:        GC-NIFTY-LE-0001
Next order:    GC-NIFTY-LE-0002
Exit order:    GC-NIFTY-LX-0001

┌────────────────────────────────────────────────────┐
│  Prefix Segments                                    │
├────────────────────────────────────────────────────┤
│  I = Instrument    (NIFTY, BTCUSDT)                │
│  D = Direction     (B=Buy, S=Sell)                 │
│  B = Broker        (ZRD=Zerodha, BIN=Binance)      │
│  Context = LE/LX/SE/SX                             │
│  Counter = Sequential number                       │
└────────────────────────────────────────────────────┘

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.

FieldTypeDefaultDescription
LEcontext tagLong Entry — A buy order opening a new long position.
LXcontext tagLong Exit — A sell order closing an existing long position.
SEcontext tagShort Entry — A sell order opening a new short position.
SXcontext tagShort 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.

FieldTypeDefaultDescription
signalTagsRecord<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' }.
Quick Add Presets: Use the preset buttons to quickly add common tag patterns — Date-based tags (YYYYMMDD), sequence tags (SEQ-001), signal-based tags (SIG-RSI), or custom formats.

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 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.

FieldTypeDefaultDescription
autoOrderIdLinkingbooleanfalseAutomatically 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.

FieldTypeDefaultDescription
broker*stringThe 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.

FieldTypeDefaultDescription
subAssetType*stringThe 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.

FieldTypeDefaultDescription
symbols*Symbol[]Array of selected instruments. Each contains: symbol name, product type, and optionally expiry, strikeType, and strikeLevelOffset for derivatives.
symbol.symbol*stringThe instrument ticker — e.g., 'NIFTY', 'RELIANCE', 'BTCUSDT', 'BANKNIFTY'.
symbol.expirystringExpiry 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.strikeLevelOffsetnumber0Offset 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.

FieldTypeDefaultDescription
timeframe*stringCandle 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.
1m – 5m
Scalping

Very short-term, high frequency. Requires tight spreads and fast execution. More noise, more trades. Suitable for liquid instruments only.

15m – 1H
Intraday

Medium-term intraday trades. Good balance of signal quality and frequency. Most popular for day trading strategies.

4H – 1D
Swing Trading

Multi-day positions. Smoother signals, fewer false positives. Lower trade frequency but higher conviction per trade.

1W
Positional

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.

FieldTypeDefaultDescription
sessionMode*"continuous" | "intraday" | "positional"Trading session behavior. Continuous: 24/7 operation (crypto). Intraday: auto-square-off before session end. Positional: carry positions overnight.
sessionStartstring (HH:MM)Session start time for intraday mode. Auto-filled from exchange defaults — NSE: 09:15, MCX: 09:00, Crypto: N/A.
sessionEndstring (HH:MM)Session end time for intraday mode. Positions are force-closed before this time. NSE: 15:30, MCX: 23:30.
Session Mode Behavior

CONTINUOUS (24/7)              INTRADAY                        POSITIONAL

│ Active ─────────────│        │   09:15 ──── 15:30   │        │ Active ─────────────│
│ No session limits   │        │   ▲ Open    Close ▼   │        │ Positions carry over│
│ Crypto markets      │        │   │  Strategy   │     │        │ Multi-day holding   │
│ Always evaluating   │        │   │  evaluates  │     │        │ No auto square-off  │
│                     │        │   │  candles    │     │        │                     │
│ ─── 00:00 ── 24:00 │        │   │ Force exit │     │        │ ─── Day 1 ── Day N  │
│                     │        │   │  at 15:25  │     │        │                     │
│ No gaps             │        │   Gaps between│     │        │ Overnight gaps exist │
│                     │        │   sessions    │     │        │                     │
Intraday Auto Square-Off: In intraday mode, all open positions are automatically closed 5 minutes before session end. For NSE, this means positions close at 15:25 IST regardless of your exit conditions. Ensure your stop loss and take profit levels are tighter than the session boundary.

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:

FieldTypeDefaultDescription
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_value

Set 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_price

Size 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_price

Allocate 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

FieldTypeDefaultDescription
quantitynumberFor Fixed mode: the exact number of units per trade. For % of Capital: the percentage value (e.g., 5 for 5%).
capitalnumberTotal trading capital. Used as the base for percentage and risk-based calculations. Also sets the initial capital for backtesting.
leveragenumber1Leverage multiplier for Capital Per Position mode. 1 = no leverage, 5 = 5x leverage. Amplifies both gains and losses.
maxPositionsnumber1Maximum 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.
Leverage Warning: Leverage amplifies both profits and losses. A 5x leveraged position loses 5x faster. Always combine leverage with strict stop losses and position limits. The Risk-Based sizing mode automatically accounts for leverage in its calculations.

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.

FieldTypeDefaultDescription
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%.
multipleEntryModebooleanfalseEnable allocation editing. When false, all capital goes to a single entry set.
Capital Allocation — Multi-Entry Example

Total Capital: ₹10,00,000

┌─────────────────────────────────────────────────────────┐
│                                                          │
│  Entry Set 1 (RSI Oversold)          60% = ₹6,00,000   │
│  ████████████████████████████████████░░░░░░░░░░░░░░░░   │
│                                                          │
│  Entry Set 2 (MACD Bull Cross)       25% = ₹2,50,000   │
│  ███████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   │
│                                                          │
│  Entry Set 3 (Bollinger Bounce)      15% = ₹1,50,000   │
│  █████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   │
│                                                          │
│  Total                              100% = ₹10,00,000  │
└─────────────────────────────────────────────────────────┘

With Max Positions = 3:
  At most 3 positions can be open simultaneously.
  If all 3 entries fire, total exposure = ₹10,00,000.

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.

Signal Generation Architecture

┌─────────────────────────────────────────────────────────────────────┐
│                    SIGNAL EVALUATION PIPELINE                       │
├─────────────────────────────────────────────────────────────────────┤
│                                                                     │
│  ┌──────────────┐    ┌───────────────┐    ┌──────────────────┐     │
│  │  Market Data  │───▶│  Indicator    │───▶│  Condition       │     │
│  │  Feed (OHLCV) │    │  Calculator   │    │  Evaluator       │     │
│  └──────────────┘    └───────────────┘    └────────┬─────────┘     │
│                                                     │               │
│                                           ┌─────────▼──────────┐   │
│                                           │   Logic Combiner   │   │
│                                           │   (AND / OR / NOT) │   │
│                                           └─────────┬──────────┘   │
│                                                     │               │
│                              ┌───────────────────────┤               │
│                              │                       │               │
│                    ┌─────────▼──────┐    ┌──────────▼──────────┐   │
│                    │  Flow Control  │    │  Direct Signal      │   │
│                    │  if/elif/else  │    │  (no flow control)  │   │
│                    └─────────┬──────┘    └──────────┬──────────┘   │
│                              │                       │               │
│                              └───────────┬───────────┘               │
│                                          │                           │
│                              ┌───────────▼───────────┐              │
│                              │   Signal Dispatcher   │              │
│                              │   ┌─────────────────┐ │              │
│                              │   │ Dedup / Cooldown │ │              │
│                              │   │ Rate Limiter     │ │              │
│                              │   │ Session Filter   │ │              │
│                              │   └─────────────────┘ │              │
│                              └───────────┬───────────┘              │
│                                          │                           │
│                              ┌───────────▼───────────┐              │
│                              │   ORDER PLACEMENT     │              │
│                              │   Market / Limit      │              │
│                              └───────────────────────┘              │
└─────────────────────────────────────────────────────────────────────┘

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.

Condition Structure

┌──────────────────────────────────────────────────────────────┐
│                    CONDITION GROUP                            │
│                                                              │
│  ┌─────────────┐    ┌──────────────┐    ┌───────────────┐   │
│  │ LEFT OPERAND│    │   OPERATOR   │    │ RIGHT OPERAND │   │
│  │             │    │              │    │               │   │
│  │ Indicator   │ →  │  >  <  ==    │ →  │ Number        │   │
│  │ Price var   │    │  >= <= !=    │    │ Indicator     │   │
│  │ Custom expr │    │ crossesAbove │    │ Price var     │   │
│  │             │    │ crossesBelow │    │ Custom expr   │   │
│  └─────────────┘    └──────────────┘    └───────────────┘   │
│                                                              │
│  ┌──── AND / OR ────┐                                        │
│  │                  │                                        │
│  │  Condition 1  ───┤                                        │
│  │  Condition 2  ───┤  → All true (AND) or Any true (OR)    │
│  │  Condition 3  ───┤                                        │
│  │  [Nested Group]──┤                                        │
│  │                  │                                        │
│  └──────────────────┘                                        │
└──────────────────────────────────────────────────────────────┘
Condition evaluation order: Conditions within an AND group are evaluated left-to-right with short-circuit logic — if the first condition is false, remaining conditions are skipped. For OR groups, evaluation stops at the first true condition. Use this to put cheaper conditions (simple comparisons) before expensive ones (complex indicators).

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.

dsl
// Nested condition group example
AND {
  RSI(14)  crossesAbove  30               // Primary trigger
  OR {
    MACD(12,26,9)  crossesAbove  0        // Confirmation A
    Supertrend(10,3)  ==  "bullish"       // Confirmation B
  }
  Volume  >  Mean(Volume, 20) * 1.5       // Volume filter
  HourOfDay  >=  10                        // Time filter
  HourOfDay  <   15                        // Time filter
}
Signal Evaluation Per Bar (Step-by-Step)

  Bar N arrives (new candle close)
  │
  ├─1─ Update all indicator buffers (RSI, MACD, SMA, etc.)
  │    └─ Indicators compute on the full candle history
  │
  ├─2─ Evaluate each condition in the condition group
  │    ├─ Left operand = resolve indicator/variable value
  │    ├─ Right operand = resolve indicator/variable/constant
  │    └─ Apply operator (>, <, crossesAbove, etc.)
  │
  ├─3─ Combine results with AND/OR logic
  │    └─ Short-circuit: AND stops at first false, OR at first true
  │
  ├─4─ Apply flow control (if/elif/else) if configured
  │    └─ Evaluate blocks in order, first match wins
  │
  ├─5─ Check signal filters
  │    ├─ Cooldown: has enough time passed since last signal?
  │    ├─ Session: is the market in an active trading window?
  │    ├─ Max entries: has the position limit been reached?
  │    └─ Spread filter: is the bid-ask spread acceptable?
  │
  ├─6─ If all checks pass → EMIT SIGNAL
  │    └─ Signal includes: direction, timestamp, bar index, metadata
  │
  └─7─ Signal → Order placement engine
       └─ Market order or limit order per configuration

Comparison Operators

FieldTypeDefaultDescription
>comparisonGreater Than — True when left value exceeds right value. Re-evaluates every bar. Example: RSI(14) > 70 (overbought).
<comparisonLess Than — True when left value is below right value. Example: RSI(14) < 30 (oversold).
>=comparisonGreater Than or Equal — True when left value is at or above right value.
<=comparisonLess Than or Equal — True when left value is at or below right value.
==comparisonEqual — True when left and right values are exactly equal. Use with caution on floating-point indicator values.
!=comparisonNot Equal — True when left and right values differ.
crossesAbove*crossoverFires 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*crossoverFires 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.
Crossover vs. Comparison: Use 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.
Crossover Detection Logic

  crossesAbove Detection:
  ────────────────────────────────────────────────

  Bar N-1:  Left = 28   Right = 30   →  Left < Right  ✓ (below)
  Bar N:    Left = 32   Right = 30   →  Left >= Right ✓ (above)
  Result:   crossesAbove fires on Bar N ✅

  Bar N+1:  Left = 35   Right = 30   →  Still above, no previous "below"
  Result:   Does NOT fire again ❌ (not a new crossing)


  Practical Example — RSI(14) crossesAbove 30:
  ────────────────────────────────────────────────

  Bar 97:   RSI = 27.3  →  below 30
  Bar 98:   RSI = 29.1  →  still below 30
  Bar 99:   RSI = 31.8  →  crossed above 30  ← SIGNAL FIRES HERE
  Bar 100:  RSI = 34.2  →  still above 30    ← no signal
  Bar 101:  RSI = 28.5  →  back below 30
  Bar 102:  RSI = 32.1  →  crossed above 30  ← SIGNAL FIRES AGAIN

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.

Common Signal Patterns

  PATTERN 1: Trend Following + Momentum Confirmation
  ──────────────────────────────────────────────────
  AND {
    EMA(21)  >  EMA(55)                    ← Trend filter (uptrend)
    Close  crossesAbove  EMA(21)           ← Pullback entry trigger
    RSI(14)  >  40  AND  RSI(14)  <  70    ← Not oversold or overbought
    ADX(14)  >  20                         ← Trend has strength
  }
  Use case: Swing trading in trending markets

  PATTERN 2: Mean Reversion + Volatility Filter
  ──────────────────────────────────────────────────
  AND {
    RSI(14)  crossesAbove  30              ← Oversold bounce trigger
    Close  <  BB_Lower(20, 2)              ← Price at/below lower band
    ATR(14)  >  ATR(14)[20]               ← Volatility expanding
    Volume  >  Mean(Volume, 20) * 1.2     ← Volume confirmation
  }
  Use case: Counter-trend scalping in range-bound markets

  PATTERN 3: Breakout + Multi-Timeframe
  ──────────────────────────────────────────────────
  AND {
    Close  >  Max(High, 20)                ← Donchian breakout
    Volume  >  Mean(Volume, 20) * 2        ← Volume surge (2x average)
    MACD(12,26,9)  >  0                    ← Momentum aligned
    OR {
      ADX(14)  >  25                       ← Strong trend
      ATR(14) / Close * 100  >  2          ← Sufficient volatility
    }
  }
  Use case: Momentum breakout plays on higher timeframes

  PATTERN 4: Convergence (Triple Screen)
  ──────────────────────────────────────────────────
  AND {
    Supertrend(10,3)  ==  "bullish"        ← Screen 1: Trend
    MACD(12,26,9)  crossesAbove  0         ← Screen 2: Momentum
    Close  crossesAbove  EMA(9)            ← Screen 3: Timing
  }
  Use case: High-probability entries with multi-layer confirmation

When an entry condition fires, an order is placed with these parameters. The order side is automatically set based on the signal type.

FieldTypeDefaultDescription
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.
limitPricenumberRequired 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.

Multi-Entry Set Architecture

  ┌───────────────────────────────────────────────────┐
  │              MULTI-ENTRY DISPATCHER                │
  ├───────────────────────────────────────────────────┤
  │                                                    │
  │  ┌──────────────────┐  ┌──────────────────┐       │
  │  │ Entry Set A      │  │ Entry Set B      │       │
  │  │ "RSI Oversold"   │  │ "MACD Cross"     │       │
  │  │                  │  │                  │       │
  │  │ RSI(14) < 30     │  │ MACD crossesAbove│       │
  │  │ AND Close < BB   │  │ Signal AND       │       │
  │  │ AND Volume > avg │  │ ADX > 20         │       │
  │  └────────┬─────────┘  └────────┬─────────┘       │
  │           │ true?               │ true?            │
  │           ▼                     ▼                  │
  │  ┌──────────────────────────────────────┐          │
  │  │       SIGNAL MERGER                  │          │
  │  │  First set to fire wins (priority)   │          │
  │  │  or ALL can fire (independent mode)  │          │
  │  └──────────────────┬───────────────────┘          │
  │                     │                              │
  │                     ▼                              │
  │          ORDER PLACEMENT ENGINE                    │
  └───────────────────────────────────────────────────┘
FieldTypeDefaultDescription
entriesEntrySet[]Array of entry configurations. Each contains: id, label, conditions (ConditionGroup), and order configuration.
entry.labelstringHuman-readable label — e.g., 'RSI Oversold', 'MACD Cross'. Appears in backtest trade logs.
entry.prioritynumber0When 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.

FieldTypeDefaultDescription
reEntry.enabledbooleanfalseEnable re-entry logic.
reEntry.mode"cooldown" | "grid" | "dca" | "pyramid"Re-entry trigger behavior.
reEntry.cooldownBarsnumber5Minimum bars between consecutive entries.
reEntry.maxReEntriesnumber3Total re-entries allowed before position must close.
reEntry.distanceFromEntrynumberMinimum price distance from first entry.
reEntry.distanceType"fixed" | "percentage" | "atr""percentage"Fixed: absolute price. Percentage: % move. ATR: multiples of ATR.
reEntry.spreadFilternumberMaximum bid/ask spread for re-entry orders.
Re-Entry Strategies Visualized

GRID RE-ENTRY                              DCA RE-ENTRY

Entry @ $100                               Entry @ $100
  │                                          │
  ├── Level 1: Buy @ $97  (−3%)             ├── Safety Order 1: Buy @ $95  (−5%)
  │   Qty: 100 units                         │   Qty: 150 units (1.5× base)
  │                                          │
  ├── Level 2: Buy @ $94  (−6%)             ├── Safety Order 2: Buy @ $90  (−10%)
  │   Qty: 100 units                         │   Qty: 225 units (1.5× prev)
  │                                          │
  ├── Level 3: Buy @ $91  (−9%)             ├── Safety Order 3: Buy @ $83  (−17%)
  │   Qty: 100 units                         │   Qty: 338 units (1.5× prev)
  │                                          │
  Total: 400 units, Avg: $95.50              Total: 813 units, Avg: $90.28

PYRAMID RE-ENTRY                           COOLDOWN RE-ENTRY

Entry @ $100                               Entry @ Bar 0
  │                                          │
  ├── Add @ $105  (+5%)                     ├── Re-entry: Bar 10 (cooldown=10)
  │   Qty: 75 units (75% of base)            │
  │                                          ├── Re-entry: Bar 25 (cooldown=10)
  ├── Add @ $110  (+10%)                     │
  │   Qty: 50 units (50% of base)            ├── Max re-entries reached (max=3)
  │                                          │
  Total: 225 units, Avg: $104.44             Total: 3 entries over 25 bars

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 30

Mean 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.

Flow Control Evaluation

  ┌───────────────────────────────────────────────────┐
  │            FLOW CONTROL EVALUATOR                  │
  ├───────────────────────────────────────────────────┤
  │                                                    │
  │  if (ADX > 25 AND Supertrend == "bullish") {       │
  │    → Entry Type: TREND_FOLLOW                      │
  │    → Use: Close crossesAbove EMA(21)               │
  │  }                                                 │
  │                                                    │
  │  elif (RSI < 30 AND Close < BB_Lower) {            │
  │    → Entry Type: MEAN_REVERSION                    │
  │    → Use: RSI crossesAbove 30                      │
  │  }                                                 │
  │                                                    │
  │  elif (Volume > Mean(Vol,20)*3 AND Range > 2*ATR) {│
  │    → Entry Type: BREAKOUT                          │
  │    → Use: Close > Max(High, 20)                    │
  │  }                                                 │
  │                                                    │
  │  else {                                            │
  │    → No entry (wait for clearer signal)            │
  │  }                                                 │
  │                                                    │
  │  First matching block's action is used.            │
  │  If no blocks match → no signal emitted.           │
  └───────────────────────────────────────────────────┘
dsl
// Flow control DSL example — adaptive strategy
flow {
  if (ADX(14) > 25) {
    // Trending market — use trend-following entry
    entry: EMA(9) crossesAbove EMA(21) AND RSI(14) > 40
    type: "trend_follow"
  }
  elif (BB_Width(20,2) < Percentile(BB_Width, 100, 10)) {
    // Low volatility squeeze — use breakout entry
    entry: Close > BB_Upper(20,2) AND Volume > Mean(Volume, 20) * 2
    type: "breakout"
  }
  else {
    // Range-bound — use mean reversion
    entry: RSI(14) crossesAbove 30 AND Close < BB_Lower(20,2)
    type: "mean_reversion"
  }
}

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.
Chart Preview: As you build conditions, the chart panel shows entry signal arrows in real-time on historical data. Green up-arrows for long entries, red down-arrows for short entries. This immediate visual feedback helps you tune parameters without running a full backtest.

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.

Critical Rule: Never deploy a strategy without an exit plan. Entry-only strategies can get stuck in losing positions indefinitely. Always configure at least a Stop Loss — condition-based exits and take profit are strongly recommended additions.

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.

FieldTypeDefaultDescription
conditionsConditionGroupThe exit condition tree. Same structure as entry conditions — indicators, comparisons, AND/OR logic. Example: SMA(50) crossesBelow SMA(200) for a trend reversal exit.
orderOrderConfigExit 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:

FieldTypeDefaultDescription
stopLoss.enabledbooleanfalseToggle 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*numberStop 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.trailingbooleanfalseEnable trailing stop. The SL follows price as it moves favorably, locking in profits. Never moves backwards (against favorable direction).
stopLoss.trailingAmountnumberDistance 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.
Stop Loss Types Comparison

PERCENTAGE STOP LOSS                    ATR-BASED STOP LOSS

Entry @ $100, SL = 2%                  Entry @ $100, SL = 2 × ATR
                                        (ATR(14) = $3.50, SL = $7)
Price ▲                                 Price ▲
  $105│                                   $105│
  $100│ ── ENTRY ──────                   $100│ ── ENTRY ──────
      │                                       │
   $98│ ── STOP LOSS ── (−2%)              $93│ ── STOP LOSS ── (2×ATR)
      │  Max loss: $2/share                   │  Max loss: $7/share
      │                                       │  (adapts to volatility)

TRAILING STOP LOSS (2% trail)

Price ▲
  $115│ ── Peak reached
  $113│ ── TRAIL SL moves up (2% below $115)
  $110│ ── (was here when price at $112)
  $108│ ── (was here when price at $110)
  $100│ ── ENTRY
   $98│ ── Initial SL (2% below entry)

  Timeline: SL ratchets UP as price rises, NEVER moves down.
  Exit triggers when price drops to current SL level.
ATR-Based Stop Loss: Using ATR automatically adapts your stop distance to market volatility. In volatile stocks, the stop is wider (avoiding premature exits); in calm markets, it's tighter (cutting losses faster). The standard ATR period is 14. A multiplier of 2-3× ATR typically provides the best balance of protection and breathing room.

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.

FieldTypeDefaultDescription
takeProfit.enabledbooleanfalseEnable 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*numberTP 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.
Risk:Reward Ratio: With SL = 2% and RR = 3, the TP is set at 6% profit. A 3:1 risk-reward means each winning trade earns 3× what each losing trade costs. With this ratio, you only need a 25%+ win rate to be profitable.

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.

FieldTypeDefaultDescription
partialExitsPartialExit[]Array of partial exit levels. Each level specifies what percentage of the position to close and at what target.
partialExit.percent*numberPercentage 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*numberThe 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.
Partial Exit Example — 3-Level Exit Strategy

Entry @ $100, SL @ $98 (2%), Position: 100 shares

┌────────────────────────────────────────────────────────────┐
│  Level 3: Sell 30% @ +6% ($106)     ← Remaining 30 shares │
│  ───────────────────────────────                           │
│  Level 2: Sell 30% @ +4% ($104)     ← Sell 30 shares      │
│  ───────────────────────────────                           │
│  Level 1: Sell 40% @ +2% ($102)     ← Sell 40 shares      │
│  ═══════════════════════════════                           │
│  ENTRY @ $100 (100 shares)                                 │
│  ───────────────────────────────                           │
│  STOP LOSS @ $98 (−2%)             ← All remaining shares │
└────────────────────────────────────────────────────────────┘

Timeline:
  Bar 5:  Price hits $102 → Sell 40 shares (+$80 profit locked)
  Bar 12: Price hits $104 → Sell 30 shares (+$120 profit locked)
  Bar 20: Price hits $106 → Sell 30 shares (+$180 profit locked)
  Total profit if all levels hit: $380

  If price reverses at $103 → SL hits on remaining 60 shares
  Profit: 40 × $2 = $80 locked − 60 × $2 = $120 loss = −$40 net
  (vs. −$200 without partial exits)

Portfolio Risk Limits

FieldTypeDefaultDescription
maxDailyLossnumberMaximum 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.
maxOpenPositionsnumberMaximum 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:

FieldTypeDefaultDescription
retryMaxAttemptsnumber3Maximum number of retry attempts before alerting and pausing.
retryDelayBarsnumber1Number 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.

FieldTypeDefaultDescription
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*numberStarting capital for the simulation. Affects position size calculations for % of Capital and Risk-Based sizing modes.
commissionnumber0Commission per trade as a percentage. Example: 0.03 = 0.03% per trade. Applied to both entry and exit orders.
slippagenumber0Expected slippage in ticks/points. Models the difference between expected and actual fill price. Higher for illiquid instruments.
Backtest Limitations: The engine uses bar close prices for signal evaluation — intra-bar price movement is not simulated. This means stop losses and take profits may trigger at slightly different prices than in live trading. Always add a slippage buffer to account for this. The engine does NOT model: partial fills, order queue priority, or broker-specific order routing delays.

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
FieldTypeDefaultDescription
totalPnlnumberAbsolute profit/loss in currency units. The bottom line — how much the strategy made or lost over the test period.
totalPnlPercentnumberP&L as a percentage of initial capital. A 10% return on ₹10,00,000 = ₹1,00,000 profit.
winRatenumberPercentage of winning trades. A 55% win rate with a 2:1 risk-reward ratio is already highly profitable.
profitFactornumberGross profit / Gross loss. Values > 1.5 indicate a robust strategy. Value of 1 = break-even. Below 1 = unprofitable.
maxDrawdownnumberLargest peak-to-trough decline in equity. Measures the worst-case capital erosion. Target < 20% for conservative strategies.
sharpeRationumberRisk-adjusted return metric. (Return − Risk-Free Rate) / Standard Deviation of Returns. Above 1 = good, above 2 = excellent.
sortinoRationumberLike Sharpe but only penalizes downside volatility. Better for strategies with asymmetric returns (large wins, small losses).
calmarRationumberAnnualized 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.

FieldTypeDefaultDescription
trainTestSplitnumber70Percentage of data used for training. The remaining percentage is the test set. Example: 70 = first 70% for training, last 30% for testing.
walkForwardWindowsnumber1Number of walk-forward windows. Multiple windows provide more robust out-of-sample validation. Each window uses a different train/test boundary.
Walk-Forward Analysis

SINGLE WINDOW (70/30 split):

┌──────────────────────────────────┬──────────────────┐
│        TRAINING (70%)            │   TESTING (30%)   │
│  Optimize strategy on this data  │ Validate on this  │
│  ────────────────────────────    │ ──────────────    │
│  2020-01      →      2023-06    │ 2023-07 → 2024-12 │
└──────────────────────────────────┴──────────────────┘

MULTI-WINDOW (3 windows):

Window 1: ┌──── TRAIN ────┬── TEST ──┐
Window 2:     ┌──── TRAIN ────┬── TEST ──┐
Window 3:         ┌──── TRAIN ────┬── TEST ──┐

INTERPRETATION:
  Train P&L: +25%    Test P&L: +22%    → ROBUST (consistent)
  Train P&L: +45%    Test P&L: −5%     → OVERFITTED (discard/simplify)
  Train P&L: +15%    Test P&L: +18%    → ROBUST (test even better)
Overfitting Red Flags: (1) Test performance is significantly worse than training. (2) Strategy uses many conditions (5+) custom-tuned to specific parameter values. (3) Backtest shows perfect performance with very few trades. (4) Results degrade when you shift the date range by a few months. Simplify your conditions and use standard indicator parameters to avoid overfitting.

Real-Time Execution

Switch from backtesting to real-time mode to execute the strategy on live market data. Two sub-modes are available:

FieldTypeDefaultDescription
Paper TradingmodeSimulated 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 TradingmodeReal order execution via broker APIs. Orders are sent to your connected broker account with real capital. Requires valid broker credentials and sufficient account balance.
Recommended Workflow: Backtest → Forward Test → Paper Trade (1-2 weeks minimum) → Live Trade (small position size) → Scale Up. Never skip to live trading directly from a backtest.

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.

FieldTypeDefaultDescription
Copy DSLactionCopies the full strategy JSON to your clipboard for pasting into files or sharing.
View HSLactionOpens the HSL Viewer Modal with a human-readable plain-text representation of your strategy logic. Useful for review and documentation.
Export as FileactionDownloads the strategy as a .json file to your local machine.
Import DSLactionLoads a previously exported strategy JSON file, populating all wizard steps with the imported configuration.
json
{
  "name": "Golden Cross NIFTY",
  "strategyId": "48291035",
  "description": "Long-term trend following using SMA crossovers",
  "tags": ["trend-following", "equity", "intraday"],
  "symbol": {
    "broker": "zerodha",
    "symbols": [{ "symbol": "NIFTY", "productType": "futures" }],
    "timeframe": "15m",
    "sessionMode": "intraday"
  },
  "quantity": {
    "mode": "fixed",
    "quantity": 1,
    "maxPositions": 1
  },
  "entry": {
    "conditions": {
      "operator": "AND",
      "conditions": [
        { "left": "SMA(50)", "op": "crossesAbove", "right": "SMA(200)" },
        { "left": "RSI(14)", "op": ">", "right": 30 }
      ]
    }
  },
  "exit": {
    "stopLoss": { "type": "percentage", "value": 2, "trailing": true },
    "takeProfit": { "type": "riskReward", "value": 3 }
  }
}

Deployment Options

FieldTypeDefaultDescription
Deploy to PaperactionStart 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 LiveactionConnect 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 DraftactionSave current configuration without deploying. Continue editing later from the Saved Strategies panel.
Publish to MarketplaceactionList 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.

Variable Resolution Pipeline
┌──────────────┐    ┌─────────────────┐    ┌────────────────┐
│  Raw Candle   │───▶│  Variable Expr   │───▶│  Resolved Value │
│  OHLCV data   │    │  e.g. RSI(14)    │    │  e.g. 68.42     │
└──────────────┘    └─────────────────┘    └────────────────┘
                            │
                    ┌───────┴───────┐
                    │               │
              ┌─────┴─────┐  ┌─────┴─────┐
              │ Indicator  │  │  Math/Stat │
              │ (live calc)│  │ (derived)  │
              └───────────┘  └───────────┘

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.

FieldTypeDefaultDescription
Abs(x)numberAbsolute value. Abs(-5) = 5. Useful for distance calculations.
Max(x, N)numberN=14Maximum value of x over the last N bars. Max(High, 20) = 20-bar high.
Min(x, N)numberN=14Minimum value of x over the last N bars. Min(Low, 20) = 20-bar low.
Round(x, D)numberD=2Round x to D decimal places. Round(3.14159, 2) = 3.14.
Ceil(x)numberRound up to nearest integer. Ceil(3.2) = 4.
Floor(x)numberRound down to nearest integer. Floor(3.9) = 3.
Log(x)numberNatural logarithm (base e). Log returns for normalization.
Log10(x)numberBase-10 logarithm. Useful for orders of magnitude.
Sqrt(x)numberSquare root. Sqrt(Variance) = StdDev.
Exp(x)numberEuler's number raised to x. Inverse of Log().
Pow(x, N)numberN=2x raised to power N. Pow(StdDev, 2) = Variance.
Sign(x)numberReturns -1 if negative, 0 if zero, 1 if positive. Sign(MACD) for direction.
Mod(x, N)numberModulo — remainder after division. Mod(BarIndex, 5) for periodic logic.
Clamp(x, lo, hi)numberRestricts x to range [lo, hi]. Values outside are pinned to boundaries.
Composing math functions: You can nest math inside conditions. For example, Abs(Close - SMA(20)) > 2 * ATR(14) checks if price is more than 2 ATR away from the 20 SMA.
dsl
// Math function examples in conditions
Abs(Close - EMA(21))  >  ATR(14) * 1.5     // Breakout detection
Log(Close / Close[1]) >  0.02              // 2% log return filter
Max(High, 50)  ==  High                    // New 50-bar high
Min(Low, 20)   ==  Low                     // New 20-bar low
Sqrt(Variance(Close, 20))  >  2.5          // High volatility filter

Statistics Functions

Statistics functions compute descriptive stats over a rolling window of data. Essential for mean-reversion strategies and anomaly detection.

FieldTypeDefaultDescription
Mean(x, N)numberN=20Simple moving average of x over N bars. Equivalent to SMA when applied to Close.
Median(x, N)numberN=20Middle value of x over N bars. More robust to outliers than Mean.
StdDev(x, N)numberN=20Standard deviation of x over N bars. Measures spread/volatility.
Variance(x, N)numberN=20StdDev squared. Useful in portfolio optimization calculations.
ZScore(x, N)numberN=20(x - Mean) / StdDev. Values > 2 or < -2 are statistical outliers.
Percentile(x, N, P)numberN=100, P=50The P-th percentile of x over N bars. P=90 gives the 90th percentile.
Correlation(x, y, N)numberN=20Pearson correlation between x and y over N bars. Range: -1 to +1.
Skewness(x, N)numberN=20Asymmetry of distribution. Positive = right tail, Negative = left tail.
Kurtosis(x, N)numberN=20Tail heaviness. > 3 = fat tails (more extreme moves than normal).
LinRegSlope(x, N)numberN=14Slope of linear regression line over N bars. Positive = uptrend.
LinRegIntercept(x, N)numberN=14Y-intercept of the regression line. Used with slope for projections.
LinRegR2(x, N)numberN=14R² (coefficient of determination). 0-1; higher = stronger trend fit.
Z-Score Mean-Reversion Strategy Flow
               ┌──────────────────────────┐
               │  Compute ZScore(Close,20) │
               └─────────┬────────────────┘
                         │
              ┌──────────┴──────────┐
              ▼                     ▼
    ZScore < -2.0           ZScore > +2.0
    ┌──────────────┐       ┌──────────────┐
    │  BUY signal  │       │  SELL signal  │
    │  (oversold)  │       │  (overbought) │
    └──────────────┘       └──────────────┘
              │                     │
              └─────────┬──────────┘
                        ▼
              ┌──────────────────┐
              │  Exit when ZScore │
              │  returns to 0    │
              └──────────────────┘
Lookback window matters: A short N (e.g. 10) makes statistics reactive but noisy. A long N (e.g. 100) is smoother but slower to reflect regime changes. Match the window to your trading timeframe.

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.

FieldTypeDefaultDescription
ClosenumberCurrent bar's closing price. Most commonly used price variable.
OpennumberCurrent bar's opening price.
HighnumberCurrent bar's highest price.
LownumberCurrent bar's lowest price.
VolumenumberCurrent bar's traded volume.
OHLC4number(Open + High + Low + Close) / 4. Typical price averaged across all four.
HL2number(High + Low) / 2. Midpoint of the bar's range.
HLC3number(High + Low + Close) / 3. Typical price used in VWAP and other calculations.
Close[N]numberClose price N bars ago. Close[1] = previous close, Close[5] = 5 bars ago.
RangenumberHigh - Low. The full range of the current candle.
BodynumberAbs(Close - Open). The absolute size of the candle body.
BarIndexnumberSequential 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.

FieldTypeDefaultDescription
HourOfDaynumberCurrent hour (0-23) in exchange timezone. HourOfDay >= 10 AND HourOfDay <= 14 for mid-session only.
MinuteOfHournumberCurrent minute (0-59). Fine-grained intraday filtering.
DayOfWeeknumber1 (Monday) through 7 (Sunday). DayOfWeek <= 5 for weekdays only.
DayOfMonthnumber1-31. Useful for monthly expiry strategies (e.g. DayOfMonth >= 25).
Monthnumber1 (Jan) through 12 (Dec). Seasonal filtering.
MarketOpenbooleanReturns 1 during the first 15 minutes of market session (9:15-9:30 IST for NSE).
MarketClosebooleanReturns 1 during the last 15 minutes of session (15:15-15:30 IST for NSE).
IsPreMarketboolean1 during pre-market session (if supported by exchange).
SessionMinutesnumberMinutes elapsed since market open. SessionMinutes > 30 = skip first 30 min.
Time-Filtered Strategy Example
  ┌─────────────────────────────────────────────────┐
  │             MARKET SESSION TIMELINE              │
  ├────────┬──────────────────────────┬──────────────┤
  │ 9:15   │     TRADING WINDOW       │  15:15       │
  │ Open   │   10:00 ──── 14:30       │  Close       │
  │ ░░░░░░ │ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ │ ░░░░░░░░░░░ │
  │ SKIP   │   ACTIVE SIGNALS ONLY    │  EXIT ALL    │
  └────────┴──────────────────────────┴──────────────┘

  Conditions:
  ├─ HourOfDay >= 10 AND HourOfDay < 15  → Allow entry
  ├─ MarketClose == 1                    → Force exit
  └─ DayOfWeek <= 5                      → Weekdays only
Timezone handling: All DateTime variables use the exchange's local timezone. For NSE: IST (UTC+5:30). For Binance crypto: UTC. Ensure your conditions match the instrument's exchange timezone.

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.

dsl
// Custom variable expressions
TrueRange    = Max(High - Low, Max(Abs(High - Close[1]), Abs(Low - Close[1])))
BodyRatio    = Abs(Close - Open) / (High - Low + 0.0001)
MomentumDiff = RSI(14) - RSI(28)
VolSpike     = Volume / Mean(Volume, 20)
TrendStrength = LinRegSlope(Close, 20) / StdDev(Close, 20)
NormalizedATR = ATR(14) / Close * 100

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.

FieldTypeDefaultDescription
SMASimple Moving Averageperiod=14Arithmetic mean of closing prices over N periods. Smooth but lagging. Use SMA(50) and SMA(200) for trend direction.
EMAExponential Moving Averageperiod=14Weighted average giving more importance to recent prices. Reacts faster than SMA. Standard for MACD calculation.
WMAWeighted Moving Averageperiod=14Linear weighting — most recent bar has highest weight. More responsive than SMA on trending data.
DEMADouble EMAperiod=14Applies EMA twice to reduce lag further. Formula: 2×EMA(N) − EMA(EMA(N)). Less smoothing, faster reaction.
TEMATriple EMAperiod=14Three-layer EMA smoothing. Minimal lag while maintaining smoothness. Best for short-term trend detection.
HMAHull Moving Averageperiod=14Designed to eliminate lag almost entirely. Uses weighted moving average with square root weighting. Very fast but can be noisy.
KAMAKaufman Adaptive MAp=10, fast=2, slow=30Adapts smoothing based on market noise. Fast in trending markets, slow in choppy markets. Self-adjusting period.
VWMAVolume Weighted MAperiod=14Weights price by volume — high-volume bars have more influence. Better trend identification in volume-driven markets.
SupertrendATR Trendperiod=10, mult=3ATR-based trend indicator. Plots a line that flips above/below price on trend change. Green = uptrend, Red = downtrend. Popular for automated entries.
Parabolic SARStop & Reversestep=0.02, max=0.2Trailing dots above (downtrend) or below (uptrend) price. Accelerates as trend continues. Used as dynamic stop loss level.
IchimokuCloud Systemconv=9, base=26, span=52Multi-line indicator showing trend, momentum, support, and resistance. Components: Tenkan-Sen, Kijun-Sen, Senkou Span A/B (cloud), Chikou Span.
ADXAverage Directional Indexperiod=14Measures trend strength (0-100) regardless of direction. Above 25 = trending. Above 50 = strong trend. Below 20 = ranging/choppy.
DI+/DI-Directional Indicatorsperiod=14DI+ 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.

FieldTypeDefaultDescription
RSIRelative Strength Indexperiod=14Oscillates 0-100. Above 70 = overbought (potential reversal down). Below 30 = oversold (potential reversal up). Standard: 14-period. Use crossesAbove 30 for buy signals.
MACDMoving Avg Convergence Divergencefast=12, slow=26, sig=9Difference between fast and slow EMA. Signal line is EMA of MACD. Histogram = MACD − Signal. Bull cross: MACD crossesAbove Signal. Bear cross: opposite.
StochasticStochastic 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.
CCICommodity Channel Indexperiod=14Measures price deviation from statistical mean. Above +100 = overbought. Below -100 = oversold. Zero crossings indicate trend changes.
Williams %RWilliams Percent Rangeperiod=14Similar to Stochastic but inverted (-100 to 0). Above -20 = overbought. Below -80 = oversold. Fast-reacting momentum indicator.
ROCRate of Changeperiod=14Percentage change from N bars ago. ROC = (Close - Close[N]) / Close[N] × 100. Positive = upward momentum. Momentum divergences signal potential reversals.
MFIMoney Flow Indexperiod=14Volume-weighted RSI. Incorporates volume and price for more reliable overbought/oversold signals. Above 80 = overbought with volume confirmation.

Volatility Indicators

FieldTypeDefaultDescription
ATRAverage True Rangeperiod=14Measures average price range including gaps. Higher ATR = more volatile. Used for dynamic stop loss (2× ATR), spread sizing, and position sizing.
Bollinger BandsBB(period, stdDev)period=20, std=2SMA ± N standard deviations. Upper = resistance, Lower = support, Width = volatility. Price touching lower band = potential bounce. Squeeze (narrow bands) = breakout imminent.
Keltner ChannelKC(period, mult)period=20, mult=1.5EMA ± N × ATR. Similar to Bollinger but uses ATR (volatility) instead of standard deviation. More stable channel width.
Donchian ChannelDC(period)period=20Highest high / Lowest low over N periods. Breakout above upper = bullish signal. Below lower = bearish. Classic trend-following channel.
NATRNormalized ATRperiod=14ATR expressed as a percentage of closing price. Allows comparison of volatility across different-priced instruments.

Volume Indicators

FieldTypeDefaultDescription
OBVOn-Balance VolumeCumulative volume where up-days add volume and down-days subtract. Rising OBV with rising price confirms trend. Divergence warns of reversal.
VWAPVolume-Weighted Avg PriceAverage price weighted by volume since session start. Institutional benchmark — price above VWAP = bullish bias, below = bearish.
CMFChaikin Money Flowperiod=20Measures accumulation/distribution pressure. Above 0 = buying pressure. Below 0 = selling pressure. Confirms price moves with volume.
AD LineAccumulation/DistributionRunning 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.

Formula Examples:
(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 average

Indicator 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.

json
{
  "version": "2.0",
  "meta": {
    "name": "Supertrend Scalper",
    "strategyId": "92841635",
    "description": "5-minute Supertrend with RSI filter",
    "tags": ["scalping", "trend-following", "intraday"],
    "access": "private"
  },
  "symbol": {
    "broker": "zerodha",
    "subAssetType": "stock",
    "symbols": [
      { "symbol": "NIFTY", "productType": "futures", "expiry": "2026-04-30" }
    ],
    "timeframe": "5m",
    "sessionMode": "intraday",
    "sessionStart": "09:15",
    "sessionEnd": "15:30"
  },
  "quantity": {
    "mode": "percentOfCapital",
    "percent": 5,
    "capital": 1000000,
    "maxPositions": 2
  },
  "entry": {
    "signals": [
      {
        "id": "sig-001",
        "label": "Supertrend Flip + RSI",
        "conditions": {
          "operator": "AND",
          "children": [
            {
              "left": { "type": "indicator", "name": "Supertrend", "params": { "period": 10, "multiplier": 3 } },
              "op": "crossesBelow",
              "right": { "type": "price", "name": "Close" }
            },
            {
              "left": { "type": "indicator", "name": "RSI", "params": { "period": 14 } },
              "op": ">",
              "right": { "type": "constant", "value": 30 }
            }
          ]
        },
        "order": { "type": "market", "side": "buy", "tif": "day" }
      }
    ],
    "reEntry": {
      "enabled": true,
      "mode": "cooldown",
      "cooldownBars": 10,
      "maxReEntries": 2
    }
  },
  "exit": {
    "signals": [
      {
        "id": "exit-001",
        "conditions": {
          "operator": "OR",
          "children": [
            {
              "left": { "type": "indicator", "name": "Supertrend", "params": { "period": 10, "multiplier": 3 } },
              "op": "crossesAbove",
              "right": { "type": "price", "name": "Close" }
            }
          ]
        }
      }
    ],
    "stopLoss": { "enabled": true, "type": "atr", "value": 2, "trailing": true, "trailingType": "percentage", "trailingAmount": 1 },
    "takeProfit": { "enabled": true, "type": "riskReward", "value": 3 },
    "partialExits": [
      { "percent": 50, "targetType": "rr", "targetValue": 1.5 },
      { "percent": 50, "targetType": "rr", "targetValue": 3 }
    ],
    "maxDailyLoss": 3
  }
}

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.

Evaluator Processing Pipeline

For each candle bar:
┌─────────────┐     ┌────────────────┐     ┌──────────────────┐
│  Raw Candle  │ ──► │   Indicator    │ ──► │    Condition     │
│  OHLCV data  │     │   Calculator   │     │    Evaluator     │
│              │     │   SMA, RSI...  │     │   Left op Right  │
└─────────────┘     └────────────────┘     └──────────────────┘
                                                     │
                                                     ▼
                                            ┌──────────────────┐
                                            │   Boolean Logic  │
                                            │   AND / OR tree  │
                                            │   Nested groups  │
                                            └──────────────────┘
                                                     │
                                        ┌────────────┴────────────┐
                                        ▼                         ▼
                               ┌──────────────┐         ┌──────────────┐
                               │ Signal TRUE  │         │ Signal FALSE │
                               │ → Place order│         │ → No action  │
                               │ → Check SL/TP│         │ → Check SL/TP│
                               └──────────────┘         └──────────────┘

Crossover Detection (crossesAbove):
  Bar N-1: Left < Right  (below)
  Bar N:   Left >= Right (above)  ← FIRE signal on this bar only

State Machine:
  IDLE → [condition true] → POSITION_OPEN → [exit true] → IDLE
  POSITION_OPEN → [SL hit] → IDLE
  POSITION_OPEN → [TP hit] → IDLE

Performance Optimization

For strategies processing large datasets or running on lower-end hardware, these optimizations improve backtest speed:

FieldTypeDefaultDescription
Longer TimeframesoptimizationUse 15m instead of 1m — reduces candle count by 15×. A 1-year backtest on 1m has ~100K candles; on 15m it's ~7K.
Fewer IndicatorsoptimizationEach indicator calculates on every bar. 3 indicators = 3× computation. Use max 3-4 indicators per signal.
Shorter Date RangesoptimizationStart with 6 months, validate, then extend to 2+ years for robustness. Don't run 10-year backtests during development.
Simpler ConditionsoptimizationDeeply 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.