Hi, “n” on line 9 is defined as a condition, so will always be equal to either 0 or 1
and in line 11 when defining “c1=…” you ask for n between 0 (included) and 15 (included), that doesn’t feel like the same n as the one defined in line 9 being 0 or 1, or other possibility you actually meant the same n but wanted something else than checking it’s between 0 and 15… You’d have to explain what you expect from c1 for someone to make a translation into code suggestion
Ok, then you can use the command “summation” on c1, either on 15 (current day + past 14) or on 16 (current+past 15), to check that sum is at least one and stored in c2:
If youwanttoknowwhentheconditionis“true“,youcanusetheinstruction“BarsSince“(Returns thenumberofcandlesticks/bars passedsincethelasttruecondition). When you run the screener, you will see in the column “BSCondition” the number of days that have passed since the condition is true… These numbers range from zero (on current day the condition is true) to 14 (the condition was true 14 days ago)
You will also see “-1” in the list and this means that the condition has NOT been true in the last 14 days…
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue