Login Page - Create Account

Support Board


Date/Time: Fri, 29 Mar 2024 04:45:20 +0000



Post From: Persistent and Incrementing Variables

[2023-03-08 04:32:23]
User486817 - Posts: 79
Hello,

I am looking at this page regarding Persistent and Incrementing Variables: Spreadsheet Example Formulas and Usage: Formula to Count Bars Since An Event

I am using the Color Bar Based on Alert Condition Study on a chart. I'm trying to count bars since a buy/sell alert was triggered. How can i translate the below two formulas using the ID1.SG1 notation i'm used to?

i have this formula =IF(ID6.SG1=0,ID16.SG1[-1]+1,0) where ID6 is the Color Bar Based on Alert Condition study with formula =ID4.SG2<>0 and ID16.SG1 is the spreadsheet formula -- this works. but if ID6 is the same Color Bar Based on Alert Condition study, but the formula has multiple conditions like =OR(ID4.SG2<>0, ID5.SG2<>0, ID6.SG2<>0)for some reason it will not work.

is there a way to achieve the same functionality of the below two formulas using only the spreadsheet formula study? can these two formulas be translated using ID1.SG1 notation?


Buy Alert
=IF(M3, 0,IF(OR(K3, P4 > 0), P4 + 1, P4))


Sell Alert
=IF(K3, 0,IF(OR(M3, Q4 > 0), Q4 + 1, Q4))

thank you,