I have an exploration formula and and I want to run it only in the database ABIndex and not in any other. (and if possible... signaling me with a popup or in other way which DB work with this formula)
(In this way I want to prevent my mistake made by distraction [example: fill watchlist which are set differently by dB ] )
I think we can add a condition at the beginning of code.... but what?
Filter is OK but it is rather used for array filtering.
So instead you might rather disable entire exploration execution for unwanted DBs via if() statement.
db_str = "ABIndex"; // your DB name to run exploration with
if ( StrMatch(GetDatabaseName(), db_str ) ) {
// your exploration code here
// ......
Filter = C > O;
AddColumn( O, "Open", 1.2);
AddColumn( C, "Close", 1.2);
} else {
Filter = 0;
Error(StrFormat("Wrong DB for this exploration code. Open DB '%s'.", db_str ));
}
If it is wrong DB then upper sample returns error in Analysis window