Hello,
I am trying to plot the low price of the 1-hour trading bar starting at 9:00 a.m. and ending at 10:00 a.m. I have tried with the attached code, but it seems I am not getting the right data. Please correct my code.
Thanks
I am trying to plot the low price of the 1-hour trading bar starting at 9:00 a.m. and ending at 10:00 a.m. I have tried with the attached code, but it seems I am not getting the right data. Please correct my code.
Thanks
Code:
input startTime = 0900;
input endTime = 1000;
def timeUntilClose = SecondsTillTime(endTime);
def timeUntilOpen = SecondsTillTime(startTime);
def targetPeriod = timeUntilClose > 0;
rec targetPeriodLow = if targetPeriod and !targetPeriod[1] then low(period = aggregationPeriod.hour) else if targetPeriod and low(period = aggregationPeriod.hour) < targetPeriodLow[1] and low(period = aggregationPeriod.hour) > 0 then low(period = aggregationPeriod.hour) else targetPeriodLow[1];
plot a = targetPeriodLow;