I am a bit confused. You confirmed that your time zone is Eastern, then proceeded to provide times that were not listed in your original request. Then left out one of the three times you originally requested. So I have provided a solution with three times. Each time can be adjusted as needed. The volume threshold for each of the three times can also be adjusted as needed.
Important note: All times when running scans must be set to Eastern time zone. The scan engine in Thinkorswim uses ONLY Eastern time zone and does not adjust to individual user's time zones.
input timeOne = 1000;
input volumeOne = 100000;
input timeTwo = 1200;
input volumeTwo = 300000;
input timeThree = 1430;
input volumeThree = 500000;
def newDay = GetDay() <> GetDay()[1];
rec accumulatedVolume = if newDay then volume else accumulatedVolume[1] + volume;
def requiredVolumeForTime;
if SecondsFromTime(timeOne) >= 0 and SecondsTillTime(timeTwo) > 0 {
requiredVolumeForTime = accumulatedVolume > volumeOne;
} else {
if SecondsFromTime(timeTwo) >= 0 and SecondsTillTime(timeThree) > 0 {
requiredVolumeForTime = accumulatedVolume > volumeTwo;
} else {
if SecondsFromTime(timeThree) >= 0{
requiredVolumeForTime = accumulatedVolume > volumeThree;
} else {
requiredVolumeForTime = no;
}
}
}
plot scan = requiredVolumeForTime;
FYI, I probably should have required this to be submitted as a custom project request. I have charged clients money for less complex solutions than this one. I hope they forgive me for giving this one away.