Display range for previous day’s high & close


Category:
0
0

Hey Pete, I saw this last topic (https://www.hahn-tech.com/ans/plot-range-based-on-percent-of-previous-day-close/) and thought I could change it to my liking but TOS says no dice:

I want a range to display showing previous days high through previous days close. I altered your original code but I get an error from TOS (see picture 2). Additionally, I would like it to work through premarket and into after hours if possible. If it’s too much to do PM/AH, then I’d be okay without those. Thank you. I attached a picture of how I would like it to look, I don’t have a color preference.

Attachments:
Marked as spam
Posted by (Questions: 3, Answers: 1)
Asked on January 1, 2021 1:54 pm
264 views
0
Private answer

Based on what you are trying to achieve I suggest you use the solution in the following post as your basis:

https://www.hahn-tech.com/ans/pre-market-hl-previous-days-hlc/

Only thing you need to add is your shading, by adding an AddCloud() statement.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on January 1, 2021 2:31 pm
0
Perfect - Thank you sir!
( at January 2, 2021 9:11 am)
0
Sorry, I lied, I have one more tweak – Right now it looks like the indicator is including premarket and after-hours price action. I want the cloud to span from the close to the high from the previous day’s regular session, excluding PM/AH. What I meant in my explanation is that I want the cloud to show during day 2’s PM/AH. I tried adding inputs, but they don’t seem to be affecting the code as I’d hoped. Here is my code: input startTime = 930; input endTime = 1600; def newDay = GetDay() GetDay()[1]; rec dailyHigh = if newDay then high else if high > dailyHigh[1] then high else dailyHigh[1]; def previousClose = close(period = AggregationPeriod.DAY)[1]; rec previousHigh = if newDay then dailyHigh[1] else previousHigh[1]; plot priorDayHigh = previousHigh; plot priorDayClose = previousClose; addcloud (priordayHigh, priordayclose, color.green, color.green, yes);
( at January 2, 2021 12:26 pm)
0
That part of the solution gets very complicated. Sorry about that. But there is an issue when the extended hours session crosses midnight. And futures will behave completely different than equities. It's a real pain to deal with and very complex to resolve. I have a solution saved for future reference but a client has paid for this solution and I am not able to provide it free of charge in the Q&A Forum.
( at January 2, 2021 5:27 pm)
0
Okay, thanks for letting me know. I may shoot you an email if I can't figure it out to learn more about cost.
( at January 2, 2021 5:40 pm)