pitchfork

The pitchfork tool is like planting three stakes (points) on the chart and stretching three rails from them: an upper line, a median line, and a lower line. It’s a classic way to visualize trend paths, balance zones, and possible support/resistance.

Imagine it as a “fork” guiding price: the middle tine (median line) shows the main trend, while the upper and lower tines help you see where price might bounce or stall.

Syntax

pitchfork(pivot, left, right, styles?)

Parameters

  • pivot: The handle of the fork, usually the main swing pivot. Build with newPoint(time, price).

  • left: The left tine anchor (first side point). Also built with newPoint(time, price).

  • right: The right tine anchor (second side point). Same builder: newPoint(time, price).

  • styles (optional) Visual customizations:

    • linecolor: color of the fork lines (e.g., color.red)

    • median: customize the center line style (color, thickness)

    • linewidth: thickness of lines

    • linestyle: solid, dashed, dotted

    • extendLines: extend lines beyond anchors

    • fillBackground: add shaded area if supported

Return Value

  • string — A unique drawing id you can use to update or delete the pitchfork.

Example

This script creates a red pitchfork every 28 candles, using clear swing points for the anchors.

You’ll see a red pitchfork with three rails: upper, median, and lower, helping to frame price action.

Result

Tips

  • Use clear pivots (major highs/lows) so the pitchfork rails are meaningful.

  • The median line often acts as a “magnet” for price. Watch how candles interact with it.

  • Adjust extendLines if you want the rails to continue into the future.

Warning

Good Practice

Last updated