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
Growth, inflation, valuation and sentiment readings are typed in as inputs and produce a green, red or neutral bias. Entries need four gates to pass, including pattern quality, a volume surge and a cooldown. Exits use an ATR stop, a trailing exit that starts after a set ATR gain, a time stop in bars, and an optional OBV reversal exit. It takes one position at a time.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
ISM 製造業
float
52.7
ism_mfg
ISM 新訂單
float
53.5
ism_new_orders
ISM 新訂單(上月)
float
55.8
ism_new_orders_prev
NFP 非農(千人)
float
178
nfp_k
消費者信心
float
57.9
consumer_sentiment
ISM 就業
float
48.7
ism_employment
ISM 物價支付
float
78.3
ism_prices
Core PCE YoY%
float
3.1
core_pce_yoy
平均時薪 YoY%
float
3.5
avg_hourly_yoy
SPX PE (trailing)
float
28.4
spx_pe_input
台股加權 PE
float
29.5
tw_pe_input
CAPE Shiller PE
float
35.0
cape_input
Show all 40 settings
Setting
Type
Default
Variable
Put/Call Ratio
float
0.75
put_call_input
AAII 空頭 %
float
30
aaii_bears
AAII 多頭 %
float
42
aaii_bulls
綠燈分數門檻
int
15
d_green_thr
紅燈分數門檻
int
-20
d_red_thr
穩定度最低 %
int
40
d_stability_min
型態品質最低分(D2)
int
90
d2_quality_min
量能爆發倍數(D3)
float
1.8
d3_vol_mult
OBV 均線期數
int
5
obvSmaLen
冷卻期 K 線(D4)
int
20
cooldownBars
固定停損 × ATR
float
1.5
stopAtrMult
波段追蹤啟動(× ATR)
float
1.0
trailStartAtr
波段拉回觸發 %
float
0.23
trailPullback
時間止損 K 線
int
10
timeStopBars
OBV 方向翻轉全平
bool
true
useObvExit
左側確認K線
int
5
pivotLeft
右側確認K線
int
3
pivotRight
價格容差 %
float
3.0
tolerance
品質量能倍數
float
1.2
volMultiple
均量期
int
20
volAvgLen
型態最大跨度(K線)
int
200
maxPatBars
型態最小跨度(K線)
int
5
minPatBars
型態最小高度(×ATR)
float
0.5
minHeightATR
最低 R:R
float
1.5
minRR
雙重底 (多) 88%
bool
true
en_dblBot
反轉頭肩底 (多) 89%
bool
true
en_invHS
上升三角 (多) 83%
bool
true
en_ascTri
雙重頂 (空) 73%
bool
true
en_dblTop
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
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 strategy executes trades based on crossovers between a 12-period and a 26-period exponential moving average (EMA). Long positions can be filtered by pivot resistance breakouts and RSI boundary ranges. For trade management, it provides two configurable par
This strategy trades long breakouts of a fast and a slow moving average on the price chart. It opens a long position when price crosses above either average, using a percentage of equity as size. It reduces the position by a set share when the high reaches the
This strategy enters long or short on the price chart when price is on the correct side of a 200-period EMA, MACD agrees, RSI is not at the opposing extreme, ADX exceeds a threshold, volume beats a 20-bar average, and close breaks the recent high or low. A tim