HA Straddle & Strangle Signals v7 AutoThis indicator is a **Heikin‑Ashi volatility‑based straddle/strangle helper** that automatically adapts its parameters to your current chart timeframe. It is designed to tell you *when* to open and close a long‑volatility options position and to visualize the approximate upper and lower legs on the price chart. (www.tradingview.com)
## Core functionality
- Uses **Heikin‑Ashi candles** from either the chart timeframe or a user‑selected timeframe (via `ticker.heikinashi()` and `request.security`).
- Computes **ATR on the HA series** and compares each candle’s range (`high − low`) to ATR.
- **Entry condition:**
- You are not already “in trade”.
- Current HA range is above an ATR‑multiple threshold (volatility expansion).
- At least N bars have passed since the last signal.
- **Exit condition:**
- You are “in trade”.
- Current HA range falls below another ATR‑multiple threshold (volatility contraction).
This makes it a **pure volatility regime detector** on HA candles: blue shaded zones mark periods where volatility is high and you would typically hold a long straddle/strangle; unshaded zones are low‑volatility periods where you stand aside or manage existing options separately.
## Auto‑adaptive settings
The script reads `timeframe.period` (the chart’s resolution string) and maps it to a preset configuration table. For your specific custom timeframes (45m, 75m, 96m, 182m, 5h, 7h) it automatically sets: (stackoverflow.com)
- **ATR length** (shorter on 45m, longer on 5h/7h).
- **ENTRY ATR multiple** (lower on fast charts to catch rallies earlier, higher on slow charts to filter noise).
- **EXIT ATR multiple** (slightly lower than ENTRY so you stay in trends until volatility genuinely cools).
- **Minimum bars between signals** (more bars on higher‑timeframe charts to avoid over‑trading).
On any other timeframe it falls back to a reasonable default set.
## Straddle/strangle leg visualization
- At each ENTRY, it calculates **upper and lower leg prices**:
- **Straddle mode:** both legs at the entry close (ATM level).
- **Strangle mode:** legs offset above and below entry by `strangle_atr_mult × HA ATR`.
- It then draws **two horizontal lines** (red for upper, green for lower) extending right across the chart while the trade is active.
- When an EXIT occurs, both lines are deleted and stored prices are reset.
This doesn’t price actual options, but it gives you a **visual band** where your CE and PE would sit, useful for quickly seeing where the underlying is trading relative to your combined position.
## Signals and shading
- **ENTRY markers:** green triangles below the bar. These are your “open straddle/strangle now” prompts.
- **EXIT markers:** red triangles above the bar. These are “close/adjust the straddle/strangle” prompts.
- **Background shading:** while `in_trade` is true, the chart background is lightly shaded blue, so you can see at a glance which parts of the trend were captured by the strategy.
You can attach TradingView alerts to the ENTRY and EXIT conditions to receive push/email/webhook notifications when new zones start or end.
## Typical use workflow
1. Add the indicator to your symbol.
2. Leave **Heikin Ashi timeframe = Chart**, so it auto‑adapts to whichever of your custom TFs (45/75/96/182m, 5h, 7h) you select.
3. When a blue zone begins with an ENTRY marker:
- Open your **long straddle** (ATM CE + ATM PE) or **long strangle** (chosen OTM strikes) in your broker.
4. While blue shading continues, manage the options (trailing, partial profit).
5. When an EXIT marker appears and shading ends:
- Close or significantly reduce the position—volatility is contracting and theta decay will dominate.
## When it works best (and limitations)
- Works best on **trending or strongly expanding volatility phases**—it will highlight those moves clearly and keep you in until volatility cools.
- On **very choppy, range‑bound markets**, you will see more frequent ENTRY/EXIT pairs; you can mitigate this by increasing the ENTRY multiple or ATR length for that timeframe.
- It does not use price patterns, oscillators, or option greeks; it’s purposely narrow: **HA + ATR + timeframe‑aware thresholds**, leaving strike selection and risk management to you.
If you tell me one timeframe/symbol where you still feel entries or exits are off, I can suggest specific tweaks to that row of the auto‑mapping (e.g., bump ENTRY from 0.9 to 1.1 only for 96‑minute charts).
مؤشر Pine Script®






















