I have a very resource intensive script that is related to options volume plotting. I would like the script to automatically stop running past a certain line if a null condition is met, in this case, that the stock is not optionable. For example, something like this:
def stoprunning = if [not optionable] then [function that will stop running the script after this line of code] else double.nan;
Since I haven't seen anything like this before I'm assuming that it doesn't exist in thinkscript. On the other hand, it might help if there is a simple way to check whether a stock is optionable and to put an "if [not optionable] then double.nan else" condition in the beginning of every variable definition in the script. I expect that doing this would still save resources by preventing the rest of the variable definition's code from running for each of the variables.
def stoprunning = if [not optionable] then [function that will stop running the script after this line of code] else double.nan;
Since I haven't seen anything like this before I'm assuming that it doesn't exist in thinkscript. On the other hand, it might help if there is a simple way to check whether a stock is optionable and to put an "if [not optionable] then double.nan else" condition in the beginning of every variable definition in the script. I expect that doing this would still save resources by preventing the rest of the variable definition's code from running for each of the variables.