1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
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
Momentum Rotation (Top 3) rebalances monthly and holds the top three performing stocks long only on the price chart. A ranking table shows the current order. Main settings adjust the start date, lookback period, number of holdings, and sell buffer. The strategy enters a long position when the held stock ranks in the top three and exits when it falls out of the top four. It has no stop loss and draws the table on the chart.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Start Date
time
timestamp("2019-01-01")
startDate
Lookback (bars, 126 = 6 months)
int
126
lookback
Hold Top N
int
3
topN
Sell Buffer
int
1
holdBuffer
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.
This strategy automates the TradingLatino methodology by evaluating Squeeze Momentum combined with the Average Directional Index (ADX). It executes long or short positions based on momentum shifts and directional strength. Risk management options include const
This long-only trend-following strategy combines Ichimoku Kinko Hyo components with higher timeframe moving average filters. It triggers long entries when price trades above a higher timeframe EMA and a bullish Tenkan-Sen cross above Kijun-Sen occurs under fav
This strategy calculates trend direction across three user-defined higher timeframes using dual Simple Moving Averages, filtered by On-Balance Volume and Commodity Channel Index conditions alongside fractal pivot swings. Entries trigger when multi-timeframe tr
This strategy serves as a backtesting template for any trading system. It accepts external signals to trigger long or short entries and exits, with optional filters based on EMA and ADX indicators to refine conditions. Time-based restrictions limit trading to
This trading strategy combines Stochastic, RSI, ATR, and multiple Exponential Moving Averages (20, 50, and 200) alongside Fibonacci zones to generate trading signals for gold (XAUUSD). It supports flexible execution modes including scalp and confirm entries, c
This strategy automatically adapts its moving average lengths and types based on the chart's timeframe, covering scalping, intraday, and swing styles. It generates entry signals when a fast moving average crosses a slow moving average, provided price is on the