Without the specifics of your trigger candle criteria, this will be rather more abstract than it otherwise might be.
Let's start with explicitly defining your condition in terms of one (true) or zero (false):
Code:
def trigger = if some_condition() then 1 else 0;
Moving on to a typical way to find a high of the day:
Code:
def start_time = 0930;
def high_of_day = if secondsTillTime(start_time) >= 0
and secondsTillTime(start_time)[1] < 0
then high
else if high > high_of_day[1]
then high
else high_of_day[1];
This basically checks to see whether it is 9:30 and if so, then the high of the day is the HIGH for that bar. If it is after 9:30, then we look to see whether the current bar HIGH is higher than the last value we had for the high_of_day and if it is, we replace the stored value with the current high. If it isn't higher, we bring the last value for high_of_day forward with us.
Where things get complicated is tracking whether your trigger condition has been met or not. We do that with another variable like this:
Code:
def trigger_fired = if secondsTillTime(start_time) >= 0
and secondsTillTime(start_time)[1] < 0
then 0
else if trigger == 1 and trigger_fired[1] != 1
then 1
else trigger_fired[1];
Here, we set the trigger_fired variable to 0 (false) at 930. The next condition says: if the trigger is 1 (true) AND the trigger has not been fired yet, then fire the trigger, but even if the trigger is true (1) but the trigger has been fired, don't change me.
Now, we have a set of tests to determine whether or not to keep looking for a new high, or just keep our old one. So let's revisit the high_of_day definition from above and mess it about a bit.
Code:
def high_of_day = if secondsTillTime(start_time) >= 0
and secondsTillTime(start_time)[1] < 0
then high
else if high > high_of_day[1] AND trigger_fired == 0
then high
else high_of_day[1];
by adding the condition on the second part of the test (after the time test) we only change the stored high_of_day if the trigger has NOT been fired (trigger_fired is false(0)).
Of course, none of this code may work in ToS. I've just been typing in the browser to illustrate one possible approach to your question. If it works, huzzah! if not, come on back and we'll see if we can get it working for you.
-mashume