/tradecraft:market-structure-bos-chochfrom tradecraft
Identifies Break of Structure (BOS), Change of Character (CHoCH), and valid swing points using candle-close validation (Jonathan Jarvis method). Works on any asset and timeframe for SMC/ICT market structure analysis.
Ships in tradecraft. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Source: "Master Market Structure Anywhere (In 5 Seconds)" — Jonathan Jarvis (Mar 2026)
A fully mechanical system for identifying valid swing highs/lows that removes subjectivity. Works identically across any asset (Forex, crypto, indices) and any timeframe (Monthly to 1-minute).
Bullish structure — finding valid highs:
Bearish structure — finding valid lows:
Identifying current swing points:
| Event | Definition | Marking |
|---|---|---|
| BOS | Price breaks a valid high/low in the same trend direction (continuation) | Solid line |
| CHoCH | First BOS that reverses direction (bullish → bearish or vice versa) | Dashed line |
| 2nd BOS | Second break in the new direction after CHoCH — typically more profitable | Solid line |
After CHoCH: Switch your validation method:
The same candle-close logic applies identically on all timeframes:
Use multi-TF confluence: align monthly bias → weekly structure → 4H entries.
import pandas as pd, numpy as np
class CandleCloseStructure:
"""Mechanical structure mapping via candle-close validation (Jonathan Jarvis method).
A valid high requires a candle closing below the previous candle's low after an up-move.
A valid low requires a candle closing above the previous candle's high after a down-move.
"""
@staticmethod
def find_valid_swings(df: pd.DataFrame) -> dict:
closes = df["close"].values
highs = df["high"].values
lows = df["low"].values
valid_highs, valid_lows = [], []
trend = "bullish" # start assumption
for i in range(1, len(df)):
if trend == "bullish":
# Look for close below previous candle's low → creates valid high
if closes[i] < lows[i - 1]:
# Valid high = highest point before this close-down
lookback = highs[:i + 1]
peak_idx = int(np.argmax(lookback[max(0, i - 20):i]) + max(0, i - 20))
valid_highs.append({"idx": peak_idx, "price": float(highs[peak_idx]),
"confirmed_at": i})
else:
# Look for close above previous candle's high → creates valid low
if closes[i] > highs[i - 1]:
lookback = lows[:i + 1]
trough_idx = int(np.argmin(lookback[max(0, i - 20):i]) + max(0, i - 20))
valid_lows.append({"idx": trough_idx, "price": float(lows[trough_idx]),
"confirmed_at": i})
# Detect BOS/CHoCH to switch trend
if valid_highs and trend == "bullish":
if closes[i] < valid_lows[-1]["price"] if valid_lows else False:
trend = "bearish"
elif valid_lows and trend == "bearish":
if closes[i] > valid_highs[-1]["price"] if valid_highs else False:
trend = "bullish"
return {"valid_highs": valid_highs[-5:], "valid_lows": valid_lows[-5:], "current_trend": trend}
import pandas as pd, numpy as np
from scipy.signal import argrelextrema
class MarketStructure:
@staticmethod
def analyze(df: pd.DataFrame, order: int = 5) -> dict:
highs = argrelextrema(df["high"].values, np.greater, order=order)[0]
lows = argrelextrema(df["low"].values, np.less, order=order)[0]
swing_highs = [(int(i), df["high"].iloc[i]) for i in highs]
swing_lows = [(int(i), df["low"].iloc[i]) for i in lows]
events = []
# Detect BOS and CHoCH
for i in range(1, len(swing_highs)):
if swing_highs[i][1] > swing_highs[i-1][1]:
events.append({"type": "BOS_BULLISH", "idx": swing_highs[i][0], "price": round(swing_highs[i][1], 5),
"meaning": "Break of Structure UP — bullish continuation"})
for i in range(1, len(swing_lows)):
if swing_lows[i][1] < swing_lows[i-1][1]:
events.append({"type": "BOS_BEARISH", "idx": swing_lows[i][0], "price": round(swing_lows[i][1], 5),
"meaning": "Break of Structure DOWN — bearish continuation"})
# CHoCH: trend change
for i in range(1, min(len(swing_highs), len(swing_lows))):
if i < len(swing_highs) and i < len(swing_lows):
prev_trend_up = swing_highs[i-1][1] > swing_highs[max(0,i-2)][1] if i >= 2 else True
curr_break_down = swing_lows[i][1] < swing_lows[i-1][1]
if prev_trend_up and curr_break_down:
events.append({"type": "CHoCH_BEARISH", "idx": swing_lows[i][0], "price": round(swing_lows[i][1], 5),
"meaning": "Change of Character — trend shifting bearish"})
# Current structure
if len(swing_highs) >= 2 and len(swing_lows) >= 2:
hh = swing_highs[-1][1] > swing_highs[-2][1]
hl = swing_lows[-1][1] > swing_lows[-2][1]
lh = swing_highs[-1][1] < swing_highs[-2][1]
ll = swing_lows[-1][1] < swing_lows[-2][1]
structure = "BULLISH (HH+HL)" if hh and hl else "BEARISH (LH+LL)" if lh and ll else "TRANSITIONING"
else:
structure = "INSUFFICIENT DATA"
return {
"current_structure": structure,
"swing_highs": swing_highs[-5:],
"swing_lows": swing_lows[-5:],
"recent_events": sorted(events, key=lambda e: e["idx"])[-5:],
"latest_event": events[-1] if events else None,
}
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub mahmoud20138/tradecraft --plugin tradecraft169 skills in this plugin
/agent-developmentThis skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins./agentic-storageAgentic storage architecture — persistent memory for AI agents using MCP, immutable versioning, sandboxing, and intent validation. Covers the stateless problem in LLM agents, RAG limitations (read-only), MCP protocol (JSON-RPC, resources, tools), storage safety layers, and agent file system design. Source: IBM Technology (Martin Keen), March 2026. Use this skill for "agentic storage", "agent memory", "persistent agent state", "MCP storage", "agent file system", "agent hard drive", "stateless agent problem", "agent work product", "immutable versioning", "agent sandboxing", "intent validation", "agent safety layers", "agent context window limits", "storage for AI agents", "agent persistence", "autonomous agent storage", "agent audit trail". Works with mcp-integration, trading-brain, agents, trade-psychology-coach.
/ai-agent-builderExpert guide for building AI-powered coding agents that produce professional-quality output. Trigger whenever the user asks to build an AI agent, coding assistant, automation pipeline, tool-using LLM system, or says "agent", "agentic", "tool use", "function calling", "LLM pipeline", "AI workflow", "coding bot", or "autonomous AI". Covers agent architecture, tool design, skill loading, prompt engineering, context management, evaluation loops, and multi-step orchestration using the Claude API or any LLM API./ai-signal-aggregatorML-powered signal aggregation across ALL strategy skills — combines signals from every strategy using weighted voting, random forest meta-learner, and confidence calibration. THE MASTER SIGNAL COMBINER. Use for "combine all signals", "aggregate strategies", "meta strategy", "AI signal", "ensemble signal", "which signal to follow", "best signal now", "combine everything", "master signal", "AI recommendation", or any request to synthesize signals from multiple skills. This is the intelligence layer ABOVE trading-brain.
/ai-trading-crewAI Trading Crew — 50-agent AutoGen system for US stock analysis. 8 specialized teams (Technical, Fundamental, Macro, Sentiment, Quant, Risk, Execution, Strategy) reporting to a Head Coach supervisor. Risk team has veto power. Devil's Advocate agent f/alternative-data-integratorAlternative data sources for trading signals — Google Trends, web traffic, search volume, shipping/supply chain data, satellite imagery proxies, and economic nowcasting. Use this skill whenever the user asks about "alternative data", "Google Trends trading", "search trends", "web traffic signals", "nowcasting", "satellite data trading", "shipping index", "Baltic Dry", "unusual data sources", "non-traditional indicators", "big data trading signals", or any request to incorporate non-standard data into trading decisions. Works with trading-data-science for feature engineering and trading-brain for signal integration.
Other plugins' skills for the same job