ICT NEWS MacroTracker
ICT NEWS MacroTracker
ICT NEWS MacroTracker
0
at https://mozilla.org/MPL/2.0/
// © toodegrees
import toodegrees/forex_factory_utility/14 as ffUtil
import toodegrees/forex_factory_decoding/15 as ffDec
//@version=5
indicator("Live Economic Calendar by toodegrees"
, shorttitle="News° [toodegrees]"
, overlay=true
, max_lines_count=500
, max_labels_count=500)
//#region[Timeframe Limitations]
if timeframe.in_seconds(timeframe.period)>86400
runtime.error("Go to the Daily Timeframe or lower!")
else if timeframe.in_seconds(timeframe.period)<30
runtime.error("Go to the 30-Second Timeframe or higher!")
//#endregion
requestData() =>
[request.seed("seed_toodegrees_toogit","TOODEGREES_FOREX_FACTORY_SLOT_1",str.tostri
ng(open)+","+str.tostring(high)+","+str.tostring(low)+","+str.tostring(close)
+","+str.tostring(volume)),
request.seed("seed_toodegrees_toogit","TOODEGREES_FOREX_FACTORY_SLOT_2",str.tostrin
g(open)+","+str.tostring(high)+","+str.tostring(low)+","+str.tostring(close)
+","+str.tostring(volume)),
request.seed("seed_toodegrees_toogit","TOODEGREES_FOREX_FACTORY_SLOT_3",str.tostrin
g(open)+","+str.tostring(high)+","+str.tostring(low)+","+str.tostring(close)
+","+str.tostring(volume)),
request.seed("seed_toodegrees_toogit","TOODEGREES_FOREX_FACTORY_SLOT_4",str.tostrin
g(open)+","+str.tostring(high)+","+str.tostring(low)+","+str.tostring(close)
+","+str.tostring(volume)),
request.seed("seed_toodegrees_toogit","TOODEGREES_FOREX_FACTORY_SLOT_5",str.tostrin
g(open)+","+str.tostring(high)+","+str.tostring(low)+","+str.tostring(close)
+","+str.tostring(volume)),
request.seed("seed_toodegrees_toogit","TOODEGREES_FOREX_FACTORY_SLOT_6",str.tostrin
g(open)+","+str.tostring(high)+","+str.tostring(low)+","+str.tostring(close)
+","+str.tostring(volume)),
request.seed("seed_toodegrees_toogit","TOODEGREES_FOREX_FACTORY_SLOT_7",str.tostrin
g(open)+","+str.tostring(high)+","+str.tostring(low)+","+str.tostring(close)
+","+str.tostring(volume)),
request.seed("seed_toodegrees_toogit","TOODEGREES_FOREX_FACTORY_SLOT_8",str.tostrin
g(open)+","+str.tostring(high)+","+str.tostring(low)+","+str.tostring(close)
+","+str.tostring(volume)),
request.seed("seed_toodegrees_toogit","TOODEGREES_FOREX_FACTORY_SLOT_9",str.tostrin
g(open)+","+str.tostring(high)+","+str.tostring(low)+","+str.tostring(close)
+","+str.tostring(volume))]
method processData(ffUtil.News[] N, string S1, string S2, string S3, string S4,
string S5, string S6, string S7, string S8, string S9) =>
ffDec.readNews(N,S1), ffDec.readNews(N,S2), ffDec.readNews(N,S3)
ffDec.readNews(N,S4), ffDec.readNews(N,S5), ffDec.readNews(N,S6)
ffDec.readNews(N,S7), ffDec.readNews(N,S8), ffDec.readNews(N,S9)
//#endregion
//#region[Tooltips]
var custom_timezoneTT = "The original Time and Date of the News is based on New
York EST. Adjust the Timezone "
+ "by matching this setting to the bottom-right Timezone
setting on your Chart."
var expectedImpactTT = "🔴 High Impact\n🟠 Medium Impact\n🟡 Low Impact\n⚪ Holiday"
var autoTT = "Automatically chooses the Currencies' News based on the
current symbol on Chart."
var onChartTT = "'Today'\nAll historical news will be deleted once a new
day starts, only the current day's news "
+ "will be shown on chart.\n\n'This Week'\nAll historical
news will be deleted once a new week "
+ "starts, only the current week's news will be shown on
chart.\n\n'Manual'\nWill show the current "
+ "week's upcoming news as well as the news in the prior
custom number of days (includes weekend days)."
var labelYTT = "'Auto' will place the label opposite to the candle's
direction."
var sizeTTT = "Depending on the Size of the News Table you will be able
to see a maximum number of Forex Factory "
+ "News events on the chart due to size limitations.\n\nThese
limits are roughly:\n'Tiny' ± 46 Forex "
+ "Factory News Events\n'Small' ± 38 Forex Factory News
Events\n'Normal' ± 28 Forex Factory News Events"
+ "\n'Large' ± 20 Forex Factory News Events\n'Huge' ± 11
Forex Factory News Events"
var tableHeadCTT = "Text Color - Backroung Color"
var tableRowCTT = "Past News Text Color - Future News Text Color - Backroung
Color"
//#endregion
//#region[User Input]
// Custom Timezone
custom_timezone = input.bool(false, title="Custom Timezone?", inline="1")
timezone_h = input.int(1 , title="UTC" , inline="1", minval=-
10, maxval=13)
timezone_m = input.int(0 , title=":" , inline="1", minval=0
, maxval=59, step=15, tooltip=custom_timezoneTT)
// Expected Impact
var high_impact = input.bool(true, title="🔴", group="Expected Impact", inline="1")
var med_impact = input.bool(true, title="🟠", group="Expected Impact", inline="1")
var low_impact = input.bool(true, title="🟡", group="Expected Impact", inline="1")
var holiday = input.bool(true, title="⚪", group="Expected Impact", inline="1",
tooltip=expectedImpactTT)
// Currencies
var AUTO = input.bool(true , title="Automatic?", group="Currencies",
tooltip=autoTT)
var AUD = input.bool(false, title="AUD" , group="Currencies", inline="1")
var CAD = input.bool(false, title="CAD" , group="Currencies", inline="1")
var CHF = input.bool(false, title="CHF" , group="Currencies", inline="1")
var CNY = input.bool(false, title="CNY" , group="Currencies", inline="2")
var EUR = input.bool(false, title="EUR" , group="Currencies", inline="2")
var GBP = input.bool(false, title="GBP" , group="Currencies", inline="2")
var JPY = input.bool(false, title="JPY " , group="Currencies", inline="3")
var NZD = input.bool(false, title="NZD" , group="Currencies", inline="3")
var USD = input.bool(false, title="USD" , group="Currencies", inline="3")
// On Chart
var onChartT = input.string("This Week", title="Chart
History ", group="News On Chart", inline="1", options=["Today", "This
Week", "Manual"])
var onChartLB = input.int(30 , title=""
, group="News On Chart", inline="1", tooltip=onChartTT)
var showLabels = input.bool(true , title="Show Labels?"
, group="News On Chart", inline="2")
var labelS = ffUtil.size(input.string("Normal" , title=""
, group="News On Chart", inline="2", options=["Tiny" , "Small", "Normal", "Large",
"Huge"]))
var labelY = input.string("Auto" , title=""
, group="News On Chart", inline="2", options=["Above", "Below", "Auto"] ,
tooltip=labelYTT)
var lblOutLn = input.bool(true , title="Outline?"
, group="News On Chart", inline="2")
var showLines = input.bool(true , title="Show Lines? "
, group="News On Chart", inline="3")
var lineTime = input.string("Future" , title=""
, group="News On Chart", inline="3", options=["Future", "Past+Future"])
var lineT = ffUtil.lineTrnsp(input.string("Heavy" , title=""
, group="News On Chart", inline="3", options=["Light" , "Medium", "Heavy"]))
var lineS = ffUtil.lineStyle(input.string("Solid" , title=""
, group="News On Chart", inline="3", options=["Dashed", "Dotted", "Solid"]))
// Table
var showTable = input.bool(true , title="Show?" , group="News
Table", inline="1")
var tableType = input.string("This Week", title="" , group="News
Table", inline="1", options=["Today", "This Week"])
var todType = input.string("24H" , title="" , group="News
Table", inline="1", options=["24H" , "AM/PM"])
var headTextC = input.color(#dee1e9 , title="Table Header" , group="News Table",
inline="2")
var headBgC = input.color(#283c70 , title="" , group="News Table",
inline="2", tooltip=tableHeadCTT)
var rowTextCP = input.color(#787b86 , title="Table News ", group="News Table",
inline="3")
var rowTextCF = input.color(#000000 , title="" , group="News Table",
inline="3")
var rowBgC = input.color(#dee1e9 , title="" , group="News Table",
inline="3", tooltip=tableRowCTT)
var tableX = input.string("Right" , title="" , group="News
Table", inline="4", options=["Left", "Center", "Right" ])
var tableY = input.string("Bottom" , title="" , group="News
Table", inline="4", options=["Top" , "Middle", "Bottom"])
var sizeT = input.string("Small" , title="" , group="News
Table", inline="4", options=["Tiny", "Small" , "Normal", "Large", "Huge"],
tooltip=sizeTTT)
ffUtil.historical(onChartLB,onChartT=="Today",onChartT=="This Week",lineTime)
//#endregion
//
// This source code is subject to the terms of the Mozilla Public License 2.0 at
https://mozilla.org/MPL/2.0/
// ©coldbrewrosh
//@version=5
indicator("ICT Everything @coldbrewrosh", overlay=true, max_lines_count=500,
max_labels_count=5, max_boxes_count=500)
// Session Bool
ShowLondon = input.bool (true, "", inline="LONDON",
group="Sessions", tooltip="01:00 to 05:00")
ShowNY = input.bool (true, "", inline="NY",
group="Sessions", tooltip="07:00 to 10:00")
ShowLC = input.bool (true, "", inline="LC",
group="Sessions", tooltip="10:00 to 12:00")
ShowPM = input.bool (true, "",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 SL4W and Last4Weeks and (not ShowTWO)? 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 SL4W and Last4Weeks and (not ShowTWO)? 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 SL4W and Last4Weeks and (not ShowTWO)? 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 SL4W and Last4Weeks and (not ShowTWO)? 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 SL4W and Last4Weeks and (not ShowTWO)? 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 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)