Login Page - Create Account

Support Board


Date/Time: Sun, 05 May 2024 13:19:41 +0000



Post From: Alert Condition that is only valid within X minutes of one of the conditions being TRUE

[2021-07-27 17:19:06]
Sawtooth - Posts: 3993
I just get a different decimal number. I'm at a loss at how to read that in terms of time.
If the decimal number is the result of FRACTIME(A3), then it is the portion of the 24hr day from midnight.
To convert this to minutes, multiply it by 1440, the number of minutes in 24 hours.
Spreadsheet Example Formulas and Usage: Using Date Time

Try this to persist Condition 1, e.g. in cell O3:
=IF(AND(ID1.SG3@4>0,ID1.SG3@3<0),0,IF(AND(ID1.SG3@4<0,ID1.SG3@3>0),FRACTIME(A3)*1440,O4))
where ID1.SG3 is the MACD study's MACD Diff.
This will persist the number of minutes since midnight at the bar where the MACD Diff crossed 0 from below,
and will cancel the persist when the MACD Diff crosses 0 from above.

Then subtract it from FRACTIME(A3) of the current bar, where the difference must be <5 but not <=0, e.g. in P3:
=AND(Condition2,FRACTIME($J$41)*1440-O3<5,O3>0)

***********
You could also do this:
O3:
=IF(AND(ID1.SG3@4>0,ID1.SG3@3<0),0,IF(AND(ID1.SG3@4<0,ID1.SG3@3>0),FRACTIME(A3),O4))
P3:
=AND(Condition2,FRACTIME($J$41)-O3<5/1440,O3>0)
***********

Then find the first occurrence of the TRUE in column P for the buy signal, in K3:
=AND(P4=0,P3=1)