OPEN-SOURCE SCRIPT
NY Session Open/Close

//version=5
indicator("New York Session Open/Close (Thin Lines)", overlay=true)
// Define the New York session open and close times (adjust for DST if necessary)
ny_open_time = timestamp("GMT-4", year, month, dayofmonth, 9, 30) // New York open at 9:30 AM EST
ny_close_time = timestamp("GMT-4", year, month, dayofmonth, 16, 0) // New York close at 4:00 PM EST
// Variables to store the open and close prices
var float ny_open_price = na
var float ny_close_price = na
// Plot thin vertical line for New York session open
if (time == ny_open_time)
ny_open_price := close
line.new(x1=bar_index, y1=low, x2=bar_index, y2=high, color=color.new(color.green, 0), width=1, extend=extend.both)
label.new(x=bar_index, y=ny_open_price, text="NY Open: " + str.tostring(ny_open_price), color=color.green, textcolor=color.white, style=label.style_label_down, yloc=yloc.price)
// Plot thin vertical line for New York session close
if (time == ny_close_time)
ny_close_price := close
line.new(x1=bar_index, y1=low, x2=bar_index, y2=high, color=color.new(color.red, 0), width=1, extend=extend.both)
label.new(x=bar_index, y=ny_close_price, text="NY Close: " + str.tostring(ny_close_price), color=color.red, textcolor=color.white, style=label.style_label_up, yloc=yloc.price)
indicator("New York Session Open/Close (Thin Lines)", overlay=true)
// Define the New York session open and close times (adjust for DST if necessary)
ny_open_time = timestamp("GMT-4", year, month, dayofmonth, 9, 30) // New York open at 9:30 AM EST
ny_close_time = timestamp("GMT-4", year, month, dayofmonth, 16, 0) // New York close at 4:00 PM EST
// Variables to store the open and close prices
var float ny_open_price = na
var float ny_close_price = na
// Plot thin vertical line for New York session open
if (time == ny_open_time)
ny_open_price := close
line.new(x1=bar_index, y1=low, x2=bar_index, y2=high, color=color.new(color.green, 0), width=1, extend=extend.both)
label.new(x=bar_index, y=ny_open_price, text="NY Open: " + str.tostring(ny_open_price), color=color.green, textcolor=color.white, style=label.style_label_down, yloc=yloc.price)
// Plot thin vertical line for New York session close
if (time == ny_close_time)
ny_close_price := close
line.new(x1=bar_index, y1=low, x2=bar_index, y2=high, color=color.new(color.red, 0), width=1, extend=extend.both)
label.new(x=bar_index, y=ny_close_price, text="NY Close: " + str.tostring(ny_close_price), color=color.red, textcolor=color.white, style=label.style_label_up, yloc=yloc.price)
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.