1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
179 lines of Pine Script v5 from scripts/1dte.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
1DTE evaluates market conditions using Average True Range (ATR), consecutive green or red daily streaks, and CBOE Volatility Index (VIX) levels. Users can filter evaluation windows by specific days of the week, session times, and date ranges. The script adjusts trade parameters based on streak duration and volatility thresholds, assisting in structural analysis for short-term options strategies directly on the main price chart.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Successive Bars in a Row
int
1
daysInARow
ATR value
float
1.0
atr_range
Modify atr
bool
true
toggle_mod
Modify VIX
bool
false
toggle_vix
Monday DTE
bool
true
toggle_monday
Wednesday DTE
bool
true
toggle_wednesday
Friday DTE
bool
true
toggle_friday
vix limit
int
22
vix_limit
1 red day
float
1.8
put1
2 red day
float
1.4
put2
3 red day
float
1.3
put3
4 red day
float
1.0
put4
Show all 27 settings
Setting
Type
Default
Variable
1 green day
float
1.8
call1
2 green day
float
1.4
call2
3 green day
float
1.3
call3
4 green day
float
1.0
call4
1 red day
float
1.8
put1_vix
2 red day
float
1.4
put2_vix
3 red day
float
1.3
put3_vix
4 red day
float
1.0
put4_vix
1 green day
float
1.8
call1_vix
2 green day
float
1.4
call2_vix
3 green day
float
1.3
call3_vix
4 green day
float
1.0
call4_vix
Start Date
time
timestamp("01 Jan 2015 13:30 +0000")
startDate
End Date
time
timestamp("01 Jan 2024 19:30 +0000")
endDate
Time Session to Analyze
session
0600-0915
timeSession
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 indicator classifies the market into gamma regime types (negative gamma trend, positive gamma mean-reversion, or transition) by calculating a composite score based on daily ATR ratios, session VWAP crossover frequencies, and opening range displacement. It
This indicator marks forex trading sessions and opening ranges on the price chart. It can draw Sydney, Tokyo, Frankfurt, London, and New York session boxes or five- and fifteen-minute opening ranges, plus an optional opening channel and a day-open range. Day r
The AM TBR indicator calculates statistical levels for NQ futures using standard deviation. It plots a sigma ladder showing touch levels at 0.5 to 2.0 standard deviations, marks touch points, displays Mean Absolute Error (MAE) zones after touches, and shows Me
This overlay indicator marks the current day's low and a suggested entry zone a fraction of daily ATR below that low. It compares daily volume with a volume moving average, plots daily SMA and EMA distance, and draws an optional ATR-width price cloud. Labels c
This indicator plots intraday reference levels, projection targets, and opening range boundaries tailored for continuous electronic trading session instruments such as gold. It calculates Average Bar Range targets in bullish and bearish multiples, previous day
This indicator combines six trading tools into a single chart overlay to optimize indicator limits. It calculates Bollinger Bands, projects weekend price boundaries, plots market structure elements like order blocks, breaker blocks, and MSB lines, marks New Yo