SeekAlgo/Docs/Platform Settings
Docs/Platform Settings

Platform Settings

How script settings control backtest dates, order sizing, commission, slippage, resolution, and execution defaults.

Platform Settings

For strategy scripts, the script({...}) block is not just metadata. It is the public settings surface the platform uses for validation and backtest defaults.

When these values are defined in the script, they are the source of truth for that script run.

Typical Strategy Header

script({
  type: 'strategy',
  priceStudy: true,
  initialCapital: 100000,
  orderSize: 50,
  orderType: 'poe',
  commission: 0.05,
  commissionType: 'per',
  slippage: 0,
  marketType: 'crypto',
  startDate: '2026-01-20',
  endDate: '2026-03-15',
  resolution: '15',
  tradeBelowCash: false,
});

Setting Reference

Setting What it controls Valid values
type Whether the script is only visual or fully backtestable 'indicator', 'strategy'
priceStudy Whether plots sit on the main chart true, false
initialCapital Starting capital for the backtest positive number
orderSize Default position size used when qty is omitted from strategy.entry() positive number
orderType How orderSize should be interpreted 'con', 'cur', 'poe', 'non'
commission Commission amount used by the engine number
commissionType How commission is applied 'non', 'per', 'cpo', 'cpc'
slippage Per-trade slippage number
marketType Market assumptions and validation 'crypto', 'equity'
startDate Backtest start date 'YYYY-MM-DD'
endDate Backtest end date 'YYYY-MM-DD'
resolution Bar timeframe for the run '1', '5', '15', '30', '60', '1D', '1W', '1M'
tradeBelowCash Whether the strategy can trade beyond available cash true, false

Order Size Modes

Code Meaning
'con' Fixed contracts or units
'cur' Size by currency amount
'poe' Size by percent of equity
'non' No sizing mode override

Quantity Override Behavior

orderSize is the default quantity for strategy entries.

  • if strategy.entry() omits qty, the engine uses orderSize together with orderType
  • if strategy.entry() sets qty, that explicit quantity overrides the script default
  • strategy.default_qty_value, strategy.default_qty_type, and strategy.initial_capital expose those header values inside the script
  • strategy.default_qty_value is the raw configured value, so for cur and poe sizing you should omit qty when you want settings-driven sizing
script({ type: 'strategy', priceStudy: true, orderSize: 5, orderType: 'con' });

strategy.entry({ id: 'default_trade', type: 'long' });
strategy.entry({ id: 'override_trade', type: 'long', qty: 2 });

Commission Modes

Code Meaning
'non' No commission
'per' Percentage commission
'cpo' Commission per order
'cpc' Commission per contract

Public Workflow

  1. Define the script type and whether it overlays the price chart.
  2. Set the backtest window with startDate, endDate, and resolution.
  3. Choose portfolio behavior with initialCapital, orderSize, and orderType.
  4. Add realistic execution costs with commission, commissionType, and slippage.
  5. Only then move into the signal logic.

Common Setup Patterns

Indicator Only

script({
  type: 'indicator',
  priceStudy: true,
});

Simple Strategy

script({
  type: 'strategy',
  priceStudy: true,
  initialCapital: 100000,
  orderSize: 1,
  orderType: 'con',
  commission: 0,
  commissionType: 'non',
  slippage: 0,
  marketType: 'crypto',
  resolution: '5',
  tradeBelowCash: true,
});

Basket Strategy

Basket strategies use the same script({...}) settings block. The basket itself is declared separately with symbols([...]).

Common Mistakes

  • using invalid date formats instead of YYYY-MM-DD
  • forgetting that endDate must be after startDate
  • changing orderType without changing how orderSize should be interpreted
  • assuming explicit qty is added on top of orderSize instead of overriding it
  • leaving commission and slippage at unrealistic values
  • mixing platform settings into multiple script(...) blocks

Next Reading