Sessions Rainbow EST with overlapsThis script displays the trading zones with overlaps based on the color of the rainbow. It is used with a Point&Figure chart to show trends associated with trading periods and overlapping trading periods.
Pesquisar nos scripts por "session"
Sessions - London NY overlapOther scripts show London closing at 5pm GMT whereas i believe the forex market on London closes at 4pm GMT. So i have adjusted an already published script to reflect this
SeparatorsSession - H1 and below Time Frame
Day - H4 and below Time Frame
Month - D Time Frame
Quarter - W Time Frame
Session Key Levels Lines (with Labels)This is an extension of the previous indicator, it just plots all the information you need automatically for you so you dont have to lift a finger. hope it helps :)
Session Moving AveragesAdds EMAs and SMAs to chart using 8am-8pm EST values. Completely configurable in settings.
Some platforms allow users to configure what time frame they would like to view market data. One popular selection is 8am-8pm EST as 8am is when institutional orders go through. An argument can be made that price action before 8am EST is not valid yet moving averages will use that data.
This matters less for shorter moving averages such as a 9 or 20 ema, but it dramatically changes the 200 or the 50 sma for example.
This script allows you to ignore that pre-market data (or any data you choose to configure in the settings) and select up to 3 moving averages (either Exponential or Simple) for a set time.
By default the moving averages include the 9-ema (gray), 20-ema (green), and 200-sma (purple) and is set to 8am-8pm EST
This is configurable in the settings including the time frame you would like the moving averages to start using market data.
By default the script will use your charts timeframe. You are able to use multi-time frames with this script just scroll down to "timeframe", then click "chart" in settings... this will then allow you to select a timeframe.
A popular choice is 5-minute value of 8am-8pm EST moving averages. This means regardless of the time frame you are on (sub 1-minute, 1-minute, etc.) the script will display 5-minute data.
Final note: In settings you are able to turn on/off shapes (the gray lines at the bottom) which shows when the data is being used. This can be helpful on certain tickers that trade continuously such as /ES or /NQ.
Session Time RangesHave you ever wondered if you are trading at the right time of the day or feel like all the good trades happen when you are sleeping? Well now you can check your theory :)
This Script allows you to highlight a time range on your chart over a 24hour time period. For example 3AM to 6AM
The script has two time variables, set your start time and end time based on a 24 hour clock and set the time zone offset variable to match your charts time zone. For example New York -4 (for utc just enter 0 for no offset )
This is a quick script I put together so hopefully it is error free enjoy :)
Session P4L MTFCorrected indicator for better support of smaller time frames. version 3.0 with better interface. thank you
Session P EdgesThis is an attempt to chart the primary balance ranges, however,
I have been having difficulty getting the lows to work in the graph, any assistance would be welcome
SmartSkull 15 minutes//@version=5
indicator("LegendGPT – First 15m Extremes + Second 15m Breakout FVG + Alerts", overlay=true, max_boxes_count=500)
// SETTINGS
boxColor = input.color(color.new(color.gray, 85), "Opening Box Color")
fvgBullColor = input.color(color.new(color.green, 85), "Bullish FVG Color")
fvgBearColor = input.color(color.new(color.red, 85), "Bearish FVG Color")
sessionTZ = "America/New_York"
nasdaqOpenHour = 9
nasdaqOpenMinute = 30
// 15m data for box
time15_tf = request.security(syminfo.tickerid, "15", time, lookahead=barmerge.lookahead_on)
high15_tf = request.security(syminfo.tickerid, "15", high, lookahead=barmerge.lookahead_on)
low15_tf = request.security(syminfo.tickerid, "15", low, lookahead=barmerge.lookahead_on)
// First 15m candle start
isFirst15mActive = (hour(time15_tf, sessionTZ) == nasdaqOpenHour and minute(time15_tf, sessionTZ) == nasdaqOpenMinute)
isSecond15mActive = (hour(time15_tf, sessionTZ) == nasdaqOpenHour and minute(time15_tf, sessionTZ) == nasdaqOpenMinute + 15)
// STATE VARS
var box openingRangeBox = na
var float session1mHigh = na
var int session1mHighBar = na
var float session1mLow = na
var int session1mLowBar = na
var bool extremesMarked = false
var bool bullBreakout = false
var bool bearBreakout = false
var bool fvgDrawn = false
var box fvgBox = na
var label fvgFilledLabel = na
newDay = time("D", sessionTZ) != time("D", sessionTZ)
// RESET DAILY
if newDay
if not na(openingRangeBox)
box.delete(openingRangeBox)
if not na(fvgBox)
box.delete(fvgBox)
if not na(fvgFilledLabel)
label.delete(fvgFilledLabel)
session1mHigh := na
session1mHighBar := na
session1mLow := na
session1mLowBar := na
extremesMarked := false
bullBreakout := false
bearBreakout := false
fvgDrawn := false
// Only run on 1-minute timeframe
if timeframe.multiplier == 1
// CREATE OPENING RANGE BOX for first 15m
if isFirst15mActive and na(openingRangeBox)
openingRangeBox := box.new(left=bar_index, top=high15_tf, right=bar_index + 15, bottom=low15_tf, bgcolor=boxColor, border_color=color.new(color.black, 90))
// Track highest/lowest 1m candle during first 15m
if isFirst15mActive
if na(session1mHigh)
session1mHigh := high
session1mHighBar := bar_index
session1mLow := low
session1mLowBar := bar_index
else
if high > session1mHigh
session1mHigh := high
session1mHighBar := bar_index
if low < session1mLow
session1mLow := low
session1mLowBar := bar_index
// When first 15m ends, mark extremes
if isFirst15mActive and not isFirst15mActive and not extremesMarked
// Green box for highest 1m candle
box.new(left=session1mHighBar, top=session1mHigh, right=session1mHighBar + 1, bottom=session1mHigh, border_color=color.green, bgcolor=color.new(color.green, 80))
// Red box for lowest 1m candle
box.new(left=session1mLowBar, top=session1mLow, right=session1mLowBar + 1, bottom=session1mLow, border_color=color.red, bgcolor=color.new(color.red, 80))
extremesMarked := true
// SECOND 15m: Check breakout of high/low
if isSecond15mActive
// Bullish breakout
if not bullBreakout and high > session1mHigh
bullBreakout := true
bearBreakout := false
alert("LegendGPT: Bullish Breakout above first 15m high", alert.freq_once_per_bar)
// Bearish breakout
if not bearBreakout and low < session1mLow
bearBreakout := true
bullBreakout := false
alert("LegendGPT: Bearish Breakout below first 15m low", alert.freq_once_per_bar)
// After breakout in second 15m, look for first FVG
if isSecond15mActive and not fvgDrawn
// Bullish FVG condition
if bullBreakout and low > high
fvgBox := box.new(left=bar_index - 1, top=high , right=bar_index, bottom=low, bgcolor=fvgBullColor, border_color=color.green)
fvgDrawn := true
alert("LegendGPT: Bullish FVG formed after breakout", alert.freq_once_per_bar)
// Bearish FVG condition
if bearBreakout and high < low
fvgBox := box.new(left=bar_index - 1, top=high, right=bar_index, bottom=low , bgcolor=fvgBearColor, border_color=color.red)
fvgDrawn := true
alert("LegendGPT: Bearish FVG formed after breakout", alert.freq_once_per_bar)
// PERSISTENT FVG: delete when filled
if not na(fvgBox)
fvgTop = box.get_top(fvgBox)
fvgBottom = box.get_bottom(fvgBox)
if high >= fvgBottom and low <= fvgTop
box.delete(fvgBox)
fvgBox := na
fvgDrawn := false
if not na(fvgFilledLabel)
label.delete(fvgFilledLabel)
fvgFilledLabel := label.new(bar_index, close, text="FVG filled", style=label.style_label_center, color=color.blue, textcolor=color.white, size=size.tiny)
alert("LegendGPT: FVG filled (mitigation)", alert.freq_once_per_bar)
Multi-Timeframe High/Low Step# Multi-Timeframe High/Low Step Indicator
## Overview
The Multi-Timeframe High/Low Step indicator displays higher timeframe price levels as clear horizontal steps on your chart. This powerful tool helps traders identify key support and resistance levels from larger timeframes while trading on smaller timeframes, providing crucial context for intraday decision-making.
## Key Features
### Dynamic Timeframe Selection
- Choose any timeframe from 1 minute to monthly
- Default setting: 30-minute timeframe
- Automatically adapts to show selected timeframe data on any chart
### Visual Step Display
- **High levels** shown as red step lines (customizable)
- **Low levels** shown as green step lines (customizable)
- Clean horizontal lines that update only when new higher timeframe bars form
- Optional fill between high/low to visualize the range
### Perfect For
- **Scalpers**: See hourly levels on 1-5 minute charts
- **Day Traders**: Monitor daily levels on 15-30 minute charts
- **Swing Traders**: Track weekly levels on daily charts
- **Multi-timeframe Analysis**: Combine multiple instances with different timeframes
## How It Works
The indicator fetches high and low data from your selected timeframe and displays them as horizontal step lines. These levels remain flat until a new bar forms in the higher timeframe, creating a "staircase" effect that clearly shows when levels change.
## Use Cases
### Support & Resistance
- Higher timeframe highs often act as resistance
- Higher timeframe lows often act as support
- Previous levels can become future support/resistance after breaks
### Range Trading
- Trade within the high/low range during consolidation
- Look for breakouts when price exceeds these levels
- Use the fill option to visualize the trading range
### Trend Confirmation
- Rising steps indicate uptrend on higher timeframe
- Falling steps indicate downtrend on higher timeframe
- Flat steps suggest consolidation
## Settings
**Timeframe**: Select the higher timeframe to display (default: 30 minutes)
**High Line Color**: Customize the color of the high line (default: red)
**Low Line Color**: Customize the color of the low line (default: green)
**Fill Between High/Low**: Toggle to shade the area between high and low levels
## Tips for Best Results
1. **Choose Meaningful Timeframes**: Use standard timeframes that align with market sessions (15m, 30m, 1H, 4H, Daily)
2. **Multiple Instances**: Add the indicator multiple times with different timeframes for comprehensive analysis
3. **Combine with Price Action**: Use these levels in conjunction with candlestick patterns and volume
4. **Watch for Tests**: Pay attention when price approaches these levels - they often act as magnets
5. **Clean Charts**: The step design keeps your chart uncluttered compared to multiple moving averages
## Example Setups
**Scalping (1-5 min chart)**
- Add 15-minute levels for immediate range
- Add 1-hour levels for key boundaries
**Day Trading (5-15 min chart)**
- Add 30-minute or 1-hour for intraday structure
- Add daily levels for major support/resistance
**Swing Trading (1H-4H chart)**
- Add daily levels for short-term structure
- Add weekly levels for major zones
## Notes
- The indicator uses `lookahead` to ensure accurate historical display
- Levels update in real-time as new higher timeframe bars form
- Works on all markets: Forex, Crypto, Stocks, Indices, Commodities
---
*This indicator is ideal for traders who want to maintain awareness of important price levels from higher timeframes without cluttering their charts or constantly switching between timeframes.*
Best Indicators for Day Trading//@version=5
indicator("Best Indicators for Day Trading", shorttitle="Day Trading Indicators", overlay= true)
//---------------------------- MA's ----------------------------//
priceSource = input.source(close, title='Price Source For The Moving Averages', group='Moving Average')
IgnoreExtendedHours = input.bool(true, title='Ignore Extended Hours', group='Moving Average')
resolution = timeframe.period
price = request.security(syminfo.tickerid, resolution, priceSource)
shortMAPeriod = input.int(8, title='MA 1', group='Moving Average', inline='short')
shortMAType = input.string(defval='EMA', title='', confirm=false, options= , group='Moving Average', inline='short')
longMAPeriod = input.int(21, title='MA 2', group='Moving Average', inline='long')
longMAType = input.string(defval='EMA', title='', confirm=false, options= , group='Moving Average', inline='long')
i_timeframe_signal = input.timeframe(title='Crossover MAs Timeframe', defval='', group='Moving Average')
useTextLabels = input.bool(true, title='Use Text-Based Crossover Labels?', group='Moving Average')
showBonusMA1 = input.bool(true, title='Bonus MA', group='Moving Average', inline='bma1')
bonusMA1Period = input.int(34, title='',group='Moving Average', inline='bma1')
bonus1MAType = input.string(defval='EMA', title='', confirm=false, options= , group='Moving Average', inline='bma1')
i_timeframe_bma1 = input.timeframe(title='', defval='', group='Moving Average', inline='bma1')
ZLMASmooth = 3
f_security(_sym, _res, _src) =>
request.security(_sym, _res, _src , barmerge.gaps_off, lookahead=barmerge.lookahead_off)
ticker = ticker.new(syminfo.prefix, syminfo.ticker, IgnoreExtendedHours ? session.regular : syminfo.session)
// MA calculation
short = shortMAType == 'SMA' ? f_security(ticker, i_timeframe_signal, ta.sma(price, shortMAPeriod)) : shortMAType == 'EMA' ? f_security(ticker, i_timeframe_signal, ta.ema(price, shortMAPeriod)) : shortMAType == 'WMA' ? f_security(ticker, i_timeframe_signal, ta.wma(price, shortMAPeriod)) : shortMAType == 'HMA' ? f_security(ticker, i_timeframe_signal, ta.hma(price, shortMAPeriod)) : shortMAType == 'ALMA' ? f_security(ticker, i_timeframe_signal, ta.alma(price, shortMAPeriod, 0.85, 6)) : shortMAType == 'LIN' ? f_security(ticker, i_timeframe_signal, ta.linreg(price, shortMAPeriod, 0)) : shortMAType == 'ZLMA' ? f_security(ticker, i_timeframe_signal, 2 * ta.wma(ta.wma(price, shortMAPeriod), ZLMASmooth) - ta.wma(ta.wma(ta.wma(price, shortMAPeriod), ZLMASmooth), shortMAPeriod)) : na
long = longMAType == 'SMA' ? f_security(ticker, i_timeframe_signal, ta.sma(price, longMAPeriod)) : longMAType == 'EMA' ? f_security(ticker, i_timeframe_signal, ta.ema(price, longMAPeriod)) : longMAType == 'WMA' ? f_security(ticker, i_timeframe_signal, ta.wma(price, longMAPeriod)) : longMAType == 'HMA' ? f_security(ticker, i_timeframe_signal, ta.hma(price, longMAPeriod)) : longMAType == 'ALMA' ? f_security(ticker, i_timeframe_signal, ta.alma(price, longMAPeriod, 0.85, 6)) : longMAType == 'LIN' ? f_security(ticker, i_timeframe_signal, ta.linreg(price, longMAPeriod, 0)) : longMAType == 'ZLMA' ? f_security(ticker, i_timeframe_signal, 2 * ta.wma(ta.wma(price, longMAPeriod), ZLMASmooth) - ta.wma(ta.wma(ta.wma(price, longMAPeriod), ZLMASmooth), longMAPeriod)) : na
bonus1 = bonus1MAType == 'SMA' ? f_security(ticker, i_timeframe_bma1, ta.sma(price, bonusMA1Period)) : bonus1MAType == 'EMA' ? f_security(ticker, i_timeframe_bma1, ta.ema(price, bonusMA1Period)) : bonus1MAType == 'WMA' ? f_security(ticker, i_timeframe_bma1, ta.wma(price, bonusMA1Period)) : bonus1MAType == 'HMA' ? f_security(ticker, i_timeframe_bma1, ta.hma(price, bonusMA1Period)) : bonus1MAType == 'ALMA' ? f_security(ticker, i_timeframe_bma1, ta.alma(price, bonusMA1Period, 0.85, 6)) : bonus1MAType == 'LIN' ? f_security(ticker, i_timeframe_bma1, ta.linreg(price, bonusMA1Period, 0)) : bonus1MAType == 'ZLMA' ? f_security(ticker, i_timeframe_bma1, 2 * ta.wma(ta.wma(price, bonusMA1Period), ZLMASmooth) - ta.wma(ta.wma(ta.wma(price, bonusMA1Period), ZLMASmooth), bonusMA1Period)) : na
// trend direction/color
TrendingUp() =>
short > long
TrendingDown() =>
short < long
Uptrend() =>
TrendingUp() and TrendingDown()
Downtrend() =>
TrendingDown() and TrendingUp()
trendColor = TrendingUp() ? color.new(color.green, 85) : TrendingDown() ? color.new(color.red, 85) : color.new(color.blue, 85)
MA1 = plot(short, title='Short Period Moving Average', color=color.fuchsia, linewidth=2, style=plot.style_line)
MA2 = plot(long, title='Long Period Moving Average', color=color.navy, linewidth=1, style=plot.style_line)
fill(MA1, MA2, color=trendColor, title='Short/Long Divergence Fill')
plot(showBonusMA1 ? bonus1 : na, title='MA 3', color=color.white, linewidth=1, style=plot.style_line)
// Short & Long Moving Averages cross alert
MAcrossing = ta.cross(short, long) ? short : na
plot(MAcrossing , title='Calls/Puts Crossing Icon', style=plot.style_cross, linewidth=3, color=trendColor)
// Bull and Bear Alerts
Bull = ta.crossover(short, long)
Bear = ta.crossunder(short, long)
plotshape(Bull, title='Calls Label', color=color.new(color.green, 25), textcolor=useTextLabels ? color.white : color.new(color.white, 100), style=useTextLabels ? shape.labelup : shape.triangleup, text='Calls', location=location.belowbar)
plotshape(Bear, title='Puts Label', color=color.new(color.red, 25), textcolor=useTextLabels ? color.white : color.new(color.white, 100), style=useTextLabels ? shape.labeldown : shape.triangledown, text='Puts', location=location.abovebar)
if Bull
alert('Calls Alert: 8ema crossed over 21ema', alert.freq_once_per_bar_close)
if Bear
alert('Puts Alert: 8ema crossed under 21ema', alert.freq_once_per_bar_close)
//---------------------------- VWAP ----------------------------//
vwapprice = input(defval=hlc3, title="VWAP Source", group='VWAP')
enable_vwap = input(true, title="Enable VWAP", group='VWAP')
vwapResolution = input.timeframe(title = "VWAP Resolution", defval = "", group='VWAP')
vwapFunction = ta.vwap(vwapprice)
vwapSecurity = request.security(syminfo.tickerid, vwapResolution, vwapFunction)
plot(enable_vwap ? vwapSecurity : na, title="VWAP", color=color.yellow, linewidth=2, editable=true)
//---------------------------- FVG ----------------------------//
showFractals = input(false,title="Show Fractals?", group="Fair Value Gap")
showBrekout = input(false,title="Show Market Structure Breakouts?", group="Fair Value Gap")
breakType = input.string("Body",title="Fractal Break Type:",options= , group="Fair Value Gap")
n = input.int(title="Periods", defval=2, minval=2, group="Fair Value Gap")
showImbalance = input(true,title="Show Breakout Imbalances", group="Fair Value Gap")
showOtherImbalance = input(true,title="Show Other Imbalances", group="Fair Value Gap")
imbGreenClr = input.color(color.new(color.green,65),title="Up:",inline="i_1", group="Fair Value Gap")
imbRedClr = input.color(color.new(color.red,65),title="Down:",inline="i_1", group="Fair Value Gap")
imbRestClr = input.color(color.new(color.yellow,65), title="Other:",inline="i_1", group="Fair Value Gap")
showBoxes = input(false,title="Show OrderBlocks?", group="Fair Value Gap")
changeColor = input(false,title="Change OrderBlock Colors?", group="Fair Value Gap")
transGreenClr = input.color(color.new(color.green,80),title="Bg:",inline="a_1", group="Fair Value Gap")
greenClr = input.color(color.new(color.green,0),title="Border:",inline="a_1", group="Fair Value Gap")
transRedClr = input.color(color.new(color.red,80),title="Bg:",inline="b_1", group="Fair Value Gap")
redClr = input.color(color.new(color.red,0),title="Border:",inline="b_1", group="Fair Value Gap")
//Fractals{
// UpFractal
bool upflagDownFrontier = true
bool upflagUpFrontier0 = true
bool upflagUpFrontier1 = true
bool upflagUpFrontier2 = true
bool upflagUpFrontier3 = true
bool upflagUpFrontier4 = true
for i = 1 to n
upflagDownFrontier := upflagDownFrontier and (high < high )
upflagUpFrontier0 := upflagUpFrontier0 and (high < high )
upflagUpFrontier1 := upflagUpFrontier1 and (high <= high and high < high )
upflagUpFrontier2 := upflagUpFrontier2 and (high <= high and high <= high and high < high )
upflagUpFrontier3 := upflagUpFrontier3 and (high <= high and high <= high and high <= high and high < high )
upflagUpFrontier4 := upflagUpFrontier4 and (high <= high and high <= high and high <= high and high <= high and high < high )
flagUpFrontier = upflagUpFrontier0 or upflagUpFrontier1 or upflagUpFrontier2 or upflagUpFrontier3 or upflagUpFrontier4
upFractal = (upflagDownFrontier and flagUpFrontier)
//DownFractal
bool downflagDownFrontier = true
bool downflagUpFrontier0 = true
bool downflagUpFrontier1 = true
bool downflagUpFrontier2 = true
bool downflagUpFrontier3 = true
bool downflagUpFrontier4 = true
for i = 1 to n
downflagDownFrontier := downflagDownFrontier and (low > low )
downflagUpFrontier0 := downflagUpFrontier0 and (low > low )
downflagUpFrontier1 := downflagUpFrontier1 and (low >= low and low > low )
downflagUpFrontier2 := downflagUpFrontier2 and (low >= low and low >= low and low > low )
downflagUpFrontier3 := downflagUpFrontier3 and (low >= low and low >= low and low >= low and low > low )
downflagUpFrontier4 := downflagUpFrontier4 and (low >= low and low >= low and low >= low and low >= low and low > low )
flagDownFrontier = downflagUpFrontier0 or downflagUpFrontier1 or downflagUpFrontier2 or downflagUpFrontier3 or downflagUpFrontier4
downFractal = (downflagDownFrontier and flagDownFrontier)
//}
var float topValue = na, var float bottomValue = na
var int lastRedIndex = na, var float lastRedLow = na, var float lastRedHigh = na
var int lastGreenIndex = na, var float lastGreenLow = na, var float lastGreenHigh = na
var line topLine = na, var line bottomLine = na
var box demandBox = na, var box supplyBox = na
var box imbalanceBox = na
var bool checkUpImbalance = false
var bool checkDownImbalance = false
var topBreakBlock = false, var bottomBreakBlock = false
var isLongBreak = false, var isShortBreak = false
var arrBoxes = array.new_box(0)
topBreakCheckSource = breakType == "Wick+Body" ? high : close
bottomBreakCheckSource = breakType == "Wick+Body" ? low : close
//IMBALANCE
//Data
L1 = low
H3 = high
H1 = high
L3 = low
FVGUp = H3 < L1 ? 1 : 0
plotFVGU = FVGUp ? H3 : na
plotFVGUL = FVGUp ? L1 : na
FVGDown = L3 > H1 ? 1 : 0
plotFVGD = FVGDown ? L3 : na
plotFVGH = FVGDown ? H1 : na
if FVGUp and showOtherImbalance and checkUpImbalance == false
imbalanceBox := box.new(bar_index-2, plotFVGU,bar_index,plotFVGUL, bgcolor=imbRestClr, border_color=imbRestClr)
if FVGDown and showOtherImbalance and checkDownImbalance == false
imbalanceBox := box.new(bar_index-2, plotFVGH,bar_index,plotFVGD, bgcolor=imbRestClr, border_color=imbRestClr)
//Last red check
if close < open
lastRedIndex := bar_index
lastRedLow := low
lastRedHigh := high
//Last green check
if close > open
lastGreenIndex := bar_index
lastGreenLow := low
lastGreenHigh := high
//Check Imbalance
if checkUpImbalance
checkUpImbalance := false
imbTop = low
imbBottom = high
if imbTop > imbBottom and showImbalance
imbalanceBox := box.new(bar_index-2, imbTop,bar_index,imbBottom, bgcolor=imbGreenClr, border_color=imbGreenClr)
if checkDownImbalance
checkDownImbalance := false
imbTop = low
imbBottom = high
if imbTop > imbBottom and showImbalance
imbalanceBox := box.new(bar_index-2, imbTop,bar_index,imbBottom, bgcolor=imbRedClr, border_color=imbRedClr)
//Top break
if ta.crossover(topBreakCheckSource,topValue) and topBreakBlock == false
topBreakBlock := true
isLongBreak := true
checkUpImbalance := true
if showBrekout
line.set_x2(topLine,bar_index)
if showBoxes
demandBox := box.new(lastRedIndex-1, lastRedHigh,lastRedIndex+1,lastRedLow, bgcolor=transGreenClr, border_color=greenClr)
array.push(arrBoxes,demandBox)
//Bottom break
if ta.crossunder(bottomBreakCheckSource,bottomValue) and bottomBreakBlock == false
bottomBreakBlock := true
isShortBreak := true
checkDownImbalance := true
if showBrekout
line.set_x2(bottomLine,bar_index)
if showBoxes
supplyBox := box.new(lastGreenIndex-1, lastGreenHigh,lastGreenIndex+1,lastGreenLow, bgcolor=transRedClr, border_color=redClr)
array.push(arrBoxes,supplyBox)
//New up fractal
if upFractal
topBreakBlock := false
isLongBreak := false
topValue := high
if showBrekout
topLine := line.new(bar_index ,topValue,bar_index,topValue, color=color.teal, style=line.style_dotted, width=2)
if isLongBreak == false
line.delete(topLine )
//New down fractal
if downFractal
bottomBreakBlock := false
isShortBreak := false
bottomValue := low
if showBrekout
bottomLine := line.new(bar_index ,bottomValue,bar_index,bottomValue, color=color.maroon, style=line.style_dotted, width=2)
if isShortBreak == false
line.delete(bottomLine )
//Box state update
//activeBoxes = box.all
activeBoxes = arrBoxes
if array.size(activeBoxes) > 0 and changeColor
for i = 0 to array.size(activeBoxes) - 1
bVal = box.get_bottom(array.get(activeBoxes, i))
tVal = box.get_top(array.get(activeBoxes, i))
if close < bVal
box.set_bgcolor(array.get(activeBoxes, i),transRedClr)
box.set_border_color(array.get(activeBoxes, i),redClr)
if close > tVal
box.set_bgcolor(array.get(activeBoxes, i),transGreenClr)
box.set_border_color(array.get(activeBoxes, i),greenClr)
//PLOTS
plotshape(showFractals ? downFractal : na,style=shape.triangleup, location=location.belowbar, offset=-n, color=color.new(color.gray,80), size = size.tiny)
plotshape(showFractals ? upFractal : na, style=shape.triangledown, location=location.abovebar, offset=-n, color=color.new(color.gray,80), size = size.tiny)
//---------------------------- Bollinger Bands ----------------------------//
bbshow = input.bool(true, "Show Bollinger Bands?", group="Bollinger Bands")
bblength = input.int(20, minval=1, group="Bollinger Bands")
bbsrc = input(close, title="Source", group="Bollinger Bands")
bbmult = input.float(2.0, minval=0.001, maxval=50, title="StdDev", group="Bollinger Bands")
bbbasis = ta.sma(bbsrc, bblength)
bbdev = bbmult * ta.stdev(bbsrc, bblength)
bbupper = bbbasis + bbdev
bblower = bbbasis - bbdev
//Input Checkbox
basis_checkbok = input.bool(title="Basis", defval = true)
bboffset = input.int(0, "Offset", minval = -499, maxval = 500)
//Plot
plot(basis_checkbok ? bbbasis : na, "Basis", color=#872323, offset = bboffset)
p1 = plot(bbshow ? bbupper : na, "Upper", color=color.teal, offset = bboffset)
p2 = plot(bbshow ? bblower : na, color = color.teal)
fill(p1, p2, title = "Background", color=#198787)
//---------------------------- Support and Resistance ----------------------------//
prd = input.int(defval=10, title='Pivot Period', minval=4, maxval=30, group="S&R")
ppsrc = input.string(defval='High/Low', title='Source', options= , group="S&R")
maxnumpp = input.int(defval=20, title=' Maximum Number of Pivot', minval=5, maxval=100, group="S&R")
ChannelW = input.int(defval=10, title='Maximum Channel Width %', minval=1, group="S&R")
maxnumsr = input.int(defval=5, title=' Maximum Number of S/R', minval=1, maxval=10, group="S&R")
min_strength = input.int(defval=2, title=' Minimum Strength', minval=1, maxval=10, group="S&R")
labelloc = input.int(defval=20, title='Label Location', group="S&R", tooltip='Positive numbers reference future bars, negative numbers reference histical bars')
linestyle = input.string(defval='Dashed', title='Line Style', options= , group="S&R")
linewidth = input.int(defval=2, title='Line Width', minval=1, maxval=4, group="S&R")
resistancecolor = input.color(defval=color.red, title='Resistance Color', group="S&R")
supportcolor = input.color(defval=color.lime, title='Support Color', group="S&R")
showpp = input(false, title='Show Point Points')
float src1 = ppsrc == 'High/Low' ? high : math.max(close, open)
float src2 = ppsrc == 'High/Low' ? low : math.min(close, open)
float ph = ta.pivothigh(src1, prd, prd)
float pl = ta.pivotlow(src2, prd, prd)
plotshape(ph and showpp, text='H', style=shape.labeldown, color=na, textcolor=color.new(color.red, 0), location=location.abovebar, offset=-prd)
plotshape(pl and showpp, text='L', style=shape.labelup, color=na, textcolor=color.new(color.lime, 0), location=location.belowbar, offset=-prd)
Lstyle = linestyle == 'Dashed' ? line.style_dashed : linestyle == 'Solid' ? line.style_solid : line.style_dotted
//calculate maximum S/R channel zone width
prdhighest = ta.highest(300)
prdlowest = ta.lowest(300)
cwidth = (prdhighest - prdlowest) * ChannelW / 100
var pivotvals = array.new_float(0)
if ph or pl
array.unshift(pivotvals, ph ? ph : pl)
if array.size(pivotvals) > maxnumpp // limit the array size
array.pop(pivotvals)
get_sr_vals(ind) =>
float lo = array.get(pivotvals, ind)
float hi = lo
int numpp = 0
for y = 0 to array.size(pivotvals) - 1 by 1
float cpp = array.get(pivotvals, y)
float wdth = cpp <= lo ? hi - cpp : cpp - lo
if wdth <= cwidth // fits the max channel width?
lo := cpp <= lo ? cpp : lo
hi := cpp > lo ? cpp : hi
numpp += 1
numpp
var sr_up_level = array.new_float(0)
var sr_dn_level = array.new_float(0)
sr_strength = array.new_float(0)
find_loc(strength) =>
ret = array.size(sr_strength)
for i = ret > 0 ? array.size(sr_strength) - 1 : na to 0 by 1
if strength <= array.get(sr_strength, i)
break
ret := i
ret
ret
check_sr(hi, lo, strength) =>
ret = true
for i = 0 to array.size(sr_up_level) > 0 ? array.size(sr_up_level) - 1 : na by 1
//included?
if array.get(sr_up_level, i) >= lo and array.get(sr_up_level, i) <= hi or array.get(sr_dn_level, i) >= lo and array.get(sr_dn_level, i) <= hi
if strength >= array.get(sr_strength, i)
array.remove(sr_strength, i)
array.remove(sr_up_level, i)
array.remove(sr_dn_level, i)
ret
else
ret := false
ret
break
ret
var sr_lines = array.new_line(11, na)
var sr_labels = array.new_label(11, na)
for x = 1 to 10 by 1
rate = 100 * (label.get_y(array.get(sr_labels, x)) - close) / close
label.set_text(array.get(sr_labels, x), text=str.tostring(label.get_y(array.get(sr_labels, x))) + '(' + str.tostring(rate, '#.##') + '%)')
label.set_x(array.get(sr_labels, x), x=bar_index + labelloc)
label.set_color(array.get(sr_labels, x), color=label.get_y(array.get(sr_labels, x)) >= close ? color.red : color.lime)
label.set_textcolor(array.get(sr_labels, x), textcolor=label.get_y(array.get(sr_labels, x)) >= close ? color.white : color.black)
label.set_style(array.get(sr_labels, x), style=label.get_y(array.get(sr_labels, x)) >= close ? label.style_label_down : label.style_label_up)
line.set_color(array.get(sr_lines, x), color=line.get_y1(array.get(sr_lines, x)) >= close ? resistancecolor : supportcolor)
if ph or pl
//because of new calculation, remove old S/R levels
array.clear(sr_up_level)
array.clear(sr_dn_level)
array.clear(sr_strength)
//find S/R zones
for x = 0 to array.size(pivotvals) - 1 by 1
= get_sr_vals(x)
if check_sr(hi, lo, strength)
loc = find_loc(strength)
// if strength is in first maxnumsr sr then insert it to the arrays
if loc < maxnumsr and strength >= min_strength
array.insert(sr_strength, loc, strength)
array.insert(sr_up_level, loc, hi)
array.insert(sr_dn_level, loc, lo)
// keep size of the arrays = 5
if array.size(sr_strength) > maxnumsr
array.pop(sr_strength)
array.pop(sr_up_level)
array.pop(sr_dn_level)
for x = 1 to 10 by 1
line.delete(array.get(sr_lines, x))
label.delete(array.get(sr_labels, x))
for x = 0 to array.size(sr_up_level) > 0 ? array.size(sr_up_level) - 1 : na by 1
float mid = math.round_to_mintick((array.get(sr_up_level, x) + array.get(sr_dn_level, x)) / 2)
rate = 100 * (mid - close) / close
array.set(sr_labels, x + 1, label.new(x=bar_index + labelloc, y=mid, text=str.tostring(mid) + '(' + str.tostring(rate, '#.##') + '%)', color=mid >= close ? color.red : color.lime, textcolor=mid >= close ? color.white : color.black, style=mid >= close ? label.style_label_down : label.style_label_up))
array.set(sr_lines, x + 1, line.new(x1=bar_index, y1=mid, x2=bar_index - 1, y2=mid, extend=extend.both, color=mid >= close ? resistancecolor : supportcolor, style=Lstyle, width=linewidth))
f_crossed_over() =>
ret = false
for x = 0 to array.size(sr_up_level) > 0 ? array.size(sr_up_level) - 1 : na by 1
float mid = math.round_to_mintick((array.get(sr_up_level, x) + array.get(sr_dn_level, x)) / 2)
if close <= mid and close > mid
ret := true
ret
ret
f_crossed_under() =>
ret = false
for x = 0 to array.size(sr_up_level) > 0 ? array.size(sr_up_level) - 1 : na by 1
float mid = math.round_to_mintick((array.get(sr_up_level, x) + array.get(sr_dn_level, x)) / 2)
if close >= mid and close < mid
ret := true
ret
ret
alertcondition(f_crossed_over(), title='Resistance Broken', message='Resistance Broken')
alertcondition(f_crossed_under(), title='Support Broken', message='Support Broken')
AMDX/XAMD indicatorThe AMDX/XAMD indicator is designed to highlight specific trading sessions on the chart using distinct colors and optional vertical lines. Users can choose between two session types, AMDX or XAMD, and customize the visual appearance of the sessions. This tool is particularly useful for traders who want to analyze market behavior during different trading periods.
Meaning of AMDX:
A: Accumulation
M: Manipulation
D: Distribution
X: Continuation Or Reversal
Features:
Session Highlighting:
AMDX Sessions: Split into four segments - A, M, D, X.
XAMD Sessions: Split into four segments - X, A, M, D.
Customizable Colors:
Choose individual colors for each session (A, M, D, X).
Adjust the transparency of the session boxes for better visual integration with the chart.
Drawing Styles:
Box Style: Draws colored boxes around the session ranges.
Line Style: Draws vertical lines at session start and end times.
Vertical Lines:
Option to enable or disable vertical lines at session boundaries.
Customizable line style: Solid, Dotted, or Dashed.
Session Labels:
Automatically labels each session for easy identification.
Customization Options:
Session Type: Select between AMDX and XAMD session types.
Colors: Set custom colors for each session and vertical lines.
Border Width: Adjust the width of the session box borders.
Transparency: Control the transparency level of the session boxes.
Drawing Style: Choose between Box and Line styles for session representation.
Vertical Lines: Enable or disable vertical lines and select the line style.
How It Works:
The indicator calculates the start and end times for each session based on the selected session type (AMDX or XAMD). It then draws either boxes or lines to highlight these sessions on the chart. The indicator also includes options to draw vertical lines at the session boundaries and labels each session with a corresponding letter (A, M, D, X).
Use Cases:
Market Session Analysis: Easily identify and analyze market behavior during different trading sessions.
Intraday Trading: Helps intraday traders to focus on specific time segments of the trading day.
Visual Segmentation: Provides a clear visual segmentation of the trading day, aiding in better decision-making.
Times for AMDX/XAMD session:
A Session: 18:00 (previous day) to 03:00 (current day)
M Session: 03:00 to 09:00
D Session: 09:00 to 12:00
X Session: 12:00 to 18:00
Time for the XAMD session :
X Session: 18:00 (previous day) to 00:00 (current day)
A Session: 00:00 to 09:00
M Session: 09:00 to 12:00
D Session: 12:00 to 18:00
Time Zone PSenseiTitle: Time Zone PS Indicator
Author: Orlando Depablos
Description:
The Time Zone PS Indicator is a tool designed to help traders visualize different trading sessions on their charts. It allows users to specify three different trading sessions: the start of the day, the London session, and the New York (NYC) session. Each session is represented by a distinct color-coded background on the chart.
Features:
Customizable Sessions: Traders can define the start time and end time for each trading session according to their preference. This flexibility enables users to tailor the indicator to their specific trading strategies session time zones.
Session Display Control: Users have the option to choose whether they want to display each trading session on the chart. This feature allows for a clutter-free charting experience, where traders can focus on the sessions relevant to their analysis.
Visual Clarity: The indicator uses distinct colors for each trading session, making it easy for traders to differentiate between different time zones. This visual clarity aids in quickly identifying key trading periods throughout the day.
How to Use:
Setting Up Sessions: Use the input options to define the start and end times for the start of the day, the London session, and the NYC session. Adjust these values based on your trading preferences and time zone.
Display Preferences: Toggle the display options to choose which trading sessions you want to visualize on the chart. This allows for a customizable charting experience tailored to your specific needs.
Interpreting the Chart: Once configured, the indicator will display color-coded backgrounds on the chart corresponding to the defined trading sessions. Interpret these visual cues to identify key trading periods and plan your trading strategies accordingly.
Originality:
The Time Zone PS Indicator adds value to the TradingView community by providing traders with a customizable tool to visualize different trading sessions. While similar indicators exist, this script offers flexibility and ease of use, enhancing the charting experience for traders across various time zones.
Use Cases:
Session-Based Analysis: Traders can use the indicator to analyze price action within specific trading sessions, such as the London or NYC session, to identify potential trading opportunities.
Time Zone Adjustment: Traders operating in different time zones can adjust the indicator settings to align with their local trading hours, ensuring accurate visualization of relevant trading sessions.
Strategy Development: The indicator can aid in the development of trading strategies that capitalize on price movements during specific trading sessions, helping traders optimize their trading performance.
Chart Visualization:
The indicator provides a clear and concise visualization of different trading sessions on the chart. Each session is represented by a color-coded background, allowing traders to quickly identify key trading periods and make informed trading decisions.
Volume Profile [Makit0]VOLUME PROFILE INDICATOR v0.5 beta
Volume Profile is suitable for day and swing trading on stock and futures markets, is a volume based indicator that gives you 6 key values for each session: POC, VAH, VAL, profile HIGH, LOW and MID levels. This project was born on the idea of plotting the RTH sessions Value Areas for /ES in an automated way, but you can select between 3 different sessions: RTH, GLOBEX and FULL sessions.
Some basic concepts:
- Volume Profile calculates the total volume for the session at each price level and give us market generated information about what price and range of prices are the most traded (where the value is)
- Value Area (VA): range of prices where 70% of the session volume is traded
- Value Area High (VAH): highest price within VA
- Value Area Low (VAL): lowest price within VA
- Point of Control (POC): the most traded price of the session (with the most volume)
- Session HIGH, LOW and MID levels are also important
There are a huge amount of things to know of Market Profile and Auction Theory like types of days, types of openings, relationships between value areas and openings... for those interested Jim Dalton's work is the way to come
I'm in my 2nd trading year and my goal for this year is learning to daytrade the futures markets thru the lens of Market Profile
For info on Volume Profile: TV Volume Profile wiki page at www.tradingview.com
For info on Market Profile and Market Auction Theory: Jim Dalton's book Mind over markets (this is a MUST)
BE AWARE: this indicator is based on the current chart's time interval and it only plots on 1, 2, 3, 5, 10, 15 and 30 minutes charts.
This is the correlation table TV uses in the Volume Profile Session Volume indicator (from the wiki above)
Chart Indicator
1 - 5 1
6 - 15 5
16 - 30 10
31 - 60 15
61 - 120 30
121 - 1D 60
This indicator doesn't follow that correlation, it doesn't get the volume data from a lower timeframe, it gets the data from the current chart resolution.
FEATURES
- 6 key values for each session: POC (solid yellow), VAH (solid red), VAL (solid green), profile HIGH (dashed silver), LOW (dashed silver) and MID (dotted silver) levels
- 3 sessions to choose for: RTH, GLOBEX and FULL
- select the numbers of sessions to plot by adding 12 hours periods back in time
- show/hide POC
- show/hide VAH & VAL
- show/hide session HIGH, LOW & MID levels
- highlight the periods of time out of the session (silver)
- extend the plotted lines all the way to the right, be careful this can turn the chart unreadable if there are a lot of sessions and lines plotted
SETTINGS
- Session: select between RTH (8:30 to 15:15 CT), GLOBEX (17:00 to 8:30 CT) and FULL (17:00 to 15:15 CT) sessions. RTH by default
- Last 12 hour periods to show: select the deph of the study by adding periods, for example, 60 periods are 30 natural days and around 22 trading days. 1 period by default
- Show POC (Point of Control): show/hide POC line. true by default
- Show VA (Value Area High & Low): show/hide VAH & VAL lines. true by default
- Show Range (Session High, Low & Mid): show/hide session HIGH, LOW & MID lines. true by default
- Highlight out of session: show/hide a silver shadow over the non session periods. true by default
- Extension: Extend all the plotted lines to the right. false by default
HOW TO SETUP
BE AWARE THIS INDICATOR PLOTS ONLY IN THE FOLLOWING CHART RESOLUTIONS: 1, 2, 3, 5, 10, 15 AND 30 MINUTES CHARTS. YOU MUST SELECT ONE OF THIS RESOLUTIONS TO THE INDICATOR BE ABLE TO PLOT
- By default this indicator plots all the levels for the last RTH session within the last 12 hours, if there is no plot try to adjust the 12 hours periods until the seesion and the periods match
- For Globex/Full sessions just select what you want from the dropdown menu and adjust the periods to plot the values
- Show or hide the levels you want with the 3 groups: POC line, VA lines and Session Range lines
- The highlight and extension options are for a better visibility of the levels as POC or VAH/VAL
THANKS TO
@watsonexchange for all the help, ideas and insights on this and the last two indicators (Market Delta & Market Internals) I'm working on my way to a 'clean chart' but for me it's not an easy path
@PineCoders for all the amazing stuff they do and all the help and tools they provide, in special the Script-Stopwatch at that was key in lowering this indicator's execution time
All the TV and Pine community, open source and shared knowledge are indeed the best way to help each other
IF YOU REALLY LIKE THIS WORK, please send me a comment or a private message and TELL ME WHAT you trade, HOW you trade it and your FAVOURITE SETUP for pulling out money from the market in a consistent basis, I'm learning to trade (this is my 2nd year) and I need all the help I can get
GOOD LUCK AND HAPPY TRADING
ICT Opening Range Projections (tristanlee85)ICT Opening Range Projections
This indicator visualizes key price levels based on ICT's (Inner Circle Trader) "Opening Range" concept. This 30-minute time interval establishes price levels that the algorithm will refer to throughout the session. The indicator displays these levels, including standard deviation projections, internal subdivisions (quadrants), and the opening price.
🟪 What It Does
The Opening Range is a crucial 30-minute window where market algorithms establish significant price levels. ICT theory suggests this range forms the basis for daily price movement.
This script helps you:
Mark the high, low, and opening price of each session.
Divide the range into quadrants (premium, discount, and midpoint/Consequent Encroachment).
Project potential price targets beyond the range using configurable standard deviation multiples .
🟪 How to Use It
This tool aids in time-based technical analysis rooted in ICT's Opening Range model, helping you observe price interaction with algorithmic levels.
Example uses include:
Identifying early structural boundaries.
Observing price behavior within premium/discount zones.
Visualizing initial displacement from the range to anticipate future moves.
Comparing price reactions at projected standard deviation levels.
Aligning price action with significant times like London or NY Open.
Note: This indicator provides a visual framework; it does not offer trade signals or interpretations.
🟪 Key Information
Time Zone: New York time (ET) is required on your chart.
Sessions: Supports multiple sessions, including NY midnight, NY AM, NY PM, and three custom timeframes.
Time Interval: Supports multi-timeframe up to 15 minutes. Best used on a 1-minute chart for accuracy.
🟪 Session Options
The Opening Range interval is configurable for up to 6 sessions:
Pre-defined ICT Sessions:
NY Midnight: 12:00 AM – 12:30 AM ET
NY AM: 9:30 AM – 10:00 AM ET
NY PM: 1:30 PM – 2:00 PM ET
Custom Sessions:
Three user-defined start/end time pairs.
This example shows a custom session from 03:30 - 04:00:
🟪 Understanding the Levels
The Opening Price is the open of the first 1-minute candle within the chosen session.
At session close, the Opening Range is calculated using its High and Low . An optional swing-based mode uses swing highs/lows for range boundaries.
The range is divided into quadrants by its midpoint ( Consequent Encroachment or CE):
Upper Quadrant: CE to high (premium).
Lower Quadrant: Low to CE (discount).
These subdivisions help visualize internal range dynamics, where price often reacts during algorithmic delivery.
🟪 Working with Ranges
By default, the range is determined by the highest high and lowest low of the 30-minute session:
A range can also be determined by the highest/lowest swing points:
Quadrants outline the premium and discount of a range that price will reference:
Small ranges still follow the same algorithmic logic, but may be deemed insignificant for one's trading. These can be filtered in the settings by specifying a minimum ticks limit. In this example, the range is 42 ticks (10.5 points) but the indicator is configured for 80 ticks (20 points). We can select which levels will plot if the range is below the limit. Here, only the 00:00 opening price is plotted:
You may opt to include the range high/low, quadrants, and projections as well. This will plot a red (configurable) range bracket to indicate it is below the limit while plotting the levels:
🟪 Price Projections
Projections extend beyond the Opening Range using standard deviations, framing the market beyond the initial session and identifying potential targets. You define the standard deviation multiples (e.g., 1.0, 1.5, 2.0).
Both positive and negative extensions are displayed, symmetrically projected from the range's high and low.
The Dynamic Levels option plots only the next projection level once price crosses the previous extreme. For example, only the 0.5 STDEV level plots until price reaches it, then the 1.0 level appears, and so on. This continues up to your defined maximum projections, or indefinitely if standard deviations are set to 0.
This example shows dynamic levels for a total of 6 sessions, only 1 of which meet a configured minimum limit of 50 ticks:
Small ranges followed by significant displacement are impacted the most with the number of levels plotted. You may hide projections when configuring the minimum ticks.
A fixed standard deviation will plot levels in both directions, regardless of the price range. Here, we plot up to 3.0 which hiding projections for small ranges:
🟪 Legal Disclaimer
This indicator is provided for informational and educational purposes only. It is not financial advice, and should not be construed as a recommendation to buy or sell any financial instrument. Trading involves substantial risk, and you could lose a significant amount of money. Past performance is not indicative of future results. Always consult with a qualified financial professional before making any trading or investment decisions. The creators and distributors of this indicator assume no responsibility for your trading outcomes.
Custom V2 KillZone US / FVG / EMAThis indicator is designed for traders looking to analyze liquidity levels, opportunity zones, and the underlying trend across different trading sessions. Inspired by the ICT methodology, this tool combines analysis of Exponential Moving Averages (EMA), session management, and Fair Value Gap (FVG) detection to provide a structured and disciplined approach to trading effectively.
Indicator Features
Identifying the Underlying Trend with Two EMAs
The indicator uses two EMAs on different, customizable timeframes to define the underlying trend:
EMA1 (default set to a daily timeframe): Represents the primary underlying trend.
EMA2 (default set to a 4-hour timeframe): Helps identify secondary corrections or impulses within the main trend.
These two EMAs allow traders to stay aligned with the market trend by prioritizing trades in the direction of the moving averages. For example, if prices are above both EMAs, the trend is bullish, and long trades are favored.
Analysis of Market Sessions
The indicator divides the day into key trading sessions:
Asian Session
London Session
US Pre-Open Session
Liquidity Kill Session
US Kill Zone Session
Each session is represented by high and low zones as well as mid-lines, allowing traders to visualize liquidity levels reached during these periods. Tracking the price levels in different sessions helps determine whether liquidity levels have been "swept" (taken) or not, which is essential for ICT methodology.
Liquidity Signal ("OK" or "STOP")
A specific signal appears at the end of the "Liquidity Kill" session (just before the "US Kill Zone" session):
"OK" Signal: Indicates that liquidity conditions are favorable for trading the "US Kill Zone" session. This means that liquidity levels have been swept in previous sessions (Asian, London, US Pre-Open), and the market is ready for an opportunity.
"STOP" Signal: Indicates that it is not favorable to trade the "US Kill Zone" session, as certain liquidity conditions have not been met.
The "OK" or "STOP" signal is based on an analysis of the high and low levels from previous sessions, allowing traders to ensure that significant liquidity zones have been reached before considering positions in the "Kill Zone".
Detection of Fair Value Gaps (FVG) in the US Kill Zone Session
When an "OK" signal is displayed, the indicator identifies Fair Value Gaps (FVG) during the "US Kill Zone" session. These FVGs are areas where price may return to fill an "imbalance" in the market, making them potential entry points.
Bullish FVG: Detected when there is a bullish imbalance, providing a buying opportunity if conditions align with the underlying trend.
Bearish FVG: Detected when there is a bearish imbalance, providing a selling opportunity in the trend direction.
FVG detection aligns with the ICT Silver Bullet methodology, where these imbalance zones serve as probable entry points during the "US Kill Zone".
How to Use This Indicator
Check the Underlying Trend
Before trading, observe the two EMAs (daily and 4-hour) to understand the general market trend. Trades will be prioritized in the direction indicated by these EMAs.
Monitor Liquidity Signals After the Asian, London, and US Pre-Open Sessions
The high and low levels of each session help determine if liquidity has already been swept in these areas. At the end of the "Liquidity Kill" session, an "OK" or "STOP" label will appear:
"OK" means you can look for trading opportunities in the "US Kill Zone" session.
"STOP" means it is preferable not to take trades in the "US Kill Zone" session.
Look for Opportunities in the US Kill Zone if the Signal is "OK"
When the "OK" label is present, focus on the "US Kill Zone" session. Use the Fair Value Gaps (FVG) as potential entry points for trades based on the ICT methodology. The identified FVGs will appear as colored boxes (bullish or bearish) during this session.
Use ICT Methodology to Manage Your Trades
Follow the FVGs as potential reversal zones in the direction of the trend, and manage your positions according to your personal strategy and the rules of the ICT Silver Bullet method.
Customizable Settings
The indicator includes several customization options to suit the trader's preferences:
EMA: Length, source (close, open, etc.), and timeframe.
Market Sessions: Ability to enable or disable each session, with color and line width settings.
Liquidity Signals: Customization of colors for the "OK" and "STOP" labels.
FVG: Option to display FVGs or not, with customizable colors for bullish and bearish FVGs, and the number of bars for FVG extension.
-------------------------------------------------------------------------------------------------------------
Cet indicateur est conçu pour les traders souhaitant analyser les niveaux de liquidité, les zones d’opportunité, et la tendance de fond à travers différentes sessions de trading. Inspiré de la méthodologie ICT, cet outil combine l'analyse des moyennes mobiles exponentielles (EMA), la gestion des sessions de marché, et la détection des Fair Value Gaps (FVG), afin de fournir une approche structurée et disciplinée pour trader efficacement.
CANDLE RANGE THEORY (H1 Only)Hello traders.
This indicator identifies CRT candles
-Each candle is a range.
-Each candle has its own po3.
-Focus on specific times of the day. By recognizing the importance of time and price, we can capture high-quality trades. Together with HTF PD array, Look for 4-hour candles forming at specific times of the day. (1am - 5am - 9am EST)
-After the 1st candle, wait for the 2nd candle to clear the high/low of the 1st candle and then close inside the 1st candle range at a specific time (1-5-9) and look for entries in the LTF
Why choose 1 5 9 hours EST?
### **1. 1:00 AM (EST)**
- **Trading Session:** This is the time between the Tokyo (Asian) session and the Sydney (Australian) session. The Asian market is very active.
- **Characteristics:**
- Liquidity: Moderate, as only the Asian market is active.
- Volatility: Pairs involving JPY (Japanese Yen), AUD (Australian Dollar), and NZD (New Zealand Dollar) tend to have higher volatility.
- Trading Opportunities: Suitable for traders who like to trade trends or news in the Asian region.
- **Note:** Volatility may be lower than the London or New York session.
### **2. 5:00 AM (EST)**
- **Trading Session:** This is the time near the end of the Tokyo session and the London (European) session is about to open.
- **Characteristics:**
- Liquidity: Starts to increase due to the preparation of the European market.
- Volatility: This is the time between two trading sessions, there can be strong fluctuations, especially in major currency pairs such as EUR/USD, GBP/USD.
- Trading opportunities: Suitable for breakout trading strategies when liquidity increases.
- **Note:** The overlap between Tokyo and London can cause sudden fluctuations.
### **3. 9:00 AM (EST)**
- **Trading sessions:** This time is within the London session and near the beginning of the New York session.
- **Characteristics:**
- Liquidity: Very high, as this is the period between the two largest sessions – London and New York.
- Volatility: Extremely strong, especially for major currency pairs such as EUR/USD, GBP/USD, USD/JPY.
- Trading opportunities: Suitable for both news trading and trend trading, as this is the time when a lot of economic data is released (usually from the US or the European region).
- **Note:** High volatility can bring big profits, but also comes with high risks.
### **Summary of effects:**
- **1 AM (EST):** Moderate volatility, focusing on Asian currency pairs.
- **5 AM (EST):** Increased liquidity and volatility, suitable for breakout trading.
- **9 AM (EST):** High volatility and high liquidity, the best time for Forex trading.
==> How to trade, when the high/low of CRT is swept, move to LTF to wait for confirmation to enter the order
Only sell at high level and buy at discount price.
Find CE at specific important time. Trading CRT with HTF direction has better win rate.
The more inside bars, the higher the probability.
Place a partial and Move breakeven at 50% range.
Do a backtest and post your chart.
High Low Levels by JZCustom High Low Levels Indicator - features
Clearly plotted high and low levels for specific trading sessions. This indicator provides visual representations of key price levels during various trading periods. Below are the main features and benefits of this indicator:
1. Display high and low levels for each session
- previous day high/low: display the high and low from the previous day, giving you a better understanding of how the price moves compared to the prior day.
- asia, london, and custom sessions: track the high and low levels for the major trading sessions (asian and london) and two custom user-defined sessions.
2. Complete line and label customization
- custom line appearance: choose the color, line style (solid, dashed, dotted), and line thickness for each trading session. you can also decide if the lines should extend beyond the current price action.
- custom labels: define your own label texts for each custom session. this way, you can label the levels precisely and easily track price movements.
3. Define your own trading sessions
- add up to two custom sessions (custom and custom 2), which can be defined using precise start and end times (hour and minute).
- each custom session allows you to specify the label text for the high and low levels, enabling you to easily differentiate different parts of the day on the chart.
4. Clear and intuitive design
- grouped settings: all settings are grouped based on trading sessions, so you can easily customize every aspect of the visual representation.
- simple toggle on/off: you can easily enable or disable each line (previous day, asia, london, custom 1, custom 2). this allows you to keep your chart clean and focus only on the important levels you need at any moment.
5. Flexible time zones
- time zone settings: set the time zone (utc, europe/london, america/new_york, asia/tokyo) to properly align the timeframes for each level depending on the market you're focusing on.
6. Automatic cleanup of old lines and labels
- old levels removal: automatically remove old lines and labels to prevent clutter on your chart. this ensures that only current, relevant levels for each trading day or session are displayed.
7. Precise plotting and line extension
- accurate level markings: the indicator calculates the precise times when the high and low levels were reached and plots lines that visually represent these levels.
- line extension options: you have the option to extend the high/low lines beyond their point of calculation, which helps with identifying price action trends beyond the current period.
Dec 7, 2024
Release Notes
Changes and Improvements for Users:
1. Customizable Offset for Lines and Labels:
- A new input, `Line and Label Offset`, allows users to control how far the lines and their associated text labels extend. This ensures the labels and lines remain aligned and can be adjusted as needed.
2. Unified Offset Control:
- The same offset value is applied to all types of lines and labels (e.g., Previous Day High/Low, Asia High/Low, London High/Low, and custom sessions). Users can change this in one place to affect the entire script consistently.
3. Enhanced Flexibility:
- Users now have more control over the appearance and position of their lines and labels, making the indicator adaptable to different chart setups and personal preferences.
These updates aim to enhance user convenience and customization, ensuring a more tailored charting experience.
skThis Pine Script is an indicator designed to mark and highlight specific trading sessions on a TradingView chart. Here's a description of the script's functionality:
1. *Session Selection*: The script allows you to select a session time frame using the `session_input` input. The available options for session time frames are "D" (daily), "W" (weekly), "M" (monthly), "H" (hourly), "15" (15 minutes), "5" (5 minutes), and "1" (1 minute).
2. *Session Times*: You can specify the start and end times for three different trading sessions - CBDR (Central Bank Dealer Range), Asia, and London - using the corresponding input options. These times are specified in Indian Standard Time (IST).
3. *Time Calculation*: The script calculates the start and end times for each session based on the specified hours and minutes. It uses the `timestamp` function to create time objects for these sessions.
4. *Session Highlighting*: The script creates rectangles on the chart to highlight each session:
- CBDR Session: A gray rectangle is drawn during the CBDR session time.
- Asia Session: Another gray rectangle is drawn during the Asia session time.
- London Session: A green rectangle is drawn at the top of the chart during the London session time.
5. *Transparency*: The rectangles have a transparency level of 90%, allowing you to see the price data beneath them while still marking the sessions.
6. *Overlay*: The indicator is set to overlay on the price chart, so it doesn't obstruct the price data.
7. *Customization*: You can customize the session times and appearance by adjusting the input values in the settings panel of the indicator.
Overall, this script provides a visual way to identify and highlight specific trading sessions on your TradingView chart, helping traders understand price action in different market sessions.
Monday range by MatboomThe "Monday Range" Pine Script indicator calculates and displays the lowest and highest prices during a specified trading session, focusing on Mondays. Users can configure the trading session parameters, such as start and end times and time zone. The indicator visually highlights the session range on the chart by plotting the session low and high prices and applying a background color within the session period. The customizable days of the week checkboxes allow users to choose which days the indicator should consider for analysis.
Session Configuration:
session = input.session("0000-0000", title="Trading Session")
timeZone = input.string("UTC", title="Time Zone")
monSession = input.bool(true, title="Mon ", group="Trading Session", inline="d1")
tueSession = input.bool(true, title="Tue ", group="Trading Session", inline="d1")
Users can configure the trading session start and end times and the time zone.
Checkboxes for Monday (monSession) and Tuesday (tueSession) sessions are provided.
SessionLow and SessionHigh Functions:
SessionLow(sessionTime, sessionTimeZone=syminfo.timezone) => ...
SessionHigh(sessionTime, sessionTimeZone=syminfo.timezone) => ...
Custom functions to calculate the lowest (SessionLow) and highest (SessionHigh) prices during a specified trading session.
InSession Function:
InSession(sessionTimes, sessionTimeZone=syminfo.timezone) => ...
Determines if the current bar is inside the specified trading session.
Days of Week String and Session String:
sessionDays = ""
if monSession
sessionDays += "2"
if tueSession
sessionDays += "3"
tradingSession = session + ":" + sessionDays
Constructs a string representing the selected days of the week for the session.
Fetch Session Low and High:
sessLow = SessionLow(tradingSession, timeZone)
sessHigh = SessionHigh(tradingSession, timeZone)
Calls the custom functions to obtain the session low and high prices.
Plot Session Low and High and Background Color for Session
plot(sessLow, color=color.red, title="Session Low")
plot(sessHigh, color=color.red, title="Session Low")
bgcolor(InSession(tradingSession, timeZone) ? color.new(color.aqua, 90) : na)
Time of Day Background with Bar Count & TableDescription:
This indicator provides a comprehensive overview of market activity by dynamically displaying the time-of-day background and tracking bullish and bearish bar counts across different sessions. It also features a table summarizing the market performance for the last 7 days, segmented into four time-based sessions: Morning, Afternoon, Evening, and Night.
Key Features:
Time of Day Background:
The chart's background color changes based on the time of day:
Evening (12 AM - 6 AM) is shaded blue.
Morning (6 AM - 12 PM) is shaded aqua.
Afternoon (12 PM - 6 PM) is shaded yellow.
Night (6 PM - 12 AM) is shaded silver.
Bullish and Bearish Bar Counting:
It tracks the number of bullish (closing higher than opening) and bearish (closing lower than opening) candles.
The sum of the price differences (bullish minus bearish) for each session is displayed as a dynamic label, indicating overall market direction for each session.
Session Breakdown:
The chart is divided into four sessions, each lasting 6 hours (Morning, Afternoon, Evening, Night).
A new label is generated at the start of each session, indicating the bullish/bearish performance and the net difference in price movements for that session.
Historical Session Performance:
The indicator tracks and stores the performance for each session over the past 7 days.
A table is generated in the top-right corner of the chart, summarizing the performance for each session (Morning, Afternoon, Evening, Night) and the price changes for each of the past 7 days.
The values are color-coded to indicate positive (green) or negative (red) results.
Dynamic Table:
The table presents performance data for each time session over the past week with color-coded cells:
Green cells indicate positive performance.
Red cells indicate negative performance.
Empty cells represent no data for that session.
Use Case:
This indicator is useful for traders who want to track market activity and performance across different times of day and monitor how each session contributes to the overall market trend. It provides both visual insights (through background color) and numerical data (via the table) for better decision-making.
Settings:
The background color and session labels update automatically based on the time of day.
The table updates every day, tracking the performance of each session over the past week.
Trading IQ - ICT LibraryLibrary "ICTlibrary"
Used to calculate various ICT related price levels and strategies. An ongoing project.
Hello Coders!
This library is meant for sourcing ICT related concepts. While some functions might generate more output than you require, you can specify "Lite Mode" as "true" in applicable functions to slim down necessary inputs.
isLastBar(userTF)
Identifies the last bar on the chart before a timeframe change
Parameters:
userTF (simple int) : the timeframe you wish to calculate the last bar for, must be converted to integer using 'timeframe.in_seconds()'
Returns: bool true if bar on chart is last bar of higher TF, dalse if bar on chart is not last bar of higher TF
necessaryData(atrTF)
returns necessaryData UDT for historical data access
Parameters:
atrTF (float) : user-selected timeframe ATR value.
Returns: logZ. log return Z score, used for calculating order blocks.
method gradBoxes(gradientBoxes, idColor, timeStart, bottom, top, rightCoordinate)
creates neon like effect for box drawings
Namespace types: array
Parameters:
gradientBoxes (array) : an array.new() to store the gradient boxes
idColor (color)
timeStart (int) : left point of box
bottom (float) : bottom of box price point
top (float) : top of box price point
rightCoordinate (int) : right point of box
Returns: void
checkIfTraded(tradeName)
checks if recent trade is of specific name
Parameters:
tradeName (string)
Returns: bool true if recent trade id matches target name, false otherwise
checkIfClosed(tradeName)
checks if recent closed trade is of specific name
Parameters:
tradeName (string)
Returns: bool true if recent closed trade id matches target name, false otherwise
IQZZ(atrMult, finalTF)
custom ZZ to quickly determine market direction.
Parameters:
atrMult (float) : an atr multiplier used to determine the required price move for a ZZ direction change
finalTF (string) : the timeframe used for the atr calcuation
Returns: dir market direction. Up => 1, down => -1
method drawBos(id, startPoint, getKeyPointTime, getKeyPointPrice, col, showBOS, isUp)
calculates and draws Break Of Structure
Namespace types: array
Parameters:
id (array)
startPoint (chart.point)
getKeyPointTime (int) : the actual time of startPoint, simplystartPoint.time
getKeyPointPrice (float) : the actual time of startPoint, simplystartPoint.price
col (color) : color of the BoS line / label
showBOS (bool) : whether to show label/line. This function still calculates internally for other ICT related concepts even if not drawn.
isUp (bool) : whether BoS happened during price increase or price decrease.
Returns: void
method drawMSS(id, startPoint, getKeyPointTime, getKeyPointPrice, col, showMSS, isUp, upRejections, dnRejections, highArr, lowArr, timeArr, closeArr, openArr, atrTFarr, upRejectionsPrices, dnRejectionsPrices)
calculates and draws Market Structure Shift. This data is also used to calculate Rejection Blocks.
Namespace types: array
Parameters:
id (array)
startPoint (chart.point)
getKeyPointTime (int) : the actual time of startPoint, simplystartPoint.time
getKeyPointPrice (float) : the actual time of startPoint, simplystartPoint.price
col (color) : color of the MSS line / label
showMSS (bool) : whether to show label/line. This function still calculates internally for other ICT related concepts even if not drawn.
isUp (bool) : whether MSS happened during price increase or price decrease.
upRejections (array)
dnRejections (array)
highArr (array) : array containing historical highs, should be taken from the UDT "necessaryData" defined above
lowArr (array) : array containing historical lows, should be taken from the UDT "necessaryData" defined above
timeArr (array) : array containing historical times, should be taken from the UDT "necessaryData" defined above
closeArr (array) : array containing historical closes, should be taken from the UDT "necessaryData" defined above
openArr (array) : array containing historical opens, should be taken from the UDT "necessaryData" defined above
atrTFarr (array) : array containing historical atr values (of user-selected TF), should be taken from the UDT "necessaryData" defined above
upRejectionsPrices (array) : array containing up rejections prices. Is sorted and used to determine selective looping for invalidations.
dnRejectionsPrices (array) : array containing down rejections prices. Is sorted and used to determine selective looping for invalidations.
Returns: void
method getTime(id, compare, timeArr)
gets time of inputted price (compare) in an array of data
this is useful when the user-selected timeframe for ICT concepts is greater than the chart's timeframe
Namespace types: array
Parameters:
id (array) : the array of data to search through, to find which index has the same value as "compare"
compare (float) : the target data point to find in the array
timeArr (array) : array of historical times
Returns: the time that the data point in the array was recorded
method OB(id, highArr, signArr, lowArr, timeArr, sign)
store bullish orderblock data
Namespace types: array
Parameters:
id (array)
highArr (array) : array of historical highs
signArr (array) : array of historical price direction "math.sign(close - open)"
lowArr (array) : array of historical lows
timeArr (array) : array of historical times
sign (int) : orderblock direction, -1 => bullish, 1 => bearish
Returns: void
OTEstrat(OTEstart, future, closeArr, highArr, lowArr, timeArr, longOTEPT, longOTESL, longOTElevel, shortOTEPT, shortOTESL, shortOTElevel, structureDirection, oteLongs, atrTF, oteShorts)
executes the OTE strategy
Parameters:
OTEstart (chart.point)
future (int) : future time point for drawings
closeArr (array) : array of historical closes
highArr (array) : array of historical highs
lowArr (array) : array of historical lows
timeArr (array) : array of historical times
longOTEPT (string) : user-selected long OTE profit target, please create an input.string() for this using the example below
longOTESL (int) : user-selected long OTE stop loss, please create an input.string() for this using the example below
longOTElevel (float) : long entry price of selected retracement ratio for OTE
shortOTEPT (string) : user-selected short OTE profit target, please create an input.string() for this using the example below
shortOTESL (int) : user-selected short OTE stop loss, please create an input.string() for this using the example below
shortOTElevel (float) : short entry price of selected retracement ratio for OTE
structureDirection (string) : current market structure direction, this should be "Up" or "Down". This is used to cancel pending orders if market structure changes
oteLongs (bool) : input.bool() for whether OTE longs can be executed
atrTF (float) : atr of the user-seleceted TF
oteShorts (bool) : input.bool() for whether OTE shorts can be executed
@exampleInputs
oteLongs = input.bool(defval = false, title = "OTE Longs", group = "Optimal Trade Entry")
longOTElevel = input.float(defval = 0.79, title = "Long Entry Retracement Level", options = , group = "Optimal Trade Entry")
longOTEPT = input.string(defval = "-0.5", title = "Long TP", options = , group = "Optimal Trade Entry")
longOTESL = input.int(defval = 0, title = "How Many Ticks Below Swing Low For Stop Loss", group = "Optimal Trade Entry")
oteShorts = input.bool(defval = false, title = "OTE Shorts", group = "Optimal Trade Entry")
shortOTElevel = input.float(defval = 0.79, title = "Short Entry Retracement Level", options = , group = "Optimal Trade Entry")
shortOTEPT = input.string(defval = "-0.5", title = "Short TP", options = , group = "Optimal Trade Entry")
shortOTESL = input.int(defval = 0, title = "How Many Ticks Above Swing Low For Stop Loss", group = "Optimal Trade Entry")
Returns: void (0)
displacement(logZ, atrTFreg, highArr, timeArr, lowArr, upDispShow, dnDispShow, masterCoords, labelLevels, dispUpcol, rightCoordinate, dispDncol, noBorders)
calculates and draws dispacements
Parameters:
logZ (float) : log return of current price, used to determine a "significant price move" for a displacement
atrTFreg (float) : atr of user-seleceted timeframe
highArr (array) : array of historical highs
timeArr (array) : array of historical times
lowArr (array) : array of historical lows
upDispShow (int) : amount of historical upside displacements to show
dnDispShow (int) : amount of historical downside displacements to show
masterCoords (map) : a map to push the most recent displacement prices into, useful for having key levels in one data structure
labelLevels (string) : used to determine label placement for the displacement, can be inside box, outside box, or none, example below
dispUpcol (color) : upside displacement color
rightCoordinate (int) : future time for displacement drawing, best is "last_bar_time"
dispDncol (color) : downside displacement color
noBorders (bool) : input.bool() to remove box borders, example below
@exampleInputs
labelLevels = input.string(defval = "Inside" , title = "Box Label Placement", options = )
noBorders = input.bool(defval = false, title = "No Borders On Levels")
Returns: void
method getStrongLow(id, startIndex, timeArr, lowArr, strongLowPoints)
unshift strong low data to array id
Namespace types: array
Parameters:
id (array)
startIndex (int) : the starting index for the timeArr array of the UDT "necessaryData".
this point should start from at least 1 pivot prior to find the low before an upside BoS
timeArr (array) : array of historical times
lowArr (array) : array of historical lows
strongLowPoints (array) : array of strong low prices. Used to retrieve highest strong low price and see if need for
removal of invalidated strong lows
Returns: void
method getStrongHigh(id, startIndex, timeArr, highArr, strongHighPoints)
unshift strong high data to array id
Namespace types: array
Parameters:
id (array)
startIndex (int) : the starting index for the timeArr array of the UDT "necessaryData".
this point should start from at least 1 pivot prior to find the high before a downside BoS
timeArr (array) : array of historical times
highArr (array) : array of historical highs
strongHighPoints (array)
Returns: void
equalLevels(highArr, lowArr, timeArr, rightCoordinate, equalHighsCol, equalLowsCol, liteMode)
used to calculate recent equal highs or equal lows
Parameters:
highArr (array) : array of historical highs
lowArr (array) : array of historical lows
timeArr (array) : array of historical times
rightCoordinate (int) : a future time (right for boxes, x2 for lines)
equalHighsCol (color) : user-selected color for equal highs drawings
equalLowsCol (color) : user-selected color for equal lows drawings
liteMode (bool) : optional for a lite mode version of an ICT strategy. For more control over drawings leave as "True", "False" will apply neon effects
Returns: void
quickTime(timeString)
used to quickly determine if a user-inputted time range is currently active in NYT time
Parameters:
timeString (string) : a time range
Returns: true if session is active, false if session is inactive
macros(showMacros, noBorders)
used to calculate and draw session macros
Parameters:
showMacros (bool) : an input.bool() or simple bool to determine whether to activate the function
noBorders (bool) : an input.bool() to determine whether the box anchored to the session should have borders
Returns: void
po3(tf, left, right, show)
use to calculate HTF po3 candle
@tip only call this function on "barstate.islast"
Parameters:
tf (simple string)
left (int) : the left point of the candle, calculated as bar_index + left,
right (int) : :the right point of the candle, calculated as bar_index + right,
show (bool) : input.bool() whether to show the po3 candle or not
Returns: void
silverBullet(silverBulletStratLong, silverBulletStratShort, future, userTF, H, L, H2, L2, noBorders, silverBulletLongTP, historicalPoints, historicalData, silverBulletLongSL, silverBulletShortTP, silverBulletShortSL)
used to execute the Silver Bullet Strategy
Parameters:
silverBulletStratLong (simple bool)
silverBulletStratShort (simple bool)
future (int) : a future time, used for drawings, example "last_bar_time"
userTF (simple int)
H (float) : the high price of the user-selected TF
L (float) : the low price of the user-selected TF
H2 (float) : the high price of the user-selected TF
L2 (float) : the low price of the user-selected TF
noBorders (bool) : an input.bool() used to remove the borders from box drawings
silverBulletLongTP (series silverBulletLevels)
historicalPoints (array)
historicalData (necessaryData)
silverBulletLongSL (series silverBulletLevels)
silverBulletShortTP (series silverBulletLevels)
silverBulletShortSL (series silverBulletLevels)
Returns: void
method invalidFVGcheck(FVGarr, upFVGpricesSorted, dnFVGpricesSorted)
check if existing FVGs are still valid
Namespace types: array
Parameters:
FVGarr (array)
upFVGpricesSorted (array) : an array of bullish FVG prices, used to selective search through FVG array to remove invalidated levels
dnFVGpricesSorted (array) : an array of bearish FVG prices, used to selective search through FVG array to remove invalidated levels
Returns: void (0)
method drawFVG(counter, FVGshow, FVGname, FVGcol, data, masterCoords, labelLevels, borderTransp, liteMode, rightCoordinate)
draws FVGs on last bar
Namespace types: map
Parameters:
counter (map) : a counter, as map, keeping count of the number of FVGs drawn, makes sure that there aren't more FVGs drawn
than int FVGshow
FVGshow (int) : the number of FVGs to show. There should be a bullish FVG show and bearish FVG show. This function "drawFVG" is used separately
for bearish FVG and bullish FVG.
FVGname (string) : the name of the FVG, "FVG Up" or "FVG Down"
FVGcol (color) : desired FVG color
data (FVG)
masterCoords (map) : a map containing the names and price points of key levels. Used to define price ranges.
labelLevels (string) : an input.string with options "Inside", "Outside", "Remove". Determines whether FVG labels should be inside box, outside,
or na.
borderTransp (int)
liteMode (bool)
rightCoordinate (int) : the right coordinate of any drawings. Must be a time point.
Returns: void
invalidBlockCheck(bullishOBbox, bearishOBbox, userTF)
check if existing order blocks are still valid
Parameters:
bullishOBbox (array) : an array declared using the UDT orderBlock that contains bullish order block related data
bearishOBbox (array) : an array declared using the UDT orderBlock that contains bearish order block related data
userTF (simple int)
Returns: void (0)
method lastBarRejections(id, rejectionColor, idShow, rejectionString, labelLevels, borderTransp, liteMode, rightCoordinate, masterCoords)
draws rejectionBlocks on last bar
Namespace types: array
Parameters:
id (array) : the array, an array of rejection block data declared using the UDT rejection block
rejectionColor (color) : the desired color of the rejection box
idShow (int)
rejectionString (string) : the desired name of the rejection blocks
labelLevels (string) : an input.string() to determine if labels for the block should be inside the box, outside, or none.
borderTransp (int)
liteMode (bool) : an input.bool(). True = neon effect, false = no neon.
rightCoordinate (int) : atime for the right coordinate of the box
masterCoords (map) : a map that stores the price of key levels and assigns them a name, used to determine price ranges
Returns: void
method OBdraw(id, OBshow, BBshow, OBcol, BBcol, bullishString, bearishString, isBullish, labelLevels, borderTransp, liteMode, rightCoordinate, masterCoords)
draws orderblocks and breaker blocks for data stored in UDT array()
Namespace types: array
Parameters:
id (array) : the array, an array of order block data declared using the UDT orderblock
OBshow (int) : the number of order blocks to show
BBshow (int) : the number of breaker blocks to show
OBcol (color) : color of order blocks
BBcol (color) : color of breaker blocks
bullishString (string) : the title of bullish blocks, which is a regular bullish orderblock or a bearish orderblock that's converted to breakerblock
bearishString (string) : the title of bearish blocks, which is a regular bearish orderblock or a bullish orderblock that's converted to breakerblock
isBullish (bool) : whether the array contains bullish orderblocks or bearish orderblocks. If bullish orderblocks,
the array will naturally contain bearish BB, and if bearish OB, the array will naturally contain bullish BB
labelLevels (string) : an input.string() to determine if labels for the block should be inside the box, outside, or none.
borderTransp (int)
liteMode (bool) : an input.bool(). True = neon effect, false = no neon.
rightCoordinate (int) : atime for the right coordinate of the box
masterCoords (map) : a map that stores the price of key levels and assigns them a name, used to determine price ranges
Returns: void
FVG
UDT for FVG calcualtions
Fields:
H (series float) : high price of user-selected timeframe
L (series float) : low price of user-selected timeframe
direction (series string) : FVG direction => "Up" or "Down"
T (series int) : => time of bar on user-selected timeframe where FVG was created
fvgLabel (series label) : optional label for FVG
fvgLineTop (series line) : optional line for top of FVG
fvgLineBot (series line) : optional line for bottom of FVG
fvgBox (series box) : optional box for FVG
labelLine
quickly pair a line and label together as UDT
Fields:
lin (series line) : Line you wish to pair with label
lab (series label) : Label you wish to pair with line
orderBlock
UDT for order block calculations
Fields:
orderBlockData (array) : array containing order block x and y points
orderBlockBox (series box) : optional order block box
vioCount (series int) : = 0 violation count of the order block. 0 = Order Block, 1 = Breaker Block
traded (series bool)
status (series string) : = "OB" status == "OB" => Level is order block. status == "BB" => Level is breaker block.
orderBlockLab (series label) : options label for the order block / breaker block.
strongPoints
UDT for strong highs and strong lows
Fields:
price (series float) : price of the strong high or strong low
timeAtprice (series int) : time of the strong high or strong low
strongPointLabel (series label) : optional label for strong point
strongPointLine (series line) : optional line for strong point
overlayLine (series line) : optional lines for strong point to enhance visibility
overlayLine2 (series line) : optional lines for strong point to enhance visibility
displacement
UDT for dispacements
Fields:
highPrice (series float) : high price of displacement
lowPrice (series float) : low price of displacement
timeAtPrice (series int) : time of bar where displacement occurred
displacementBox (series box) : optional box to draw displacement
displacementLab (series label) : optional label for displacement
po3data
UDT for po3 calculations
Fields:
dHigh (series float) : higher timeframe high price
dLow (series float) : higher timeframe low price
dOpen (series float) : higher timeframe open price
dClose (series float) : higher timeframe close price
po3box (series box) : box to draw po3 candle body
po3line (array) : line array to draw po3 wicks
po3Labels (array) : label array to label price points of po3 candle
macros
UDT for session macros
Fields:
sessions (array) : Array of sessions, you can populate this array using the "quickTime" function located above "export macros".
prices (matrix) : Matrix of session data -> open, high, low, close, time
sessionTimes (array) : Array of session names. Pairs with array sessions.
sessionLines (matrix) : Optional array for sesion drawings.
OTEtimes
UDT for data storage and drawings associated with OTE strategy
Fields:
upTimes (array) : time of highest point before trade is taken
dnTimes (array) : time of lowest point before trade is taken
tpLineLong (series line) : line to mark tp level long
tpLabelLong (series label) : label to mark tp level long
slLineLong (series line) : line to mark sl level long
slLabelLong (series label) : label to mark sl level long
tpLineShort (series line) : line to mark tp level short
tpLabelShort (series label) : label to mark tp level short
slLineShort (series line) : line to mark sl level short
slLabelShort (series label) : label to mark sl level short
sweeps
UDT for data storage and drawings associated with liquidity sweeps
Fields:
upSweeps (matrix) : matrix containing liquidity sweep price points and time points for up sweeps
dnSweeps (matrix) : matrix containing liquidity sweep price points and time points for down sweeps
upSweepDrawings (array) : optional up sweep box array. Pair the size of this array with the rows or columns,
dnSweepDrawings (array) : optional up sweep box array. Pair the size of this array with the rows or columns,
raidExitDrawings
UDT for drawings associated with the Liquidity Raid Strategy
Fields:
tpLine (series line) : tp line for the liquidity raid entry
tpLabel (series label) : tp label for the liquidity raid entry
slLine (series line) : sl line for the liquidity raid entry
slLabel (series label) : sl label for the liquidity raid entry
m2022
UDT for data storage and drawings associated with the Model 2022 Strategy
Fields:
mTime (series int) : time of the FVG where entry limit order is placed
mIndex (series int) : array index of FVG where entry limit order is placed. This requires an array of FVG data, which is defined above.
mEntryDistance (series float) : the distance of the FVG to the 50% range. M2022 looks for the fvg closest to 50% mark of range.
mEntry (series float) : the entry price for the most eligible fvg
fvgHigh (series float) : the high point of the eligible fvg
fvgLow (series float) : the low point of the eligible fvg
longFVGentryBox (series box) : long FVG box, used to draw the eligible FVG
shortFVGentryBox (series box) : short FVG box, used to draw the eligible FVG
line50P (series line) : line used to mark 50% of the range
line100P (series line) : line used to mark 100% (top) of the range
line0P (series line) : line used to mark 0% (bottom) of the range
label50P (series label) : label used to mark 50% of the range
label100P (series label) : label used to mark 100% (top) of the range
label0P (series label) : label used to mark 0% (bottom) of the range
sweepData (array)
silverBullet
UDT for data storage and drawings associated with the Silver Bullet Strategy
Fields:
session (series bool)
sessionStr (series string) : name of the session for silver bullet
sessionBias (series string)
sessionHigh (series float) : = high high of session // use math.max(silverBullet.sessionHigh, high)
sessionLow (series float) : = low low of session // use math.min(silverBullet.sessionLow, low)
sessionFVG (series float) : if applicable, the FVG created during the session
sessionFVGdraw (series box) : if applicable, draw the FVG created during the session
traded (series bool)
tp (series float) : tp of trade entered at the session FVG
sl (series float) : sl of trade entered at the session FVG
sessionDraw (series box) : optional draw session with box
sessionDrawLabel (series label) : optional label session with label
silverBulletDrawings
UDT for trade exit drawings associated with the Silver Bullet Strategy
Fields:
tpLine (series line) : tp line drawing for strategy
tpLabel (series label) : tp label drawing for strategy
slLine (series line) : sl line drawing for strategy
slLabel (series label) : sl label drawing for strategy
unicornModel
UDT for data storage and drawings associated with the Unicorn Model Strategy
Fields:
hPoint (chart.point)
hPoint2 (chart.point)
hPoint3 (chart.point)
breakerBlock (series box) : used to draw the breaker block required for the Unicorn Model
FVG (series box) : used to draw the FVG required for the Unicorn model
topBlock (series float) : price of top of breaker block, can be used to detail trade entry
botBlock (series float) : price of bottom of breaker block, can be used to detail trade entry
startBlock (series int) : start time of the breaker block, used to set the "left = " param for the box
includes (array) : used to store the time of the breaker block, or FVG, or the chart point sequence that setup the Unicorn Model.
entry (series float) : // eligible entry price, for longs"math.max(topBlock, FVG.get_top())",
tpLine (series line) : optional line to mark PT
tpLabel (series label) : optional label to mark PT
slLine (series line) : optional line to mark SL
slLabel (series label) : optional label to mark SL
rejectionBlocks
UDT for data storage and drawings associated with rejection blocks
Fields:
rejectionPoint (chart.point)
bodyPrice (series float) : candle body price closest to the rejection point, for "Up" rejections => math.max(open, close),
rejectionBox (series box) : optional box drawing of the rejection block
rejectionLabel (series label) : optional label for the rejection block
equalLevelsDraw
UDT for data storage and drawings associated with equal highs / equal lows
Fields:
connector (series line) : single line placed at the first high or low, y = avgerage of distinguished equal highs/lows
connectorLab (series label) : optional label to be placed at the highs or lows
levels (array) : array containing the equal highs or lows prices
times (array) : array containing the equal highs or lows individual times
startTime (series int) : the time of the first high or low that forms a sequence of equal highs or lows
radiate (array) : options label to "radiate" the label in connector lab. Can be used for anything
necessaryData
UDT for data storage of historical price points.
Fields:
highArr (array) : array containing historical high points
lowArr (array) : array containing historical low points
timeArr (array) : array containing historical time points
logArr (array) : array containing historical log returns
signArr (array) : array containing historical price directions
closeArr (array) : array containing historical close points
binaryTimeArr (array) : array containing historical time points, uses "push" instead of "unshift" to allow for binary search
binaryCloseArr (array) : array containing historical close points, uses "push" instead of "unshift" to allow the correct
binaryOpenArr (array) : array containing historical optn points, uses "push" instead of "unshift" to allow the correct
atrTFarr (array) : array containing historical user-selected TF atr points
openArr (array) : array containing historical open points