Custom column showing closing price of bar at X time


Hi Pete,

I would like a custom column showing the closing price of a bar at X time. Example: showing the closing price of the first 30 min, hourly bar or whatever time frame I choose.

Thank you

Marked as spam
Posted by (Questions: 6, Answers: 15)
Asked on May 15, 2019 8:11 am
Here it is…….Just choose the timeframe you want at the top of the column plot Data = close;
( at May 15, 2019 4:29 pm)
Hi Mike, I'm embarrassed to say I can't believe how easy this was. Thank you so much for your help!
( at May 15, 2019 9:10 pm)
How would I make the price stay static at a given time, ie 10 AM EST? Right now, I have to adjust it with every bar like this: plot data = close[5];
( at May 16, 2019 8:49 am)
Private answer

Here you go:

input targetTime = 1000;
def targetBar = SecondsFromTime(targetTime) == 0;
rec targetClose = if targetBar then close else targetClose[1];
plot data = targetClose;


Marked as spam
Posted by (Questions: 36, Answers: 2445)
Answered on May 20, 2019 5:43 pm
Thank you so much Pete! This is what I was looking for!
( at May 21, 2019 12:10 am)