Strategy · Pine Script v4 · On the chart

Monthly Returns in PineScript Strategies

by regalouisei

This script executes a pivot reversal strategy while displaying a comprehensive monthly and yearly returns table on the chart.

View on GitHub

Repaints

GitHub stars2on the repository
Pine versionv4older, still runs
Lines of code115
Settings3inputs
LicenceNone stated
Last update8 months ago25 Feb 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

Source Code

The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.

Overview

Monthly Returns in PineScript Strategies calculates pivot high and low levels using user-defined left and right bar parameters, placing stop orders to enter long or short when price breaks these levels. The script tracks equity changes across bars to render a performance matrix at the bottom right. It overlay plots pivot levels on the main chart. Note that default execution has no stop loss and uses pivot lookback logic.

Details

Published by

regalouisei on GitHub

Type

Strategy, Pine Script v4

Draws

On the price chart

Category

Screeners & dashboards, Support & resistance

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

  • Signals can change on the live bar or after it closes (repainting)
  • The strategy enters trades without a stop loss

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
leftBarsint2leftBars
rightBarsint1rightBars
Return Precisionint2prec
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

106 stars

This script monitors opening gap conditions and breakout behavior relative to the first candle's range across up to twenty configurable stock tickers. It detects whether following bars remain inside the opening range before breaking out, displaying the status

Strategy v4 Screeners & dashboardsBreakout Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of 1St Bar GAP+BkOut Screener v2 by RM

FxHD Strategy v2.0

by alboogycOdR
6 stars

FxHD Strategy v2.0 is a Fibonacci multi-timeframe strategy drawn on the price chart. It reads a higher timeframe, defaulting to four hours, and sets bias with CRT kill zones, the last two candles, dynamic CRT, or market structure, plus a fallback method. It pl

Strategy v6 Support & resistanceSMC / ICT / price action
Updated 7 months ago · None stated GitHub repository of FxHD Strategy v2.0
5 stars

RG Structure is a pivot-constrained break-and-retest strategy that calculates dynamic trendlines, market structure changes, and regime states on the price chart. It identifies support and resistance lines through pivot points and evaluates break-and-retest sig

Strategy v6 TrendSupport & resistance
Updated 7 weeks ago · None stated GitHub repository of RG Structure Visual Edition

Grid Bot [psyll]

by cullyk
2 stars

Grid Bot places a configurable number of long and short orders between a user-set grid top and bottom and draws those levels on the price chart. Direction can be longs, shorts, or both, with default or burst entry and an optional instant first fill. Exits use

Strategy v5 Mean reversionSupport & resistance
Updated 8 months ago · MIT GitHub repository of Grid Bot [psyll]

MTF Signal Strategy

by Flopchamp
2 stars

The MTF Signal Strategy is designed for 1-minute charts to identify trade entries using multi-timeframe EMA trends, Opening Range Breakout (ORB) levels, key daily high/low levels, and custom pivot zones. It generates trade signals on bar closes when price alig

Strategy v5 TrendBreakout
Updated 7 months ago · None stated GitHub repository of MTF Signal Strategy

More strategys

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers