Documentation · Strategy Development
From idea to execution.
The strategy contract, execution modes, and risk configuration used by the platform.
Signal contract
A strategy receives a pandas DataFrame indexed by time and returns buy/sell boolean series or signal events. The same strategy object is used for backtesting and execution.
def on_bar(df, params):
close = df["close"]
fast = close.ewm(span=params["fast"]).mean()
slow = close.ewm(span=params["slow"]).mean()
buy = (fast > slow) & (fast.shift(1) <= slow.shift(1))
sell = (fast < slow) & (fast.shift(1) >= slow.shift(1))
return {"buy": buy, "sell": sell}
Execution modes
- Market — immediate execution at the next available price.
- Maker-rest — place a limit order at a configured offset and wait for a pullback.
- Maker-then-market — attempt maker execution, then fall back to market within the configured window.
Risk configuration
- Stop-loss and take-profit as price percentages
- Trailing activation and trailing distance
- Breakeven trigger
- Circuit breaker after abnormal volatility
- Per-strategy exposure and leverage limits
Backtest assumptions
Backtests include commissions, slippage, and optional funding. Results are simulations; live behavior differs with liquidity, latency, partial fills, and exchange outages. Always compare paper results with backtest expectations before increasing size.
Paper-to-live checklist
- Strategy has a documented edge and defined invalidation
- Backtest includes realistic costs and drawdown
- Paper trading matches the expected trade frequency
- Stop-loss, trailing, and max-loss limits are tested
- Exchange keys are trade-only and IP-restricted
- Monitoring and an independent exit plan are in place
