Custom column showing closing price of bar at X time


Category:
0
0

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: 8, Answers: 18)
Asked on May 15, 2019 8:11 am
187 views
0
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)
0
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)
0
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)
0
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: 37, Answers: 4117)
Answered on May 20, 2019 5:43 pm
0
Thank you so much Pete! This is what I was looking for!
( at May 21, 2019 12:10 am)