I'm using barssince() with a condition I developed.
For stocks, usually which does not exist more than 2 years, sometimes the condition never happened before. In this case, barssince() is problematic, and my whole formula is corrupted, and doesn't plot anything.
I want to check if barssince() comes back with a real value, or a N/A value. Or make some try-catch to catch a case in which barssince() failed.
How can I do it?
Edited by user Sunday, December 9, 2018 10:36:06 PM(UTC)
| Reason: Not specified
Wanna join the discussion?! Login to your Discussions forum accountor Register a new forum account.
Unfortunately, if the condition is never true within the data sample there is not a way to work around the problem and the formula logic would need to be reworked if possible. There are functions IsDefined and IsUndefined but they also require a condition to have been true at least once within the data sample analyzed.