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
Chart Pattern Detector v2 Backtest builds a zigzag from pivots, finds patterns such as double and triple tops and bottoms, head and shoulders, triangles, rectangles, cup and handle, flags and wedges, and scores their quality. Trades are entered when a pattern breaks out, optionally limited to confirmed breakouts or the top tier of patterns. Stops and targets come from the pattern geometry with a minimum reward-to-risk, and position size is derived from a fixed dollar risk. It allows one position at a time and updates on every tick.
Zigzag-based chart pattern entries
Confirmed-breakout and top-tier filters
Pattern-based stop and target with minimum reward-to-risk
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
左側確認K線
int
5
pivotLeft
右側確認K線
int
3
pivotRight
價格容差 %
float
3.0
tolerance
量能確認倍數(T2)
float
1.2
volMultiple
均量計算期
int
20
volAvgLen
型態最大跨度(K線)
int
200
maxPatBars
型態最小跨度(K線)
int
5
minPatBars
型態最小高度(×ATR)
float
0.5
minHeightATR
最低品質分
int
0
minQuality
最低 R:R 比
float
1.5
minRR
冷卻期(K線)
int
20
cooldownBars
最大同時顯示數
int
3
maxSignals
Show all 30 settings
Setting
Type
Default
Variable
反轉頭肩底 89%
bool
true
en_invHS
雙重底 88%
bool
true
en_dblBot
三重底 87%
bool
true
en_triBot
下降三角 87%
bool
true
en_descTri
矩形頂 85%
bool
true
en_rectTop
上升三角 83%
bool
true
en_ascTri
頭肩頂 81%
bool
true
en_hsTop
杯柄 79%
bool
true
en_cup
牛旗 78%
bool
true
en_bullFlag
對稱三角 76%
bool
true
en_symTri
雙重頂 73%
bool
true
en_dblTop
下降楔形 72%
bool
true
en_fallWdg
只交易「已突破」型態
bool
true
onlyConfirmed
只交易 Tier 1
bool
false
onlyT1
單筆風險金額 ($)
float
25.0
tpRiskDollar
顯示儀表板
bool
true
showTable
顯示 Zigzag 節點
bool
false
showZZ
儀表板位置
string
右上
tablePos
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 trend-following strategy executes a classic Donchian channel breakout system designed to cross-validate backtest results against external framework benchmarks. It triggers a long entry when the closing price breaks above the highest high of the prior entr
This strategy plots running pivot highs as red R circles and pivot lows as blue S circles directly on the price chart. It computes an EMA 3 and a Cto trend line from close prices, then generates long signals on upward EMA-Cto crossovers combined with price pos
STRG-HOLP is a trading strategy that identifies High of Low Period (HOLP) and Low of High Period (LOHP) breakout setups. It tracks the lowest low or highest high over a user-defined lookback window. A long trade opens when the close breaks above the high of th
The Chained Linear Regression Reversal Strategy plots linear regression channels with upper and lower standard deviation bands directly on the price chart across a user-defined time window. When price breaks out of the static channel for a confirmed number of
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
This trend breakout strategy plots Donchian Channels consisting of upper, lower, and middle bands directly on the main price chart. Long positions enter when price touches the upper channel and pulls back to or below the middle band, placing a stop loss at the