- Topics: 67
- Replies: 705
- Posts: 772
I think the issue is that you may be counting since the condition was last true – not how long it has been true, hence the zeroes for those where currently true. It’s a bit confusing, but instead you need to count how long it’s been since the condition was last false. Remember that a value of 1 is true and 0 is false, so this will show how long it has been true by counting the days since it was false:
V1=ADX()>14 and (ADX(DEFAULT=DMPlus) > ADX(DEFAULT=DMMinus));
//How long since V1 was last false?;
This list of FTSE100 stocks shows when the V1 condition is true in blue on the chart, with the green showing the time counts. So OCDO has been positive for 51 days, whereas the ADX False column shows how long it has been false (in other words how long since it’s been true) i.e. 28 days for NG. Hope that makes sense!
- This reply was modified 1 year ago by Darren.