Globex Time Vertical Lines

MBF

MBF

Active member
2019 Donor
I saw somewhere a while ago, I think it was @horserider who had a Globex open and close vertical on their charts. Can anyone point me in the right direction?
 
markos

markos

Well-known member
VIP
Hi MBF, I don't get here much lately. Use the format below as a template to put the Globex open / close on your chart.
# Time Reminders
AddVerticalLine(secondsTillTime(0930) == 0, "RTH", color.cyan, Curve.Short_Dash);
AddVerticalLine(secondsTillTime(1030) == 0, "End EU", color.cyan, Curve.Short_Dash);
AddVerticalLine(secondsTillTime(1200) == 0, "Lunch", color.cyan, Curve.Short_Dash);
AddVerticalLine(secondsTillTime(1500) == 0, "Lst Hr", color.cyan, Curve.Short_Dash);
AddVerticalLine(secondsTillTime(1615) == 0, "RTH End", color.cyan, Curve.Short_Dash);
 
MBF

MBF

Active member
2019 Donor
@markos Thank you Markos, really helpful. :::hat tip:::
 
S

steve123

New member
Hello everyone - does anyone know of a script that will draw a vertical line on the chart at the same time everyday?
 
S

steve123

New member
Hi MBF, I don't get here much lately. Use the format below as a template to put the Globex open / close on your chart.
# Time Reminders
AddVerticalLine(secondsTillTime(0930) == 0, "RTH", color.cyan, Curve.Short_Dash);
AddVerticalLine(secondsTillTime(1030) == 0, "End EU", color.cyan, Curve.Short_Dash);
AddVerticalLine(secondsTillTime(1200) == 0, "Lunch", color.cyan, Curve.Short_Dash);
AddVerticalLine(secondsTillTime(1500) == 0, "Lst Hr", color.cyan, Curve.Short_Dash);
AddVerticalLine(secondsTillTime(1615) == 0, "RTH End", color.cyan, Curve.Short_Dash);

Awesome markos - works nicely, thank you!
 
A

atlanticshark

New member
Basically I would like to paint the background of the chart areas to a lighter shade or draw some vertical lines around the start and end of a certain range of hours. Let's say for instance its US trading hours. This is for a visual aid, and also to help me ignore signals when outside a given range. Is there a good example of this anywhere?
 
J

Jtru94

New member
Hello.

I am trying to figure out how to plot a vertical line (AddVerticalLine()) for a specific day of the week and time. For example, if I hypothetically wanted to automatically plot a line for every Monday at 3pm, what would that look like?

I tried:

def example = GetDayofWeek(1) + SecondsTillTime(1500) == 0;
AddVerticalLine(example, "", Color.BLUE, Curve.firm);

but it only plots a line every day at 3pm rather than every Monday at 3pm.

Any ideas?
 
Picard

Picard

New member
I need help to make code to plot vertical lines at specific intervals like 88 days starting at a specific date like March 21, 2019. The vertical lines at the 88 day intervals should continue indefinitely. How can this be done?
 
R

Roycar71

New member
Is there script that can highlight reversal times based of this script

Code:
//Created By ChrisMoody on 9-14-2014 To plot Background Highlights for Recurring Times
//Edited by TS2 with static time frame inspirations from TraderMentatlity: http://www.tradermentality.com/2016/02/intraday-reversal-times.html

study(title="TS2_Intraday_Times", shorttitle="TS2_Intraday_Times",overlay=true)

use1 = input(true, title="Show 9:50-10:10")
use2 = input(true, title="Show 10:25-10:35")
use3 = input(true, title="Show 11:15")
use4 = input(true, title="Show 12:00")
use5 = input(true, title="Show 12:45")
use6 = input(true, title="Show 1:30")
use7 = input(true, title="Show 2:15")
use8 = input(true, title="Show 3:00")
use9 = input(true, title="Show 3:30")

sess1 = '0950-1010'
sess2 = '1025-1035'
sess3 = '1115-1116'
sess4 = '1200-1201'
sess5 = '1245-1246'
sess6 = '1330-1331'
sess7 = '1415-1416'
sess8 = '1500-1501'
sess9 = '1530-1531'

bgPlot1 = time(period, sess1)
bgPlot2 = time(period, sess2)
bgPlot3 = time(period, sess3)
bgPlot4 = time(period, sess4)
bgPlot5 = time(period, sess5)
bgPlot6 = time(period, sess6)
bgPlot7 = time(period, sess7)
bgPlot8 = time(period, sess8)
bgPlot9 = time(period, sess9)

bgcolor(use1 and bgPlot1 > 0 ? yellow : na, transp=75)
bgcolor(use2 and bgPlot2 > 0 ? yellow : na, transp=75)
bgcolor(use3 and bgPlot3 > 0 ? yellow : na, transp=75)
bgcolor(use4 and bgPlot4 > 0 ? yellow : na, transp=75)
bgcolor(use5 and bgPlot5 > 0 ? yellow : na, transp=75)
bgcolor(use6 and bgPlot6 > 0 ? yellow : na, transp=75)
bgcolor(use7 and bgPlot7 > 0 ? yellow : na, transp=75)
bgcolor(use8 and bgPlot8 > 0 ? yellow : na, transp=75)
bgcolor(use9 and bgPlot9 > 0 ? yellow : na, transp=75)

that will work for thinkorswim?
 
BenTen

BenTen

Administrative
Staff
VIP
@Roycar71 Take a look at the snippet in comment #2
 
M

madsin35

New member
I would like to add a vertical line some number of days into the future. Is this possible? What can I do to trigger AddVerticalLine only 13 days from today?

Thanks!
 
R

Roycar71

New member
@Roycar71 Take a look at the snippet in comment #2

This is a start. Thank you. How can I highlight a start time to end time vertically. For example 10:50 to 10:10. Thanks in advance.
 
G

Gmoyano81

New member
Hi MBF, I don't get here much lately. Use the format below as a template to put the Globex open / close on your chart.
# Time Reminders
AddVerticalLine(secondsTillTime(0930) == 0, "RTH", color.cyan, Curve.Short_Dash);
AddVerticalLine(secondsTillTime(1030) == 0, "End EU", color.cyan, Curve.Short_Dash);
AddVerticalLine(secondsTillTime(1200) == 0, "Lunch", color.cyan, Curve.Short_Dash);
AddVerticalLine(secondsTillTime(1500) == 0, "Lst Hr", color.cyan, Curve.Short_Dash);
AddVerticalLine(secondsTillTime(1615) == 0, "RTH End", color.cyan, Curve.Short_Dash);

Do we have any chance to add some alert ?
 
H

hinkognito

New member
Greetings team,

Could someone show me how I could create a script to paint a horizontal line at the close of bar at a certain time of the day?

For example, to see a horizontal line painted at the close of a 5min bar at 10:30AM everyday.

Its the time element that is confusing me.

Thanks in advance.
 
BenTen

BenTen

Administrative
Staff
VIP
@hinkognito You can modify some of the snippets above and replace the vertical to horizontal line.
 
H

hinkognito

New member
Can anyone help with the following script from my request above?
I got it to plot, however I would like the horizontal line to extend to the right indefinitely.

input CloseTime = 1600;
input DurationHours = 1;

def durationSec = DurationHours;
def secondsRemained = SecondsTillTime(closeTime);

plot Price = if secondsRemained >= 0 and secondsRemained <= durationSec then open else double.NaN;
price.setpaintingstrategy(paintingStrategy.HORIZONTAL);
 
Branch

Branch

Member
VIP
I would like a label 10 minutes before the following AddVerticalLine time. The Label can simple read "10 Min Before Reversal"

AddVerticalLine(SecondsTillTime(1010) == 0, “R”, Color.DARK_GRAY, Curve.FIRM);
 
BenTen

BenTen

Administrative
Staff
VIP
@Branch

Code:
AddVerticalLine(SecondsTillTime(1000) == 0, “10 Min Before Reversal”, Color.DARK_GRAY, Curve.FIRM);
 

Similar threads

Top