insidePitchfork

Draw a classic Pitchfork (Inside) using three anchors: a main pivot and two side points. It’s great for spotting trend paths, bounce zones, and where price might “walk” inside the three rails (upper, median, lower). Think of it as a guided channel with a centerline to keep you oriented.

Syntax

insidePitchfork(pivot, left, right, styles?)

Parameters

  • pivot: The main anchor of the pitchfork. Build it with newPoint(time, price).

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

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

  • styles (optional) Visual options you can pass as an object:

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

    • medianColor: color for the center (median) line

    • linewidth: thickness of lines

    • linestyle: solid, dashed, dotted

    • showLabel: show a small label if the tool supports it

    • textcolor: color of the label text

Return Value

  • string — Unique drawing id so you can later update or delete the pitchfork.

Example

This script draws one inside pitchfork every 24 candles to keep the chart tidy. We pick three meaningful pivots: a main pivot (older swing), and two side points (more recent swings). Lots of comments are included for clarity.

Result

Tips

  • Use obvious swing points for pivot, left, and right. The cleaner the anchors, the more meaningful the fork.

  • Try mixing high/low combinations that reflect the current trend direction (e.g., low→high→low in an uptrend).

  • If you want the fork to adjust over time without clutter, save the returned id once and call updateDrawingById(id, [pivot, left, right]) instead of creating new ones.

Warning

Good Practice

Last updated