strategy-startup-guardrails
4
总安装量
4
周安装量
#52914
全站排名
安装命令
npx skills add https://github.com/sayujks0071/antidhan --skill strategy-startup-guardrails
Agent 安装分布
opencode
4
claude-code
4
codex
4
mcpjam
3
openhands
3
zencoder
3
Skill 文档
Strategy Startup Guardrails
Quick Checklist (before launch)
- Imports: avoid shadowing
time; usefrom datetime import time as dt_timeandimport time as time_modulefor timestamps. - Market hours helpers: call
dt_time(...), nottime(...)iftimeis a module. - Config/env: confirm
OPENALGO_APIKEY, broker creds, and host/port. - Data readiness: master contracts downloaded for required exchanges/symbols.
- History preflight: run one manual history request with real payload (see
history-payload-validator).
Fast Triage Steps
- Read the latest strategy log for the traceback.
- If
TypeError: 'module' object is not callable, search fortime(with a module import:
Ensure you callrg "import time" openalgo/strategies | head rg "time\\(" openalgo/strategies/scriptsdt_time(...)for market hours andtime_module.time()for timestamps. - If crash happens before first request, check missing env vars or config JSON.
- If crash is on history fetch, switch to
history-payload-validator. - Restart only after the above checks pass.
Safe Patterns
- Import pattern:
from datetime import time as dt_time import time as time_module # use dt_time(9, 15); use time_module.time() - Guard market hours:
if not is_market_open(): logger.info("Market closed; exiting") return - Validate dependencies at start: raise clear errors if env/config is missing.
Post-Fix Verification
- Rerun the strategy and ensure logs show:
- Startup banner
- Successful history fetch
- No immediate traceback within the first minute
- Keep tailing logs for 2â3 minutes after restart to confirm stability.