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
XSP Daily Lotto calculates an opening range box and gauges directional sentiment from an external symbol like ES futures. Bullish conditions trigger call entries on pullbacks to the range low, while bearish conditions enter puts on spikes to the range high. Exits are managed through two profit target levels, a stop loss at the strike, an intraday entry cutoff time, and an end-of-day force close.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Sentiment Symbol
symbol
CME_MINI:ES1!
sentSymbol
Neutral band (%)
float
0.10
sentThresh
Directional Filter
string
Both
tradeDir
Snap strikes to nearest option strike
bool
true
snapEnabled
Extension 1 multiplier (× PM range)
float
0.25
lvl1Mult
Extension 2 multiplier (× PM range)
float
0.50
lvl2Mult
Show Opening Range box
bool
true
showOR
Opening Range (minutes)
int
15
orMins
Max option premium per share ($)
float
0.10
maxPremium
Max risk per trade ($)
float
20.0
maxRiskDollars
Contract multiplier (shares per contract)
int
100
optMultiplier
TP1 option price target ($)
float
1.00
tp1OptionPrice
Show all 37 settings
Setting
Type
Default
Variable
TP2 option price target ($)
float
1.50
tp2OptionPrice
Max entries per direction per day
int
1
maxPerDir
Enable neutral channel trades
bool
false
neutralEn
Neutral max premium per share ($)
float
0.50
neutMaxPrem
Neutral max risk per trade ($)
float
50.0
neutRiskDollars
Neutral TP1 option price ($)
float
1.00
neutTp1Price
Neutral TP2 option price ($)
float
1.50
neutTp2Price
Partial exit at T1
bool
true
tp1En
T1 exit size (%)
float
50.0
tp1Pct
Final exit at T2
bool
true
tp2En
Close if ITM before expiry
bool
true
itmCheckEn
Minutes before EOD to check
int
30
itmOffset
Skip close if deep ITM (cash-settled hold)
bool
true
skipDeepItm
Deep ITM threshold (points)
float
2.0
deepItmPts
EOD force-close
bool
true
eodEn
EOD force-close hour (NY)
int
15
eodHr
EOD force-close minute (NY)
int
45
eodMn
No new entries after hour (NY)
int
11
entryLockHr
No new entries after minute (NY)
int
30
entryLockMn
Use Market Orders
bool
true
useMarket
Directional contracts to order (0 = auto)
int
0
tpQtyDir
Neutral contracts to order (0 = auto)
int
0
tpQtyNeut
Alert format
string
Toast
alertFmt
Show OR label
bool
true
showLabels
Show status label
bool
true
showStatus
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.
3C QFL Mean Reversal is a strategy based on the Quickfinger Luc (QFL) trading methodology. It identifies breakdown buying opportunities below established price base levels and enters mean-reversion trades. The strategy includes multi-safety order DCA scaling,
This strategy enters one long trade when the bar low comes within a set point tolerance of the prior day's low and the close finishes above that level. Entries are allowed only inside a UTC session and are blocked after a Friday cutoff hour. It stays flat unti
This strategy detects daily opening gaps and trades them on the price chart. It marks an up or down gap from the current open and close versus the previous bar, then stores the prior extreme as the fill level. By default it buys down gaps and shorts up gaps, e
This strategy fades ES opening gaps during the New York regular session and plots on the price chart. It records the prior regular close, overnight high and low, and a five, fifteen, or thirty minute opening range. Long and short fade entries require the gap t
This strategy identifies Initial Balance periods on NQ and ES futures charts using user-defined start and end hours in Eastern Time. It classifies days as narrow or wide based on average range lookback and skips narrow or trending days per settings. Entries tr
This strategy plots on the price chart and calculates an initial balance (IB) range from specified IB start to end hours in ET. It computes VWAP using cumulative typical price and volume during the regular trading hours. Confluence is detected when price align