Keep plotting previous week's Friday's close after next Monday on Daily data
Author: Starburst
Creation Date: 9/21/2019 4:44 PM
profile picture

Starburst

#1
I like to plot in real time daily bars with some weekly data.
I would like my data to be plotted after Fridays close for Monday as in the picture Fridays close.
But after Monday it displays the current weeks close in the plot.
How can I coded a data shift to keep my Friday’s data close to the next Friday?

CODE:
Please log in to see this code.

profile picture

Eugene

#2
Jeff,
Drag the slider to "1". Is this what you're looking for? If not please rephrase and clarify your task.
CODE:
Please log in to see this code.
profile picture

Starburst

#3
Thank you for trying to help me in this matter. What I am trying to do is get Friday’s value of the moving average to stay at the same value until the end of next Friday while displaying real time daily bars during the day. Monday the display is great but on Tuesday it calculates Mondays close value on to the chart and I would like to continue to see last Friday’s value there. I find it aesthetic pleasing to the eye and I can easily reference its value by resting the mouse pointer on the last completed bar or being displayed on the right handed margin area of my chart. Shifting the graph doesn’t seem to really help. It would have to be done on Fridays and Mondays. Writing over the last bar I think maybe the way to go but I don’t how to exclude Fridays or last day of the week.
Does this explanation help?
profile picture

Starburst

#4
I think I have it worked out here is my code and we will see how it works tomorrow.
CODE:
Please log in to see this code.
profile picture

Starburst

#5
Alright I think I know what I am asking for. How do I test for the last trading day of the week before the week is over so that I can update my plot at the end of the week?
profile picture

Eugene

#6
QUOTE:
How do I test for the last trading day of the week before the week is over

You're in luck: Community Components has a method exactly for this purpose. It's called TomorrowIsLastTradingDayOfWeek. Its usage is very simple:

CODE:
Please log in to see this code.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).