I have a study filter in the 1 minute timeframe, and in it I want to put logic that tells me the close price on a certain date.
So I have this code:
(I know I can use the "D"aily timeframe to know the answer, but I need to be able to get the answer in my 1 minute timeframe study filter)
If in "targetDate" I set anything older than yesterday, it doesn't retrieve any results, which makes me suspect that you can only look 1 day in the past in the 1 min timeframe. Is that correct?
Thanks!
So I have this code:
Code:
input date = 20230511;
def closeInDate = if GetYYYYMMDD() == date and SecondsFromTime(1559) == 0
then close
else closeInDate[1];
plot signal = closeInDate > 5;
(I know I can use the "D"aily timeframe to know the answer, but I need to be able to get the answer in my 1 minute timeframe study filter)
If in "targetDate" I set anything older than yesterday, it doesn't retrieve any results, which makes me suspect that you can only look 1 day in the past in the 1 min timeframe. Is that correct?
Thanks!
Last edited: