OPEN-SOURCE SCRIPT
9:30 AM Open Percentage Lines

//version=5
indicator("9:30 AM Open Percentage Lines", overlay=true)
// Define the market open time in New York (or your local time zone if different)
// This is for 9:30 AM
var float opening_price = na
// Check if the current bar is the first one of the day at 9:30 AM
is_930_bar = (dayofweek == dayofweek.monday or dayofweek == dayofweek.tuesday or dayofweek == dayofweek.wednesday or dayofweek == dayofweek.thursday or dayofweek == dayofweek.friday) and hour(time("America/New_York")) == 9 and minute(time("America/New_York")) == 30
// On the first bar that meets the criteria, capture the opening price
if is_930_bar
opening_price := open
// Calculate the percentage levels based on the captured opening price
fivePercentAbove = opening_price * 1.05
sevenPercentAbove = opening_price * 1.07
twentySevenPercentAbove = opening_price * 1.27
// Plot the lines on the chart
// The `na` condition ensures the line is only plotted after the 9:30 AM bar has passed
plot(not na(opening_price) ? fivePercentAbove : na, title="5% Above 9:30 AM Open", color=color.new(color.rgb(255, 12, 12), 0), linewidth=2, trackprice=false)
plot(not na(opening_price) ? sevenPercentAbove : na, title="7% Above 9:30 AM Open", color=color.new(color.rgb(0, 150, 255), 0), linewidth=2, trackprice=false)
plot(not na(opening_price) ? twentySevenPercentAbove : na, title="27% Above 9:30 AM Open", color=color.new(color.rgb(255, 0, 0), 0), linewidth=2, trackprice=false)
indicator("9:30 AM Open Percentage Lines", overlay=true)
// Define the market open time in New York (or your local time zone if different)
// This is for 9:30 AM
var float opening_price = na
// Check if the current bar is the first one of the day at 9:30 AM
is_930_bar = (dayofweek == dayofweek.monday or dayofweek == dayofweek.tuesday or dayofweek == dayofweek.wednesday or dayofweek == dayofweek.thursday or dayofweek == dayofweek.friday) and hour(time("America/New_York")) == 9 and minute(time("America/New_York")) == 30
// On the first bar that meets the criteria, capture the opening price
if is_930_bar
opening_price := open
// Calculate the percentage levels based on the captured opening price
fivePercentAbove = opening_price * 1.05
sevenPercentAbove = opening_price * 1.07
twentySevenPercentAbove = opening_price * 1.27
// Plot the lines on the chart
// The `na` condition ensures the line is only plotted after the 9:30 AM bar has passed
plot(not na(opening_price) ? fivePercentAbove : na, title="5% Above 9:30 AM Open", color=color.new(color.rgb(255, 12, 12), 0), linewidth=2, trackprice=false)
plot(not na(opening_price) ? sevenPercentAbove : na, title="7% Above 9:30 AM Open", color=color.new(color.rgb(0, 150, 255), 0), linewidth=2, trackprice=false)
plot(not na(opening_price) ? twentySevenPercentAbove : na, title="27% Above 9:30 AM Open", color=color.new(color.rgb(255, 0, 0), 0), linewidth=2, trackprice=false)
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.