Dynamic Plot Style Support
Category: market_structure
A demonstration script showing the use of dynamic (variable-based) plot styles in Pine Script, where the visual representation changes based on price conditions.
Formula
\text{style} = \begin{cases} \text{ternaryStyle} & \text{bar\_index} \pmod 2 \\ \text{ifStyle} & \text{close} \geq \text{open} \\ \text{switchStyle} & \text{high} > \text{high}[1] \end{cases} \implies \text{plot}(\text{price}, \text{style})
Inputs
- boundedStyle (default: plot.style_line)
See signal primitives, usage in published strategies and more on WOBR StrategyVerse.