Skip to content
All library documents

Weekly Strategy Returns Table with RSI Crossover Trades

Article Strategy library · Author: algobar

Summary

This Pine Script example pairs a simple RSI trading rule with a table of weekly strategy performance. It calculates a seven-period RSI and opens long positions when RSI crosses above 70, or short positions when it crosses below 30. Trade activity is limited to a user-selected date window, and the strategy specifies percentage-of-equity sizing and a commission assumption. The script tracks changes in strategy equity from bar to bar and compounds those changes within each week to estimate weekly returns.

The displayed statistics are intended to include completed weeks and the latest active period, with options for decimal precision and grouping table cells. The visible excerpt also initializes tracking for the highest and lowest period results. It provides no reported backtest outcomes, and the source ends before the full table-rendering logic appears. Weekly boundaries are identified through the week number, so users should check how that behaves across year transitions and chart timeframes. The RSI signals and settings are illustrative; the document gives no evidence that they are profitable.

Key ideas

  • The example enters long when a seven-period RSI crosses above 70 and short when it crosses below 30.
  • Users can set start and end timestamps that limit trading and the reported periods.
  • Weekly strategy returns are compounded from bar-level changes in strategy equity.
  • The script tracks high and low period results and offers controls for table precision and grouping.
  • The excerpt contains no performance findings and does not show the complete table-rendering code.

Tags

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