← Cookbook

✅ runnable

Recipe 05 — Pause / resume a strategy

Status: ✅ runnable SDK surface: client.strategies.pause(...), .resume(...), .stop(...) Server endpoint: PATCH /v1/strategies/{instance_id} with {"action": "pause"|"resume"|"stop"}

await client.strategies.pause("s_01HZ...", reason="market_volatility")
await client.strategies.resume("s_01HZ...")
await client.strategies.stop("s_01HZ...", reason="profit_target_hit")
await client.strategies.pause('s_01HZ...', 'market_volatility');
await client.strategies.resume('s_01HZ...');
await client.strategies.stop('s_01HZ...', 'profit_target_hit');

FSM rules per TZ-3 §4.8: only running strategies can be paused; only paused strategies can be resumed; stopped is terminal. Illegal transitions return 409 strategy-invalid-transition.

Source: cookbook/recipes/05-pause-resume-strategy/README.md