Intra Day Trend Potential Vertical Lines & Shading

Drum Rocker

Member
VIP
I have been trying to figure out the code for this but got stuck and need help. Based on the chart below, I would love to have these times marked with vertical lines with a label. Or what might also be cool is to have a color bar at the bottom of the price chart spread over these time frames with a label for the trend potential. Whichever is easier.

For example, dashed vertical lines at 9:30 with text that says "Medium Trend". The 10:00 line would say "Very High Trend". The 11:30 would say "Low Trend". And so on. I don't need anything for Risk and Volume as noted in the chart below. I trade in Central Standard Time if that matters.

Here is the code I started but the time's not setting correctly.

Thanks for any assistance.

Code:
#
input targetTime830 = 830;
def targetBar830 = SecondsFromTime(targetTime830) == 0;

input targetTime1000 = 1000;
def targetBar1000 = SecondsFromTime(targetTime1000) == 0;
AddVerticalLine(targetBar1000, "VERY HIGH TREND TIME", Color.GREEN);

input targetTime1430 = 1430;
def targetBar1430 = SecondsFromTime(targetTime1430) == 0;
AddVerticalLine(targetBar1430, "HIGH TREND TIME", Color.WHITE);

Time of day.jpg

Code:
 
Last edited by a moderator:
Solution
This sample script has what you need. Just change the time and placeholder text to your liking.

Code:
#
input targetTime830 = 830;
def targetBar830 = SecondsFromTime(targetTime830) == 0;
AddVerticalLine(targetBar830, "DATA DROP", Color.WHITE);

input targetTime930 = 930;
def targetBar930 = SecondsFromTime(targetTime930) == 0;
AddVerticalLine(targetBar930, "OPEN", Color.WHITE);

input targetTime1120 = 1120;
def targetBar1120 = SecondsFromTime(targetTime1120) == 0;
AddVerticalLine(targetBar1120, "EUROPE CLOSING SOON", Color.WHITE);

input targetTime1358 = 1358;
def targetBar1358 = SecondsFromTime(targetTime1358) == 0;
AddVerticalLine(targetBar1358, "2PM INCOMING", Color.WHITE);

input targetTime1540 = 1540;
def targetBar1540 =...
This sample script has what you need. Just change the time and placeholder text to your liking.

Code:
#
input targetTime830 = 830;
def targetBar830 = SecondsFromTime(targetTime830) == 0;
AddVerticalLine(targetBar830, "DATA DROP", Color.WHITE);

input targetTime930 = 930;
def targetBar930 = SecondsFromTime(targetTime930) == 0;
AddVerticalLine(targetBar930, "OPEN", Color.WHITE);

input targetTime1120 = 1120;
def targetBar1120 = SecondsFromTime(targetTime1120) == 0;
AddVerticalLine(targetBar1120, "EUROPE CLOSING SOON", Color.WHITE);

input targetTime1358 = 1358;
def targetBar1358 = SecondsFromTime(targetTime1358) == 0;
AddVerticalLine(targetBar1358, "2PM INCOMING", Color.WHITE);

input targetTime1540 = 1540;
def targetBar1540 = SecondsFromTime(targetTime1540) == 0;
AddVerticalLine(targetBar1540, "CLOSE IN 5 MINS", Color.RED);
#

Credit: https://usethinkscript.com/threads/vertical-line-at-intraday-times-for-thinkorswim.17856/
 

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

This sample script has what you need. Just change the time and placeholder text to your liking.

Code:
#
input targetTime830 = 830;
def targetBar830 = SecondsFromTime(targetTime830) == 0;
AddVerticalLine(targetBar830, "DATA DROP", Color.WHITE);

input targetTime930 = 930;
def targetBar930 = SecondsFromTime(targetTime930) == 0;
AddVerticalLine(targetBar930, "OPEN", Color.WHITE);

input targetTime1120 = 1120;
def targetBar1120 = SecondsFromTime(targetTime1120) == 0;
AddVerticalLine(targetBar1120, "EUROPE CLOSING SOON", Color.WHITE);

input targetTime1358 = 1358;
def targetBar1358 = SecondsFromTime(targetTime1358) == 0;
AddVerticalLine(targetBar1358, "2PM INCOMING", Color.WHITE);

input targetTime1540 = 1540;
def targetBar1540 = SecondsFromTime(targetTime1540) == 0;
AddVerticalLine(targetBar1540, "CLOSE IN 5 MINS", Color.RED);
#

Credit: https://usethinkscript.com/threads/vertical-line-at-intraday-times-for-thinkorswim.17856/
Thank you @BenTen

For anyone else that would like to use this here is the code:

Code:
#
input targetTime930 = 930;
def targetBar930 = SecondsFromTime(targetTime930) == 0;
AddVerticalLine(targetBar930, "MEDIUM TREND", Color.WHITE);

input targetTime1000 = 1000;
def targetBar1000 = SecondsFromTime(targetTime1000) == 0;
AddVerticalLine(targetBar1000, "VERY HIGH TREND", Color.WHITE);

input targetTime1130 = 1130;
def targetBar1130 = SecondsFromTime(targetTime1130) == 0;
AddVerticalLine(targetBar1130, "LOW TREND", Color.RED);

input targetTime1330 = 1330;
def targetBar1330 = SecondsFromTime(targetTime1330) == 0;
AddVerticalLine(targetBar1330, "MEDIUM TREND", Color.WHITE);

input targetTime1430 = 1430;
def targetBar1430 = SecondsFromTime(targetTime1430) == 0;
AddVerticalLine(targetBar1430, "HIGH TREND", Color.WHITE);
#
 
Last edited by a moderator:
Solution

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
577 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