Barrier Touch
workflow.run_barrier_touchProbability that the price touches a barrier (a target or a stop level) at ANY time within N days, under geometric Brownian motion (reflection principle with drift). This is not the probability of finishing beyond the level at expiry: at zero log-drift a touch is exactly twice as likely as a finish, and finishBeyondProbabilityPct is returned next to it for comparison (the end-of-window question itself is workflow.run_window_fair_value). Barrier above spot gives an up-touch, below spot a down-touch. Monitoring is continuous (every instant, not daily closes or candle highs, which touch less often); year is 365 days; driftPct is the annualized expected price drift, default 0. Output: touchProbabilityPct, finishBeyondProbabilityPct, direction, barrierDistancePct. Edge cases: spot, barrier and daysToExpiry (at most 3650) above zero; volatilityPct 0.01 to 1000; driftPct -1000 to 1000; barrier and spot must be within a factor of about 5e8 of each other. Not covered: a discrete-monitored barrier, knock-in or knock-out option prices, jumps, volatility that changes over time, trading costs; the probability is under a constant volatility and drift.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"spot": "<spot>",
"barrier": "<barrier>",
"daysToExpiry": "<daysToExpiry>",
"volatilityPct": "<volatilityPct>"
},
"name": "workflow.run_barrier_touch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spot | Yes | Current price, USD (any quote currency) | |
| barrier | Yes | The level to touch, same units as spot. Above spot: up-touch; below spot: down-touch | |
| driftPct | No | Annualized expected price drift in percentage points. Default 0. | |
| daysToExpiry | Yes | Calendar days in the window (can be fractional, up to 3650) | |
| volatilityPct | Yes | Annualized volatility in percentage points (e.g. 60 for 60%), at least 0.01 |