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
Lucid 100K (MES/MGC/MNQ) operates a two-phase state machine that moves from an initial risk-averse lock-in phase to an expanded payout phase once target profits are met. Entries rely on trend pullbacks and mean-reversion signals filtered by time windows. Risk parameters include daily profit locks, maximum loss limits, intraday drawdown caps, multi-timeframe trend filters, and phase-dependent position sizing.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Lock Target ($)
float
3100
phase2ProfitUsd
Phase Sizing
bool
true
usePhaseSizing
Qty P1 (Lock)
int
2
qtyPhase1
Qty P2 (Payout)
int
5
qtyPhase2
Qty Cooldown
int
1
qtyCooldown
Use Phase 2 Gate
bool
true
usePhase2Gate
P2 Min Recent PF
float
1.1
phase2ReqPF
P2 PF Lookback
int
25
phase2Lookback
Block P2 After Halt Day
bool
true
blockP2AfterHalt
Force Trend-only P1
bool
true
forceTrendP1
P1 Green Lock ($)
float
600
p1GreenLockUsd
P2 Profit Lock ($)
float
1200
p2ProfitLockUsd
Show all 40 settings
Setting
Type
Default
Variable
P2 Profit Lock Action
string
Stop
p2ProfitLockAction
Session Filter
bool
true
useSession
RTH Window
session
0830-1515
sessWindow
Flatten End
bool
true
flattenEnd
Warmup Mins
int
15
warmupMins
Power Windows
bool
true
useWindows
AM Window
session
0845-1100
win1
PM Window
session
1330-1510
win2
Rev Blackout Mins
int
30
revBlackout
P2 Mode
string
Auto (Regime)
phase2Mode
P1 MTF
string
15m Only
mtfP1
P2 MTF
string
15m Only
mtfP2
Direction
string
Both
tradeDir
Max Trades/Day P1
int
2
maxTradesP1
Max Trades/Day P2
int
4
maxTradesP2
Max Daily Loss $ P1
float
600
maxDailyLossP1
Max Daily Loss $ P2
float
1200
maxDailyLossP2
Max Intraday DD $ P1
float
900
maxIntradayDDP1
Max Intraday DD $ P2
float
1800
maxIntradayDDP2
Max Weekly Loss $
float
1500
maxWeeklyLoss
Max Consec Losses
int
2
maxConsecLosses
Intraday DD only after green dayPeak
bool
false
ddOnlyAfterGreen
Fast EMA
int
9
fastLen
Slow EMA
int
21
slowLen
Trend EMA
int
200
trendLen
RSI Len
int
14
rsiLen
ATR Len
int
14
atrLen
Use ADX
bool
true
useAdx
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 executes short positions during the end-of-day session (14:29–15:00) when the price is below the 200-day simple moving average. If price moves higher against the initial short trade, it scales into the position by submitting a second short order
This strategy calculates Bollinger Bands and Aroon oscillator values to identify mean-reversion opportunities. It enters a long position using full equity when the closing price crosses below the lower Bollinger Band while Aroon Up remains above a user-specifi
Mean Reversion Strategy is an overlay strategy that identifies pullbacks using a long-term EMA, RSI, and candlestick patterns. It generates long signals when a bullish engulfing candle forms below the EMA while RSI is oversold, and short signals when a bearish
Donald - Test Logic Futures is an overlay strategy designed for intraday futures trading. It combines kernel regression functions with exponential moving averages to evaluate price retracements and entry timing. Trades are filtered by session execution windows
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 generates buy and sell signals based on Bollinger Band crossovers combined with a simple moving average trend filter. It enters a long position when price crosses above the lower band while trading above the SMA filter line, and enters a short po