Vertical line and Opening Price

AdalWolf

New member
Hello Guys,
I am looking for a script for TOS that can put a vertical line at midnight NY time (custom Time zone even better) and a horizontal line for the opening price of midnight and 8:30 open. Are there any scripts similar to this? I do have script Trading View but I am not from the coding background so I can make it for TOS. Please help! Here are codes for Trading VIew:
https://www.tradingview.com/script/Pt0Kk3PV-ICT-NEW-YORK-MIDNIGHT-OPEN-AND-8-30-AM-OPEN/

Thank you in Advance🙏🏻
@FutureTony
 
Last edited by a moderator:
Solution
Great indicator, instead of the open can it be made to plot the line at the close at first 930 bar, and can the line agg on the 15min agg and yet show on a 5 min agg. chart

Here is 15m close @0930 on a 5m chart with a vertical line @0930. The line on the 5m moves until the 15m opening bar closes

Screenshot 2024-01-26 151505.png
Code:
#Midnight_Vertical_Open_830_Vertical_Open
input openingTime1 = 0930;
input openingTime2 = 0930;
input agg          = AggregationPeriod.FIFTEEN_MIN;
input showvertical = yes;
input showbubble   = yes;


def sec1 = SecondsFromTime(openingTime1);
def sec2 = SecondsFromTime(openingTime2);
def isTime1 = (sec1 >= 0 and sec1[1] < 0) or (sec1 < sec1[1] and sec1 >= 0);
def isTime2 = (sec2 >= 0 and sec2[1] < 0) or (sec2 <...
Great indicator, instead of the open can it be made to plot the line at the close at first 930 bar, and can the line agg on the 15min agg and yet show on a 5 min agg. chart

Here is 15m close @0930 on a 5m chart with a vertical line @0930. The line on the 5m moves until the 15m opening bar closes

Screenshot 2024-01-26 151505.png
Code:
#Midnight_Vertical_Open_830_Vertical_Open
input openingTime1 = 0930;
input openingTime2 = 0930;
input agg          = AggregationPeriod.FIFTEEN_MIN;
input showvertical = yes;
input showbubble   = yes;


def sec1 = SecondsFromTime(openingTime1);
def sec2 = SecondsFromTime(openingTime2);
def isTime1 = (sec1 >= 0 and sec1[1] < 0) or (sec1 < sec1[1] and sec1 >= 0);
def isTime2 = (sec2 >= 0 and sec2[1] < 0) or (sec2 < sec2[1] and sec2 >= 0);

def  cl1   = if isTime1 then close(period = agg) else cl1[1];
plot close1 = cl1;
close1.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

AddVerticalLine(showvertical and isTime1, " ", close1.TakeValueColor(), Curve.FIRM);

input bubblemover = 2;
def   b = bubblemover;

AddChartBubble(showbubble and IsNaN(close[b]) and !IsNaN(close[b + 1]), close1[b + 1], agg / 60000 + "m \nClose\n@" + openingTime1 + "\n" + AsText(close1[b + 1]), close1.TakeValueColor());

#
 
Solution

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
448 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top