TradingCharts

What it does

zigzag(len) returns alternating swing highs and lows. It extends the latest swing when a more extreme pivot of the same type appears, and flags new and extended swings so users can draw lines.

marketStructure(len) returns a trend state of 1, -1 or 0, the last two swing highs and lows, and break-of-structure flags.

fibLevel(start, end, ratio) returns a retracement price.

swingRangePct(start, end) returns the size of a swing in percent.

How to use it

  • Open the charts and go to Indicators › My scripts › Shared with me (or search the Community library) and press Add to chart.
  • The code is protected by the author: the script runs on the chart with the source hidden.

Version history

  • v1 — 20 Nov, 12:33 pm · compiler 0.3.69

#swing