pitchfan
Draws a Pitchfan: three-point “fan” lines derived from a pitchfork idea (one center point and two side points). It gives you angled rails that follow trend direction, useful for spotting dynamic support/resistance and pullback zones as price moves.
Syntax
pitchfan(originPoint, leftFanPoint, rightFanPoint, styles?)
Parameters
originPoint(PricedData) · The center/handle of the fan (time & price). Example:newPoint(time(60), closeC(60)).leftFanPoint(PricedData) · Sets one side of the fan and helps define slope. Example:newPoint(time(40), high(40)).rightFanPoint(PricedData) · Sets the other side of the fan and overall opening. Example:newPoint(time(20), low(20)).styles(PitchFanLineToolOverrides) · Visual and level options (enable only what you need):fillBackground(boolean) · Fill area between selected rays.transparency(number) · Background transparency (0–100).median(LinesLevels withoutcoeff) · Default line look (e.g.,visible,linestyle,linewidth,color).level0 … level8(LinesLevels) · Per-ray options:coeff(number) · set the coeff.visible(boolean) · Show this ray.color(RGBAColor | BaseColors) · Line color (e.g.,color.blueorcolor.rgba(0,0,255,1)).linestyle(number) · 0=solid, 1=dotted, 2=dashed…linewidth(number) · Line width.
Return Value
(string) The drawing ID of the created Pitchfan (store it if you’ll update or remove it later).
Example
Small demo: every 40 candles we drop a pitchfan aligned to recent structure. We define a single style object to keep everything tidy and reusable.
Result

Tips
Use meaningful pivots (clear swing highs/lows) for
leftFanPointandrightFanPointso the rays align with the real trend.If the view feels busy, enable only 2–3 rays (
level*) and hide the rest (visible: false) to keep focus.Combine with a trend filter (e.g., moving average slope) so you only draw fans in trending conditions.
Warning
Don’t pass malformed points (missing time or price). Always create anchors with newPoint(time(offset), priceValue); otherwise nothing will be drawn.
Last updated