For example, I have a condition in my script, that if it is true, it will change a bool variable to true. I then want to build another condition around the first one, (if bool = true, then) but I only want the bool to be valid for say 45mins (or 15 bars assuming i use 5 min bars) and then re-set it to false.
Is there an easy way to do this? Any suggestions or ideas would be greatly appreciated.
Here is the pseudo - code I am thinking about
If Low[0] < SwingLow(5)
{
print low under swing low;
breakout = true; // but reset breakout to false after 45 mins from the first time this condition triggered true
}
if breakout = true && High[0] > SwingLow(5)
{
print price retraced to breakout level
}
if breakout= true
reset breakout to false after 45mins

Comment