Get time of high of day


Category:
0
0

Hi! I am working on a script and the last piece that is missing is:

I want to get the time of day of the high of day!

any help would be much appreciated if it’s possible!

Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on September 24, 2020 3:39 pm
179 views
0
Private answer

Please use the search box at the top of the form topic before posting a new question. The question you have posted has already been posted previously:

https://www.hahn-tech.com/ans/display-time-for-high-of-day-low-of-day-on-chart/

 

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on September 24, 2020 4:00 pm
0
I did not see it say solutions only and I wrote it as a comment to your post, apologies. the comment was: Sorry about that, I did see that GetTime() function but after testing it it seems like im getting the wrong time, would appreciate if you could look at my code:  rec hi = if hi[1] < high && GetDay() == GetLastDay() then gettime() else hi[1]; basically it should give me the time when the high is the highest if I wrote it correctly.  If I change GetTime() to, high, I get the high of day as wanted, but the time is off.. right now the time is 3:04PM, but I get 1600935300000 which is Thursday, September 24, 2020 11:15:00 AM GMT+03:00 DST but that is not the time of which the high of day occurred..
( at September 24, 2020 5:07 pm)
0
Please make sure you have completely read my answer in the post I linked in my answer. In particular, focus on the very last sentence: "Royal pain in the butt. Well beyond the scope of what I can provide in the brief 15 minutes I allow for free solutions in the Q&A forum."
( at September 24, 2020 5:12 pm)
0
Ah yes. I understand what you mean now...thank you for saving me weeks of pain.
( at September 24, 2020 5:18 pm)
0
So the next question is. Why is the date/time of that so bar important? Isn't it more important to know which bar of the trading session the high of day occurred? Could be the 10th bar, or the 12th bar... or perhaps the 20th bar. Now that is a piece of data that can be put to work. But the date/time of the bar? I don't see why that is even useful.
( at September 24, 2020 10:10 pm)