Professional Documents
Culture Documents
// Session Bool
ShowLondon = input.bool (false, "", inline="LONDON",
group="Sessions", tooltip="01:00 to 05:00")
ShowNY = input.bool (false, "", inline="NY",
group="Sessions", tooltip="07:00 to 10:00")
ShowLC = input.bool (false, "", inline="LC",
group="Sessions", tooltip="10:00 to 12:00")
ShowPM = input.bool (false, "",inline="PM",
group="Sessions", tooltip="13:00 to 16:00")
ShowAsian = input.bool (false, "",inline="ASIA2",
group="Sessions", tooltip="20:00 to 00:00")
ShowFreeSesh = input.bool (false, "",inline="FREE",
group="Sessions", tooltip="Custom Session")
// Session Strings
txt2 = input.string ("LONDON", title="",
inline="LONDON", group="Sessions")
txt3 = input.string ("NEW YORK", title="", inline="NY",
group="Sessions")
txt4 = input.string ("LDN CLOSE", title="",
inline="LC", group="Sessions")
txt5 = input.string ("AFTERNOON", title="",
inline="PM", group="Sessions")
txt6 = input.string ("ASIA", title="", inline="ASIA2",
group="Sessions")
txt9 = input.string ("FREE SESH", title="",
inline="FREE", group="Sessions")
// Session Times
LDNsesh = input.session ('0200-0500:1234567', "",
inline="LONDON", group="Sessions")
NYsesh = input.session ('0700-1000:1234567', "",
inline="NY", group="Sessions")
LCsesh = input.session ('1000-1200:1234567', "",
inline="LC", group="Sessions")
PMsesh = input.session ('1300-1600:1234567', "",
inline="PM", group="Sessions")
ASIA2sesh = input.session ('2000-2359:1234567', "",
inline="ASIA2", group="Sessions")
FreeSesh = input.session ('0000-0000:1234567', "",
inline="FREE", group="Sessions")
// Session Color
LSFC = input.color (color.new(#787b86, 90), "",
inline="LONDON", group="Sessions")
NYSFC = input.color (color.new(#787b86, 90),
"",inline="NY", group="Sessions")
LCSFC = input.color (color.new(#787b86, 90),
"",inline="LC", group="Sessions")
PMSFC = input.color (color.new(#787b86, 90),
"",inline="PM", group="Sessions")
ASFC = input.color (color.new(#787b86, 90),
"",inline="ASIA2", group="Sessions")
FSFC = input.color (color.new(#787b86, 90),
"",inline="FREE", group="Sessions")
//----------------------------------------------
// Vertical LineStyle
Midnight_Open_LS = input.string ("Dotted", "", options=["Solid",
"Dashed", "Dotted"], inline="MOP", group="Vertical Lines")
london_Open_LS = input.string ("Solid", "", options=["Solid",
"Dashed", "Dotted"], inline="LOP", group="Vertical Lines")
NY_Open_LS = input.string ("Solid", "", options=["Solid",
"Dashed", "Dotted"], inline="NYOP", group="Vertical Lines")
Equities_Open_LS = input.string ("Solid", "", options=["Solid",
"Dashed", "Dotted"], inline="EOP", group="Vertical Lines")
// Vertical LineWidth
Midnight_Open_LW = input.string ("1px", "", options=["1px","2px",
"3px", "4px", "5px"], inline="MOP", group="Vertical Lines")
London_Open_LW = input.string ("1px", "", options=["1px","2px",
"3px", "4px", "5px"], inline="LOP", group="Vertical Lines")
NY_Open_LW = input.string ("1px", "", options=["1px","2px",
"3px", "4px", "5px"], inline="NYOP", group="Vertical Lines")
Equities_Open_LW = input.string ("1px", "", options=["1px","2px",
"3px", "4px", "5px"], inline="EOP", group="Vertical Lines")
//----------------------------------------------
//----------------------------------------------
// W&M Bool
ShowWeekOpen = input.bool (defval=false, title="",
tooltip="Draw Weekly Open Price Line", group="HTF Opening Price Lines",
inline="WO")
showMonthOpen = input.bool (defval=false, title="",
tooltip="Draw Monthly Open Price Line", group="HTF Opening Price Lines",
inline="MO")
// W&M String
txt19 = input.string ("WEEKLY", title="", inline="WO",
group="HTF Opening Price Lines")
txt20 = input.string ("MONTHLY", title="", inline="MO",
group="HTF Opening Price Lines")
// W&M Color
i_WeekOpenCol = input.color (title="",
defval=color.new(#787b86, 0), group="HTF Opening Price Lines", inline="WO")
i_MonthOpenCol = input.color (title="", tooltip="",
defval=color.new(#787b86, 0), group="HTF Opening Price Lines", inline="MO")
// W&M LineStyle
WOLS = input.string ("Dotted", "", options=["Solid",
"Dashed", "Dotted"], inline="WO", group="HTF Opening Price Lines")
MOLS = input.string ("Dotted", "", options=["Solid",
"Dashed", "Dotted"], inline="MO", group="HTF Opening Price Lines")
// W&M LineWidth
i_WOPLW = input.string ("1px", "", options=["1px","2px",
"3px", "4px", "5px"], inline="WO", group="HTF Opening Price Lines")
i_MONPLW = input.string ("1px", "", options=["1px","2px",
"3px", "4px", "5px"], inline="MO", group="HTF Opening Price Lines")
//----------------------------------------------
// Strings
txt0 = input.string ("CBDR", title="", inline="CBDR",
group="CBDR, ASIA & FLOUT", tooltip="16:00 to 20:00 \nSD Increments of 1")
txt1 = input.string ("ASIA", title="", inline="ASIA",
group="CBDR, ASIA & FLOUT", tooltip="20:00 to 00:00 \nSD Increments of 1")
txt7 = input.string ("FLOUT", title="", inline="FLOUT",
group="CBDR, ASIA & FLOUT", tooltip="16:00 to 00:00 \nSD Increments of 0.5")
// Color
CBDRBoxCol = input.color (color.new(#787b86, 0),"",
inline='CBDR', group="CBDR, ASIA & FLOUT")
ASIABoxCol = input.color (color.new(#787b86, 0), "",
inline='ASIA', group="CBDR, ASIA & FLOUT")
FLOUTBoxCol = input.color (color.new(#787b86, 0),"",
inline='FLOUT', group="CBDR, ASIA & FLOUT")
// Extras
box_text_cbdr = input.bool (true, "Show Text", inline="CBDR",
group="CBDR, ASIA & FLOUT")
box_text_cbdr_col = input.color (color.new(color.gray, 80), "",
inline="CBDR", group="CBDR, ASIA & FLOUT")
bool_cbdr_dev = input.bool (true, "SD", inline="CBDR",
group="CBDR, ASIA & FLOUT")
// Table
// SD Lines
ShowDevLN = input.bool (title="", defval=true,
inline="DEVLN", group="Standard Deviation", tooltip="Deviation Lines")
DEVLNTXT = input.string ("SD LINES", title="",
inline="DEVLN", group="Standard Deviation")
DevLNCol = input.color (color.new(#787b86, 0), "",
inline="DEVLN", group="Standard Deviation")
DEVLS = input.string ("Solid", "", options=["Solid",
"Dashed", "Dotted"], inline="DEVLN", group="Standard Deviation")
i_DEVLW = input.string ("1px", "", options=["1px","2px",
"3px", "4px", "5px"], inline="DEVLN", group="Standard Deviation")
DEVLSS = DEVLS=="Solid" ? line.style_solid : DEVLS == "Dotted" ?
line.style_dotted : line.style_dashed
DEVLW = i_DEVLW=="1px" ? 1 : i_DEVLW == "2px" ? 2 : i_DEVLW ==
"3px" ? 3 : i_DEVLW == "4px" ? 4 : 5
//----------------------------------------------
// Day Of Week & Labels
// Label Settings Inputs
ShowLabel = input.bool (true, title="", inline="Glabel",
group="Day Of Week & Labels")
txt21 = input.string ("LABEL", title="",
inline="Glabel", group="Day Of Week & Labels")
LabelColor = input.color (color.rgb(0,0,0,100), "",
inline="Glabel", group="Day Of Week & Labels")
LabelSizeInput = input.string ("Normal", "", options=["Auto",
"Tiny", "Small", "Normal", "Large", "Huge"], inline="Glabel", group="Day Of Week &
Labels")
Terminusinp = input.string ("Terminus @ Current Time +1hr",
"", options = ["Terminus @ Next Midnight","Terminus @ Current Time", "Terminus @
Current Time +15min", "Terminus @ Current Time +30min", "Terminus @ Current Time
+45min", "Terminus @ Current Time +1hr", "Terminus @ Current Time +2hr", "Terminus
@ Current Time +3hr"], inline="Glabel", group="Day Of Week & Labels",
tooltip="Select Label Size & Color & Terminus \nHistorical Price Lines needs to be
toggled off for using Terminus")
//--------------------END OF INPUTS--------------------//
// Pre-Def
DOM = (timeframe.multiplier <= inputMaxInterval) and
(timeframe.isintraday)
newDay = ta.change(dayofweek)
newWeek = ta.change(weekofyear)
newMonth = ta.change(time("M"))
transparentcol = color.rgb(255,255,255,100)
LSVLC = color.rgb(255,255,255,100)
NYSVLC = color.rgb(255,255,255,100)
PMSVLC = color.rgb(255,255,255,100)
ASVLC = color.rgb(255,255,255,100)
LSVLS = "dotted"
NYSVLS = "dotted"
PMSVLS = "dotted"
ASVLS = "dotted"
// Functions
isToday = false
if year(timenow) == year(time) and month(timenow) == month(time) and
dayofmonth(timenow) == dayofmonth(time)
isToday := true
// Current Week
thisweek = year(timenow) == year(time) and weekofyear(timenow) == weekofyear(time)
LastOneWeek = year(timenow) == year(time) and weekofyear(timenow-604800000) ==
weekofyear(time)
LastTwoWeek = year(timenow) == year(time) and weekofyear(timenow-1209600000) ==
weekofyear(time)
LastThreeWeek = year(timenow) == year(time) and weekofyear(timenow-1814400000) ==
weekofyear(time)
LastFourWeek = year(timenow) == year(time) and weekofyear(timenow-2419200000) ==
weekofyear(time)
Last4Weeks = false
if thisweek == true or LastOneWeek == true or LastTwoWeek == true or LastThreeWeek
== true or LastFourWeek == true
Last4Weeks := true
// Function for determining the Start of a Session (taken from the Pinescript
manual: https://www.tradingview.com/pine-script-docs/en/v5/concepts/Sessions.html )
SessionBegins(sess) =>
t = time("", sess , Timezone)
DOM and (not barstate.isfirst) and na(t[1]) and not na(t)
// BarIn Session
BarInSession(sess) =>
time(timeframe.period, sess, Timezone) != 0
// Time periods
CBDR = "1600-2000:1234567"
ASIA = "2000-0000:1234567"
FLOUT = "1600-0000:1234567"
midsesh = "0000-1600:1234567"
LabelOnlyToday = true
// Time Periods
LondonStartTime = timestamp(Timezone, year, month, dayofmonth,
SeshStartHour(LDNsesh), SeshStartMins(LDNsesh), 00)
LondonEndTime = timestamp(Timezone, year, month, dayofmonth,
SeshEndHour(LDNsesh), SeshEndMins(LDNsesh), 00)
NYStartTime = timestamp(Timezone, year, month, dayofmonth,
SeshStartHour(NYsesh), SeshStartMins(NYsesh), 00)
NYEndTime = timestamp(Timezone, year, month, dayofmonth,
SeshEndHour(NYsesh), SeshEndMins(NYsesh), 00)
LCStartTime = timestamp(Timezone, year, month, dayofmonth,
SeshStartHour(LCsesh), SeshStartMins(LCsesh), 00)
LCEndTime = timestamp(Timezone, year, month, dayofmonth,
SeshEndHour(LCsesh), SeshEndMins(LCsesh), 00)
// Terminus Function
Terminus(Terminus_Inp)=>
if Terminus_Inp == "Terminus @ Current Time"
_return = timenow
else if Terminus_Inp == "Terminus @ Current Time +15min"
_return = timenow + 900000
else if Terminus_Inp == "Terminus @ Current Time +30min"
_return = timenow + 1800000
else if Terminus_Inp == "Terminus @ Current Time +45min"
_return = timenow + 2700000
else if Terminus_Inp == "Terminus @ Current Time +1hr"
_return = timenow + 3600000
else if Terminus_Inp == "Terminus @ Current Time +2hr"
_return = timenow + 7200000
else
_return = timenow + 10800000
// Linestyle Function
MNOPLS = Midnight_Open_LS=="Solid" ? line.style_solid :
Midnight_Open_LS == "Dotted" ? line.style_dotted : line.style_dashed
LNOPLS = london_Open_LS=="Solid" ? line.style_solid :
london_Open_LS == "Dotted" ? line.style_dotted : line.style_dashed
NWYOPLS = NY_Open_LS=="Solid" ? line.style_solid : NY_Open_LS ==
"Dotted" ? line.style_dotted : line.style_dashed
EQOPLS = Equities_Open_LS=="Solid" ? line.style_solid :
Equities_Open_LS == "Dotted" ? line.style_dotted : line.style_dashed
// Linewidth Function
MOPLW = Midnight_Open_LW=="1px" ? 1 : Midnight_Open_LW == "2px" ?
2 : Midnight_Open_LW == "3px" ? 3 : Midnight_Open_LW == "4px" ? 4 : 5
LOPLW = London_Open_LW=="1px" ? 1 : London_Open_LW == "2px" ? 2 :
London_Open_LW == "3px" ? 3 : London_Open_LW == "4px" ? 4 : 5
NYOPLW = NY_Open_LW=="1px" ? 1 : NY_Open_LW == "2px" ? 2 :
NY_Open_LW == "3px" ? 3 : NY_Open_LW == "4px" ? 4 : 5
EOPLW = Equities_Open_LW=="1px" ? 1 : Equities_Open_LW == "2px" ?
2 : Equities_Open_LW == "3px" ? 3 : Equities_Open_LW == "4px" ? 4 : 5
// Creating Variables
var London_Start_Vline = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time,
y2=close, color=LSVLC, width=1)
var London_End_Vline = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time,
y2=close, color=LSVLC, width=1)
var LondonFill = linefill.new(London_Start_Vline, London_End_Vline, LSFC)
// London Close
if (ShowLC and DOM)
if ShowTSO
line.delete(LC_End_Vline[1])
linefill.delete(LCFill[1])
LC_Start_Vline := vline(LCStartTime, transparentcol, line.style_solid, 1)
LC_End_Vline := vline(LCEndTime, transparentcol, line.style_solid, 1)
if ShowSFill
LCFill := linefill.new(LC_Start_Vline, LC_End_Vline, LCSFC)
// PM Session
if (ShowPM and DOM)
if ShowTSO
line.delete(PM_Start_Vline[1])
line.delete(PM_End_Vline[1])
linefill.delete(PMFill[1])
PM_Start_Vline := vline(PMStartTime, transparentcol, line.style_solid, 1)
PM_End_Vline := vline(PMEndTime, transparentcol, line.style_solid, 1)
if ShowSFill
PMFill := linefill.new(PM_Start_Vline, PM_End_Vline, PMSFC)
// Asian Session
if (ShowAsian and DOM)
if ShowTSO
line.delete(Asian_Start_Vline[1])
line.delete(Asian_End_Vline[1])
linefill.delete(AsianFill[1])
Asian_Start_Vline := vline(AsianStartTime, transparentcol,
line.style_solid, 1)
Asian_End_Vline := vline(AsianEndTime, transparentcol, line.style_solid,
1)
// if dayofweek == dayofweek.friday
// // line.delete(Asian_Start_Vline)
// // line.delete(Asian_End_Vline)
// Asian_Start_Vline := vline(MidnightOpenTime+244800000,
transparentcol, line.style_solid, 1)
// Asian_End_Vline := vline(MidnightOpenTime+259200000,
transparentcol, line.style_solid, 1)
if ShowSFill
AsianFill := linefill.new(Asian_Start_Vline, Asian_End_Vline, ASFC)
// Free Session
if (ShowFreeSesh and DOM)
if ShowTSO
line.delete(Free_Start_Vline[1])
line.delete(Free_End_Vline[1])
linefill.delete(FreeFill[1])
Free_Start_Vline := vline(FreeStartTime, transparentcol, line.style_solid,
1)
Free_End_Vline := vline(FreeEndTime, transparentcol, line.style_solid, 1)
if ShowSFill
FreeFill := linefill.new(Free_Start_Vline, Free_End_Vline, FSFC)
// Variables
var label MOPLB = na
var line MOPLN = na
var label NYOPLB = na
var line NYOPLN = na
var label EOPLB = na
var line EOPLN = na
var line AFTLN = na
var label AFTLB = na
// HTF Variables
var Weekly_open = line.new(x1=na, y1=na, x2=na, xloc=xloc.bar_time, y2=close,
color=i_WeekOpenCol, style=WeekOpenLS, width=1)
var Weekly_openlbl = label.new(x=na, y=na, xloc=xloc.bar_time, color=LabelColor,
textcolor=LabelTextColor, style=label.style_label_left, size=LabelSize)
var WeeklyOpenTime = time
// Weekly Open
if newWeek
WeeklyOpenTime := time
// Monthly Open
if newMonth
MonthlyOpenTime := time
// CBDR Stuff
var float cbdr_hi = na
var float cbdr_lo = na
var float cbdr_diff = na
var box cbdrbox = na
var line cbdr_hi_line = na
var line cbdr_lo_line = na
var line dev01negline = na
var line dev02negline = na
var line dev03negline = na
var line dev04negline = na
var line dev01posline = na
var line dev02posline = na
var line dev03posline = na
var line dev04posline = na
// ASIA Stuff
var float asia_hi = na
var float asia_lo = na
var float asia_diff = na
var box asia_box = na
var line asia_hi_line = na
var line asia_lo_line = na
var line dev01negline_asia = na
var line dev02negline_asia = na
var line dev03negline_asia = na
var line dev04negline_asia = na
var line dev01posline_asia = na
var line dev02posline_asia = na
var line dev03posline_asia = na
var line dev04posline_asia = na
if SessionBegins(ASIA) and DOM
asia_hi := high
asia_lo := low
asia_diff := asia_hi - asia_lo
if ShowTSO
box.delete(asia_box[1])
line.delete(dev01posline_asia[1])
line.delete(dev01negline_asia[1])
line.delete(dev02posline_asia[1])
line.delete(dev02negline_asia[1])
line.delete(dev03posline_asia[1])
line.delete(dev03negline_asia[1])
line.delete(dev04posline_asia[1])
line.delete(dev04negline_asia[1])
if ShowASIA
asia_box := box.new(asiaOpenTime, asia_hi, asiaEndTime, asia_lo,
color.new(ASIABoxCol,90), 1, line.style_solid, extend.none, xloc.bar_time,
color.new(ASIABoxCol,90), txt1, size.auto, color.new(box_text_asia_col,80),
text_wrap=text.wrap_auto)
if box_text_asia == false
box.set_text(asia_box, "")
if ShowDev and ShowASIA and bool_asia_dev
for i = 1 to DevCount by 1
if i == 1
dev01posline_asia := line.new(asiaOpenTime, asia_hi + asia_diff *
i, asiaEndTime, asia_hi + asia_diff * i, xloc=xloc.bar_time, color=DevLNCol,
style=DEVLSS, width=DEVLW)
dev01negline_asia := line.new(asiaOpenTime, asia_hi - asia_diff *
i, asiaEndTime, asia_lo - asia_diff * i, xloc=xloc.bar_time, color=DevLNCol,
style=DEVLSS, width=DEVLW)
if i == 2
dev02posline_asia := line.new(asiaOpenTime, asia_hi + asia_diff *
i, asiaEndTime, asia_lo + asia_diff * i, xloc=xloc.bar_time, color=DevLNCol,
style=DEVLSS, width=DEVLW)
dev02negline_asia := line.new(asiaOpenTime, asia_hi - asia_diff *
i, asiaEndTime, asia_lo - asia_diff * i, xloc=xloc.bar_time, color=DevLNCol,
style=DEVLSS, width=DEVLW)
if i == 3
dev03posline_asia := line.new(asiaOpenTime, asia_hi + asia_diff *
i, asiaEndTime, asia_lo + asia_diff * i, xloc=xloc.bar_time, color=DevLNCol,
style=DEVLSS, width=DEVLW)
dev03negline_asia := line.new(asiaOpenTime, asia_hi - asia_diff *
i, asiaEndTime, asia_lo - asia_diff * i, xloc=xloc.bar_time, color=DevLNCol,
style=DEVLSS, width=DEVLW)
if i == 4
dev04posline_asia := line.new(asiaOpenTime, asia_hi + asia_diff *
i, asiaEndTime, asia_lo + asia_diff * i, xloc=xloc.bar_time, color=DevLNCol,
style=DEVLSS, width=DEVLW)
dev04negline_asia := line.new(asiaOpenTime, asia_hi - asia_diff *
i, asiaEndTime, asia_lo - asia_diff * i, xloc=xloc.bar_time, color=DevLNCol,
style=DEVLSS, width=DEVLW)
else if ASIATime
asia_hi := math.max(high, asia_hi)
asia_lo := math.min(low, asia_lo)
asia_diff := asia_hi - asia_lo
for i = 1 to DevCount by 1
if i == 1 and ShowDev
line.set_y1(dev01posline_asia, asia_hi + asia_diff * i)
line.set_y2(dev01posline_asia, asia_hi + asia_diff * i)
// FLOUT Stuff
var float flout_hi = na
var float flout_lo = na
var float flout_diff = na
var box floutbox = na
var line flout_hi_line = na
var line flout_lo_line = na
var line dev01negline_flout = na
var line dev02negline_flout = na
var line dev03negline_flout = na
var line dev04negline_flout = na
var line dev01posline_flout = na
var line dev02posline_flout = na
var line dev03posline_flout = na
var line dev04posline_flout = na
if SessionBegins(FLOUT) and DOM
flout_hi := high
flout_lo := low
flout_diff := flout_hi - flout_lo
if ShowTSO
box.delete(floutbox[1])
line.delete(dev01posline_flout[1])
line.delete(dev01negline_flout[1])
line.delete(dev02posline_flout[1])
line.delete(dev02negline_flout[1])
line.delete(dev03posline_flout[1])
line.delete(dev03negline_flout[1])
line.delete(dev04posline_flout[1])
line.delete(dev04negline_flout[1])
if ShowFLOUT
floutbox := box.new(floutOpenTime, flout_hi, floutEndTime, flout_lo,
color.new(FLOUTBoxCol,90), 1, line.style_solid, extend.none, xloc.bar_time,
color.new(FLOUTBoxCol,90), txt7, size.auto, color.new(box_text_flout_col,80),
text_wrap=text.wrap_auto)
if dayofweek == dayofweek.friday
box.set_right(floutbox, floutOpenTime+201600000)
line.set_x2(flout_hi_line, floutOpenTime+201600000)
line.set_x2(flout_lo_line, floutOpenTime+201600000)
if box_text_cbdr == false
box.set_text(floutbox, "")
if ShowDev and ShowFLOUT and bool_flout_dev
for i = 0.5 to DevCount by 0.5
if i == 0.5
dev01posline_flout := line.new(floutOpenTime, flout_hi + flout_diff
* i, floutEndTime, flout_hi + flout_diff * i, xloc=xloc.bar_time, color=DevLNCol,
style=DEVLSS, width=DEVLW)
dev01negline_flout := line.new(floutOpenTime, flout_hi - flout_diff
* i, floutEndTime, flout_lo - flout_diff * i, xloc=xloc.bar_time, color=DevLNCol,
style=DEVLSS, width=DEVLW)
if dayofweek == dayofweek.friday
line.set_x2(dev01posline_flout, floutOpenTime+201600000)
line.set_x2(dev01negline_flout, floutOpenTime+201600000)
if i == 1
dev02posline_flout := line.new(floutOpenTime, flout_hi + flout_diff
* i, floutEndTime, flout_lo + flout_diff * i, xloc=xloc.bar_time, color=DevLNCol,
style=DEVLSS, width=DEVLW)
dev02negline_flout := line.new(floutOpenTime, flout_hi - flout_diff
* i, floutEndTime, flout_lo - flout_diff * i, xloc=xloc.bar_time, color=DevLNCol,
style=DEVLSS, width=DEVLW)
if dayofweek == dayofweek.friday
line.set_x2(dev02posline_flout, floutOpenTime+201600000)
line.set_x2(dev02negline_flout, floutOpenTime+201600000)
if i == 1.5
dev03posline_flout := line.new(floutOpenTime, flout_hi + flout_diff
* i, floutEndTime, flout_lo + flout_diff * i, xloc=xloc.bar_time, color=DevLNCol,
style=DEVLSS, width=DEVLW)
dev03negline_flout := line.new(floutOpenTime, flout_hi - flout_diff
* i, floutEndTime, flout_lo - flout_diff * i, xloc=xloc.bar_time, color=DevLNCol,
style=DEVLSS, width=DEVLW)
if dayofweek == dayofweek.friday
line.set_x2(dev03posline_flout, floutOpenTime+201600000)
line.set_x2(dev03negline_flout, floutOpenTime+201600000)
if i == 2
dev04posline_flout := line.new(floutOpenTime, flout_hi + flout_diff
* i, floutEndTime, flout_lo + flout_diff * i, xloc=xloc.bar_time, color=DevLNCol,
style=DEVLSS, width=DEVLW)
dev04negline_flout := line.new(floutOpenTime, flout_hi - flout_diff
* i, floutEndTime, flout_lo - flout_diff * i, xloc=xloc.bar_time, color=DevLNCol,
style=DEVLSS, width=DEVLW)
if dayofweek == dayofweek.friday
line.set_x2(dev04posline_flout, floutOpenTime+201600000)
line.set_x2(dev04negline_flout, floutOpenTime+201600000)
else if FLOUTTime
flout_hi := math.max(high, flout_hi)
flout_lo := math.min(low, flout_lo)
flout_diff := flout_hi - flout_lo
for i = 0.5 to DevCount by 0.5
if i == 0.5 and ShowDev
line.set_y1(dev01posline_flout, flout_hi + flout_diff * i)
line.set_y2(dev01posline_flout, flout_hi + flout_diff * i)
// Start of Table
cbdrpipc = toWhole(cbdr_diff)
asiapipc = toWhole(asia_diff)
var color cbdr_cellt_col = na
var color asia_cellt_col = na
var color L_profile_col = na
// Table
var table ICTInfo = table.new(tabinp1, 2, 3, border_width=1)
if barstate.islast and syminfo.type == "forex" and Stats and DOM and (dayofweek !=
dayofweek.sunday)
CBDR_cell = "CBDR "
Asia_cell = "Asian Range "
CBDR_cell_pipc = " " + str.tostring(cbdrpipc) + " pips"
ASIA_cell_pipc = " " + str.tostring(asiapipc) + " pips"
if L_Prof == true
table.cell(ICTInfo, 0, 0, text=" Suggested SD ", bgcolor=CellBG,
text_color=Tab1txtCol, text_halign=text.align_left, text_size=size.auto)
table.cell(ICTInfo, 0, 1, text=" Asian Range ", bgcolor=CellBG,
text_color=Tab1txtCol, text_halign=text.align_left, text_size=size.auto)
table.cell(ICTInfo, 0, 2, text=" CBDR ", bgcolor=CellBG, text_color=Tab1txtCol,
text_halign=text.align_left, text_size=size.auto)
if L_Prof == true
table.cell(ICTInfo, 1, 0, text=" "+ L_Profile + " ", bgcolor=CellBG,
text_color=L_profile_col, text_halign=text.align_right, text_size=size.auto)
table.cell(ICTInfo, 1, 1, text=ASIA_cell_pipc, bgcolor=CellBG,
text_color=asia_cellt_col, text_size=size.auto, text_halign=text.align_right)
table.cell(ICTInfo, 1, 2, text=CBDR_cell_pipc, bgcolor=CellBG,
text_color=cbdr_cellt_col, text_size=size.auto, text_halign=text.align_right)
// Color Coding
var color Option1CC = na
var color Option2CC = na
var color Option3CC = na
var color Option4CC = na
if BIASOption1 == "Bullish"
Option1CC := comp_green
else if BIASOption1 == "Bearish"
Option1CC := comp_red
else
Option1CC := Tab2txtCol
if BIASOption2 == "Bullish"
Option2CC := comp_green
else if BIASOption2 == "Bearish"
Option2CC := comp_red
else
Option2CC := Tab2txtCol
if BIASOption3 == "Bullish"
Option3CC := comp_green
else if BIASOption3 == "Bearish"
Option3CC := comp_red
else
Option3CC := Tab2txtCol
if BIASOption4 == "Bullish"
Option4CC := comp_green
else if BIASOption4 == "Bearish"
Option4CC := comp_red
else
Option4CC := Tab2txtCol
plotchar(showDOW and DOM and ShowTWO and thisweek? hour == DOWTime and minute == 0
and dayofweek == dayofweek.monday : false, offset=0, char=" ", text=txtMon ,
color=color.new(i_DOWCol,100), location = DOWLoc, textcolor=i_DOWCol,
editable=false)
plotchar(showDOW and DOM and ShowTWO and thisweek? hour == DOWTime and minute == 0
and dayofweek == dayofweek.tuesday : false, offset=0, char=" ", text=txtTue ,
color=color.new(i_DOWCol,100), location = DOWLoc, textcolor=i_DOWCol,
editable=false)
plotchar(showDOW and DOM and ShowTWO and thisweek? hour == DOWTime and minute == 0
and dayofweek == dayofweek.wednesday : false, offset=0, char=" ", text=txtWed ,
color=color.new(i_DOWCol,100), location = DOWLoc, textcolor=i_DOWCol,
editable=false)
plotchar(showDOW and DOM and ShowTWO and thisweek? hour == DOWTime and minute == 0
and dayofweek == dayofweek.thursday : false, offset=0, char=" ", text=txtThu ,
color=color.new(i_DOWCol,100), location = DOWLoc, textcolor=i_DOWCol,
editable=false)
plotchar(showDOW and DOM and ShowTWO and thisweek? hour == DOWTime and minute == 0
and dayofweek == dayofweek.friday : false, offset=0, char=" ", text=txtFri ,
color=color.new(i_DOWCol,100), location = DOWLoc, textcolor=i_DOWCol,
editable=false)
plotchar(showDOW and DOM and (not ShowTWO) and (not SL4W)? hour == DOWTime and
minute == 0 and dayofweek == dayofweek.monday : false, offset=0, char=" ",
text=txtMon , color=color.new(i_DOWCol,100), location = DOWLoc,
textcolor=i_DOWCol, editable=false)
plotchar(showDOW and DOM and (not ShowTWO) and (not SL4W)? hour == DOWTime and
minute == 0 and dayofweek == dayofweek.tuesday : false, offset=0, char=" ",
text=txtTue , color=color.new(i_DOWCol,100), location = DOWLoc,
textcolor=i_DOWCol, editable=false)
plotchar(showDOW and DOM and (not ShowTWO) and (not SL4W)? hour == DOWTime and
minute == 0 and dayofweek == dayofweek.wednesday : false, offset=0, char=" ",
text=txtWed , color=color.new(i_DOWCol,100), location = DOWLoc,
textcolor=i_DOWCol, editable=false)
plotchar(showDOW and DOM and (not ShowTWO) and (not SL4W)? hour == DOWTime and
minute == 0 and dayofweek == dayofweek.thursday : false, offset=0, char=" ",
text=txtThu , color=color.new(i_DOWCol,100), location = DOWLoc,
textcolor=i_DOWCol, editable=false)
plotchar(showDOW and DOM and (not ShowTWO) and (not SL4W)? hour == DOWTime and
minute == 0 and dayofweek == dayofweek.friday : false, offset=0, char=" ",
text=txtFri , color=color.new(i_DOWCol,100), location = DOWLoc,
textcolor=i_DOWCol, editable=false)
if SL4W
Cleanup(SL4WC)
if ShowTWO
if dayofweek == dayofweek.monday
daycount := 0
if dayofweek == dayofweek.tuesday
daycount := 1
if dayofweek == dayofweek.wednesday
daycount := 2
if dayofweek == dayofweek.thursday
daycount := 3
if dayofweek == dayofweek.friday
daycount := 4
if dayofweek == dayofweek.saturday
daycount := 5
if dayofweek == dayofweek.sunday
daycount := 6
if ShowTWO
Cleanup(daycount)