Skip to content
All library documents

Pivot Entries and Weekly Strategy Returns Versus a Benchmark

Article Strategy library · Author: MUQWISHI

Summary

This open-source script pairs a pivot-based trading system with a table-oriented method for tracking weekly and yearly returns against a benchmark. It identifies pivot highs and lows using configurable left and right bar counts, retains the latest pivot levels, and places stop entries just beyond those levels for long and short positions. The performance section compounds bar-by-bar changes in strategy equity and benchmark price into period returns. Inputs allow the user to choose the benchmark symbol or use the chart symbol, set a start date, and control whether benchmark returns or relative alpha are displayed.

The page provides implementation details rather than a research evaluation: no actual return table, comparison results, or risk statistics are included in the supplied text. The script specifies a percentage-of-equity position size and commission assumption, but these settings alone do not establish realistic execution. Pivot confirmation depends on later bars, and stop orders can be affected by gaps, liquidity, and fill assumptions. The return calculations and date boundaries should also be checked against the chart timeframe and calendar handling before relying on the resulting comparison.

Key ideas

  • The strategy places stop entries just above recent pivot highs and below recent pivot lows.
  • Pivot detection uses configurable bars on the left and right of a candidate turning point.
  • Weekly and yearly returns are compounded from successive changes in strategy equity and benchmark price.
  • The benchmark can be the chart symbol or a separately selected market symbol.
  • The supplied excerpt shows methodology and settings, but no realized comparison results or risk measures.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.