Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

check for empty fields


Recommended Posts

I am trying to create a script that checks if certain fields are empty.  Can someone show me how to correct this script step that gives false positives?  Testing this with Data Viewer gives the correct "0" if I terminate the script at (CONFIGURATION::Market_On_Close indication) but gives false negatives (1) if I terminate it at (CONFIGURATION::Quantity or later.  I am testing this on records where all the fields have data. Is there a better way of doing this?

 IsEmpty 
(CONFIGURATION::Bar Interval)   or 
(CONFIGURATION::Currency)  or 
(CONFIGURATION::Exchange)  or 
(CONFIGURATION::Market_On_Close indication) or 
(CONFIGURATION::Quantity or 
(CONFIGURATION::Security Type) or 
(CONFIGURATION::Start Time) or 
(CONFIGURATION::Stop Limit Parameter) or 
(CONFIGURATION::Stop Loss Parameter) or 
(CONFIGURATION::Symbol_) or 
(CONFIGURATION::Target Parameter) or
(CONFIGURATION::Trade Direction) or 
(CONFIGURATION::Transmit Flag) or 
(CONFIGURATION::IBKR_account))

 

Edited by dysong3
Link to comment
Share on other sites

Your calculation (not script) only tests if the CONFIGURATION::Bar Interval field is empty. Then it goes on to test if any one of the other fields evaluates as True if converted to a Boolean value (which any field that contains a digit other than 0 will).

The simple way to test that none of the fields are empty (if that's what you are trying to do) would be:

Count ( 
CONFIGURATION::Bar Interval ;
CONFIGURATION::Currency ;
CONFIGURATION::Exchange ;
CONFIGURATION::Market_On_Close indication ;
CONFIGURATION::Quantity ;
CONFIGURATION::Security Type ;
CONFIGURATION::Start Time ;
CONFIGURATION::Stop Limit Parameter ;
CONFIGURATION::Stop Loss Parameter ;
CONFIGURATION::Symbol_ ;
CONFIGURATION::Target Parameter ;
CONFIGURATION::Trade Direction ;
CONFIGURATION::Transmit Flag ;
CONFIGURATION::IBKR_account
) = 14

 

Edited by comment
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.