Ejemplo n.º 1
0
/* LN BEGIN */
DEF_MATH_UNARY_OPERATOR( LN, "Vector Log Natural", "Ln" )
/* LN END */

/* LOG10 BEGIN */
DEF_MATH_UNARY_OPERATOR( LOG10, "Vector Log10", "Log10" )
/* LOG10 END */

/****************************************************************************
 * Step 2 - Add your TA function to the table.
 *          Keep in alphabetical order. Must be NULL terminated.
 ****************************************************************************/
const TA_FuncDef *TA_DEF_TableL[] =
{
   ADD_TO_TABLE(LINEARREG),
   ADD_TO_TABLE(LINEARREG_ANGLE),
   ADD_TO_TABLE(LINEARREG_INTERCEPT),
   ADD_TO_TABLE(LINEARREG_SLOPE),
   ADD_TO_TABLE(LN),
   ADD_TO_TABLE(LOG10),
   NULL
};


/* Do not modify the following line. */
const unsigned int TA_DEF_TableLSize =
              ((sizeof(TA_DEF_TableL)/sizeof(TA_FuncDef *))-1);


/****************************************************************************
Ejemplo n.º 2
0
/*++
 * Function:	SetConfigOptions
 *
 * Purpose:	Set global configuration options by reading and parsing
 *		the configuration file.
 *
 * Parameters:	char pointer to config filename path.
 *
 * Returns:	nada.  exit()s on any error.
 *
 * Authors:	Dave McMurtrie <*****@*****.**>
 *
 * Notes:       Sets values in global ProxyConfig_Struct PC_Struct.
 *--
 */
extern void SetConfigOptions( char *ConfigFile )
{
    FILE *FP;
    char *fn = "SetConfigOptions()";
    char Buffer[1024];
    unsigned int LineNumber;
    unsigned int index;
    unsigned int i;
    char *CP;
    char *Keyword;
    char *Value;
   
    index = LineNumber = 0;

    /*
     * initialize the proxy config struct
     */
    memset( &PC_Struct, 0, sizeof PC_Struct );
    

    /*
     * Build our config option table.
     */
    ADD_TO_TABLE( "server_hostname", SetStringValue, 
		  &PC_Struct.server_hostname, index );

    ADD_TO_TABLE( "listen_port", SetNumericValue, 
		  &PC_Struct.listen_port, index );

    ADD_TO_TABLE( "server_port", SetNumericValue, 
		  &PC_Struct.server_port, index );

    ADD_TO_TABLE( "cache_size", SetNumericValue, 
		  &PC_Struct.cache_size, index );

    ADD_TO_TABLE( "cache_expiration_time", SetNumericValue, 
		  &PC_Struct.cache_expiration_time, index );

    ADD_TO_TABLE( "proc_username", SetStringValue,
		  &PC_Struct.proc_username, index );
    
    ADD_TO_TABLE( "proc_groupname", SetStringValue,
		  &PC_Struct.proc_groupname, index );
    
    ADD_TO_TABLE( "stat_filename", SetStringValue,
		  &PC_Struct.stat_filename, index );

    ADD_TO_TABLE( "syslog_facility", SetStringValue,
		  &PC_Struct.syslog_facility, index );
    
    ADD_TO_TABLE( "protocol_log_filename", SetStringValue,
		  &PC_Struct.protocol_log_filename, index );

    ADD_TO_TABLE( "syslog_prioritymask", SetStringValue,
		  &PC_Struct.syslog_prioritymask, index );
    
    ADD_TO_TABLE( "tls_ca_file", SetStringValue,
		  &PC_Struct.tls_ca_file, index );
    
    ADD_TO_TABLE( "tls_ca_path", SetStringValue,
		  &PC_Struct.tls_ca_path, index );
    
    ADD_TO_TABLE( "tls_cert_file", SetStringValue,
		  &PC_Struct.tls_cert_file, index );
    
    ADD_TO_TABLE( "tls_key_file", SetStringValue,
		  &PC_Struct.tls_key_file, index );

    ADD_TO_TABLE( "send_tcp_keepalives", SetBooleanValue,
		  &PC_Struct.send_tcp_keepalives, index );

    ConfigTable[index].Keyword[0] = '\0';
    
    FP = fopen( ConfigFile, "r" );
    
    if ( !FP )
    {
	syslog(LOG_ERR, "%s: Unable to open config file '%s': %s -- Exiting",
	       fn, ConfigFile, strerror( errno ) );
	exit( 1 );
    }
    
    for ( ;; )
    {
	if ( !fgets( Buffer, sizeof Buffer, FP ) )
	    break;
	    
	LineNumber++;
	    
	/*
	 * Nullify comments, and CRLFs
	 */
	CP = strchr( Buffer, '#' );
	if ( CP ) *CP = 0;
	
	CP = strchr( Buffer, '\n' );
	if ( CP ) *CP = 0;
	
	CP = strchr( Buffer, '\r' );
	if ( CP ) *CP = 0;
	
	/*
	 * Any line that started with a comment or CRLF, we'll
	 * skip.
	 */
	if ( !strlen( Buffer ) )
	    continue;
	
	CP = strtok( Buffer, " " );
	if ( !CP )
	{
	    syslog(LOG_ERR, "%s: parse error reading config file at line %d.  Exiting.", fn, LineNumber );
	    exit( 1 );
	}
	
	Keyword = CP;
	
	CP = strtok( NULL, " " );
	
	if ( !CP )
	{
	    syslog(LOG_ERR, "%s: parse error reading config file at line %d.  Exiting.", fn, LineNumber );
	    exit( 1 );
	}
	
	Value = CP;
	
	for (i = 0; ConfigTable[i].Keyword[0] != '\0'; i++ )
	{
	    if ( ! strcasecmp( (const char *)Keyword, ConfigTable[i].Keyword ) )
	    {
		( ConfigTable[i].SetFunction )( Value, 
						ConfigTable[i].StorageAddress,
						LineNumber );
		break;
	    }
	    
	}
	
	/*
	 * If we get here and we're at our NULL value at the end of our
	 * keyword array, we cycled through the entire array and never
	 * matched any keyword.
	 */
	if ( ! ConfigTable[i].Keyword )
	{
	    syslog( LOG_ERR, "%s: unknown keyword '%s' found at line %d of config file -- Exiting.", fn, Keyword, LineNumber );
	    exit( 1 );
	}
	
    }

    fclose( FP );
}
Ejemplo n.º 3
0
DEF_FUNCTION( AVGPRICE,                   /* name */
              TA_GroupId_PriceTransform,  /* groupId */
              "Average Price",            /* hint */
              "AvgPrice",                 /* CamelCase name */
              TA_FUNC_FLG_OVERLAP         /* flags */
             );
/* AVGPRICE END */

/****************************************************************************
 * Step 2 - Add your TA function to the table.
 *          Keep in alphabetical order. Must be NULL terminated.
 ****************************************************************************/
const TA_FuncDef *TA_DEF_TableA[] =
{
   ADD_TO_TABLE(ACOS),
   ADD_TO_TABLE(AD),
   ADD_TO_TABLE(ADD),
   ADD_TO_TABLE(ADOSC),
   ADD_TO_TABLE(ADX),
   ADD_TO_TABLE(ADXR),
   ADD_TO_TABLE(APO),
   ADD_TO_TABLE(AROON),
   ADD_TO_TABLE(AROONOSC),
   ADD_TO_TABLE(ASIN),
   ADD_TO_TABLE(ATAN),
   ADD_TO_TABLE(ATR),
   ADD_TO_TABLE(AVGPRICE),
   NULL
};
Ejemplo n.º 4
0
              TA_GroupId_MomentumIndicators,  /* groupId */
              "Stochastic Relative Strength Index",  /* hint */
              NULL,                       /* helpFile */
              TA_FUNC_FLG_UNST_PER,       /* flags */
              NULL                        /* analysis function */
             );

/* STOCHRSI END */

/****************************************************************************
 * Step 2 - Add your TA function to the table.
 *          Order is not important. Must be NULL terminated.
 ****************************************************************************/
const TA_FuncDef *TA_DEF_TableS[] =
{
   ADD_TO_TABLE(SAR),
   ADD_TO_TABLE(SAREXT),
   ADD_TO_TABLE(STDDEV),
   ADD_TO_TABLE(SMA),
   ADD_TO_TABLE(STOCH),
   ADD_TO_TABLE(STOCHF),
   ADD_TO_TABLE(STOCHRSI),
   NULL
};


/* Do not modify the following line. */
const unsigned int TA_DEF_TableSSize =
              ((sizeof(TA_DEF_TableS)/sizeof(TA_FuncDef *))-1);

Ejemplo n.º 5
0
              "Negative Volume Index", /* hint */
              NULL,      /* helpFile */
              0,         /* flags */
              NULL       /* analysis function */
             );

/* NVI END */
#endif

/****************************************************************************
 * Step 2 - Add your TA function to the table.
 *          Order is not important. Must be NULL terminated.
 ****************************************************************************/
const TA_FuncDef *TA_DEF_TableN[] =
{
   ADD_TO_TABLE(NATR),
   NULL
};


/* Do not modify the following line. */
const unsigned int TA_DEF_TableNSize =
              ((sizeof(TA_DEF_TableN)/sizeof(TA_FuncDef *))-1);


/****************************************************************************
 * Step 3 - Make sure "gen_code" is executed for generating all other
 *          source files derived from this one.
 *          You can then re-compile the library as usual and you are done!
 ****************************************************************************/
Ejemplo n.º 6
0
DEF_FUNCTION( MOM,                     /* name */
              TA_GroupId_MomentumIndicators,  /* groupId */
              "Momentum",       /* hint */
              NULL,             /* helpFile */
              0,                /* flags */
              NULL              /* analysis function */
             );
/* MOM END */

/****************************************************************************
 * Step 2 - Add your TA function to the table.
 *          Order is not important. Must be NULL terminated.
 ****************************************************************************/
const TA_FuncDef *TA_DEF_TableM[] =
{
   ADD_TO_TABLE(MA),
   ADD_TO_TABLE(MACD),
   ADD_TO_TABLE(MACDEXT),
   ADD_TO_TABLE(MACDFIX),
   ADD_TO_TABLE(MAMA),
   ADD_TO_TABLE(MAX),
   ADD_TO_TABLE(MEDPRICE),
   ADD_TO_TABLE(MFI),
   ADD_TO_TABLE(MIDPRICE),
   ADD_TO_TABLE(MIDPOINT),
   ADD_TO_TABLE(MIN),
   ADD_TO_TABLE(MINUS_DI),
   ADD_TO_TABLE(MINUS_DM),
   ADD_TO_TABLE(MOM),
   NULL
};
Ejemplo n.º 7
0
DEF_FUNCTION( OBV,                          /* name */
              TA_GroupId_VolumeIndicators,  /* groupId */
              "On Balance Volume",          /* hint */
              "Obv",                        /* CamelCase name */
              0                             /* flags */
             );
/* OBV END */

/****************************************************************************
 * Step 2 - Add your TA function to the table.
 *          Keep in alphabetical order. Must be NULL terminated.
 ****************************************************************************/
const TA_FuncDef *TA_DEF_TableO[] =
{
   ADD_TO_TABLE(OBV),
   NULL
};


/* Do not modify the following line. */
const unsigned int TA_DEF_TableOSize =
              ((sizeof(TA_DEF_TableO)/sizeof(TA_FuncDef *))-1);


/****************************************************************************
 * Step 3 - Make sure "gen_code" is executed for generating all other
 *          source files derived from this one.
 *          You can then re-compile the library as usual and you are done!
 ****************************************************************************/
Ejemplo n.º 8
0
DEF_FUNCTION( ULTOSC,                         /* name */
              TA_GroupId_MomentumIndicators,  /* groupId */
              "Ultimate Oscillator",          /* hint */
              "UltOsc",                       /* CamelCase name */
              0                               /* flags */
             );
/* ULTOSC END */

/****************************************************************************
 * Step 2 - Add your TA function to the table.
 *          Keep in alphabetical order. Must be NULL terminated.
 ****************************************************************************/
const TA_FuncDef *TA_DEF_TableU[] =
{
   ADD_TO_TABLE(ULTOSC),
   NULL
};


/* Do not modify the following line. */
const unsigned int TA_DEF_TableUSize =
              ((sizeof(TA_DEF_TableU)/sizeof(TA_FuncDef *))-1);


/****************************************************************************
 * Step 3 - Make sure "gen_code" is executed for generating all other
 *          source files derived from this one.
 *          You can then re-compile the library as usual and you are done!
 ****************************************************************************/
Ejemplo n.º 9
0
DEF_FUNCTION( STOCHF,                   /* name */
              TA_GroupId_MomentumIndicators, /* groupId */
              "Stochastic Fast",        /* hint */
              NULL,                     /* helpFile */
              0,                        /* flags */
              NULL                      /* analysis function */
             );
/* STOCHF END */

/****************************************************************************
 * Step 2 - Add your TA function to the table.
 *          Order is not important. Must be NULL terminated.
 ****************************************************************************/
const TA_FuncDef *TA_DEF_TableS[] =
{
   ADD_TO_TABLE(SAR),
   ADD_TO_TABLE(STDDEV),
   ADD_TO_TABLE(SMA),
   ADD_TO_TABLE(STOCH),
   ADD_TO_TABLE(STOCHF),
   NULL
};


/* Do not modify the following line. */
const unsigned int TA_DEF_TableSSize =
              ((sizeof(TA_DEF_TableS)/sizeof(TA_FuncDef *))-1);


/****************************************************************************
 * Step 3 - Make sure "gen_code" is executed for generating all other
Ejemplo n.º 10
0
 *          the macro DEF_FUNCTION.
 *
 ****************************************************************************/

/* Floor BEGIN */
DEF_MATH_UNARY_OPERATOR( FLOOR, "Vector Floor", "Floor" )
/* Floor END */


/****************************************************************************
 * Step 2 - Add your TA function to the table.
 *          Keep in alphabetical order. Must be NULL terminated.
 ****************************************************************************/
const TA_FuncDef *TA_DEF_TableF[] =
{
   ADD_TO_TABLE(FLOOR),
   NULL
};


/* Do not modify the following line. */
const unsigned int TA_DEF_TableFSize =
              ((sizeof(TA_DEF_TableF)/sizeof(TA_FuncDef *))-1);


/****************************************************************************
 * Step 3 - Make sure "gen_code" is executed for generating all other
 *          source files derived from this one.
 *          You can then re-compile the library as usual and you are done!
 ****************************************************************************/
Ejemplo n.º 11
0
              TA_GroupId_OverlapStudies,  /* groupId */
              "Kaufman Adaptive Moving Average", /* hint */
              NULL,                       /* helpFile */
              TA_FUNC_FLG_OVERLAP|TA_FUNC_FLG_UNST_PER,        /* flags */
              NULL                        /* analysis function */
             );
/* KAMA END */


/****************************************************************************
 * Step 3 - Add your TA function to the table.
 *          Order is not important. Must be NULL terminated.
 ****************************************************************************/
const TA_FuncDef *TA_DEF_TableK[] =
{
   ADD_TO_TABLE(KAMA),
   NULL
};


/* Do not modify the following line. */
const unsigned int TA_DEF_TableKSize =
              ((sizeof(TA_DEF_TableK)/sizeof(TA_FuncDef *))-1);


/****************************************************************************
 * Step 4 - Make sure "gen_code" is executed for generating all other
 *          source files derived from this one.
 *          You can then re-compile the library as usual and you are done!
 ****************************************************************************/
Ejemplo n.º 12
0
DEF_FUNCTION( EMA,                        /* name */
              TA_GroupId_OverlapStudies,  /* groupId */
              "Exponential Moving Average", /* hint */
              "Ema",                       /* CamelCase name */
              TA_FUNC_FLG_OVERLAP|TA_FUNC_FLG_UNST_PER /* flags */
             );
/* EMA END */

/****************************************************************************
 * Step 2 - Add your TA function to the table.
 *          Keep in alphabetical order. Must be NULL terminated.
 ****************************************************************************/
const TA_FuncDef *TA_DEF_TableE[] =
{
   ADD_TO_TABLE(EMA),
   NULL
};


/* Do not modify the following line. */
const unsigned int TA_DEF_TableESize =
              ((sizeof(TA_DEF_TableE)/sizeof(TA_FuncDef *))-1);


/****************************************************************************
 * Step 3 - Make sure "gen_code" is executed for generating all other
 *          source files derived from this one.
 *          You can then re-compile the library as usual and you are done!
 ****************************************************************************/
Ejemplo n.º 13
0
DEF_FUNCTION( WMA,                        /* name */
              TA_GroupId_OverlapStudies,  /* groupId */
              "Weighted Moving Average",  /* hint */
              "Wma",                      /* CamelCase name */
              TA_FUNC_FLG_OVERLAP         /* flags */              
             );

/* WMA END */

/****************************************************************************
 * Step 2 - Add your TA function to the table.
 *          Keep in alphabetical order. Must be NULL terminated.
 ****************************************************************************/
const TA_FuncDef *TA_DEF_TableW[] =
{
   ADD_TO_TABLE(WCLPRICE),
   ADD_TO_TABLE(WILLR),
   ADD_TO_TABLE(WMA),
   NULL
};


/* Do not modify the following line. */
const unsigned int TA_DEF_TableWSize =
              ((sizeof(TA_DEF_TableW)/sizeof(TA_FuncDef *))-1);


/****************************************************************************
 * Step 3 - Make sure "gen_code" is executed for generating all other
 *          source files derived from this one.
 *          You can then re-compile the library as usual and you are done!
Ejemplo n.º 14
0
DEF_FUNCTION( BETA,                      /* name */
              TA_GroupId_Statistic,     /* groupId */
              "Beta", /* hint */
              "Beta",                /* CamelCase name */
              0                        /* flags */
            );
/* BETA END */

/****************************************************************************
 * Step 2 - Add your TA function to the table.
 *          Keep in alphabetical order. Must be NULL terminated.
 ****************************************************************************/
const TA_FuncDef *TA_DEF_TableB[] =
{
   ADD_TO_TABLE(BBANDS),
   ADD_TO_TABLE(BETA),
   ADD_TO_TABLE(BOP),
   NULL
};


/* Do not modify the following line. */
const unsigned int TA_DEF_TableBSize =
              ((sizeof(TA_DEF_TableB)/sizeof(TA_FuncDef *))-1);


/****************************************************************************
 * Step 3 - Make sure "gen_code" is executed for generating all other
 *          source files derived from this one.
 *          You can then re-compile the library as usual and you are done!
Ejemplo n.º 15
0
/*++
 * Function:	SetConfigOptions
 *
 * Purpose:	Set global configuration options by reading and parsing
 *		the configuration file.
 *
 * Parameters:	char pointer to config filename path.
 *
 * Returns:	nada.  exit()s on any error.
 *
 * Authors:	Dave McMurtrie <*****@*****.**>
 *
 * Notes:       Sets values in global ProxyConfig_Struct PC_Struct.
 *--
 */
extern void SetConfigOptions( char *ConfigFile )
{
    FILE *FP;
    char *fn = "SetConfigOptions()";
    char Buffer[1024];
    unsigned int LineNumber;
    unsigned int index;
    unsigned int i;
    char *CP;
    char *Keyword;
    char *Value;
   
    index = LineNumber = 0;

    /*
     * initialize the proxy config struct
     */
    memset( &PC_Struct, 0, sizeof PC_Struct );
    

    /*
     * Build our config option table.
     */
    ADD_TO_TABLE( "server_hostname", SetStringValue, 
		  &PC_Struct.server_hostname, index );

    ADD_TO_TABLE( "listen_port", SetStringValue, 
		  &PC_Struct.listen_port, index );

    ADD_TO_TABLE( "listen_address", SetStringValue,
		  &PC_Struct.listen_addr, index );

    ADD_TO_TABLE( "server_port", SetStringValue, 
		  &PC_Struct.server_port, index );

    ADD_TO_TABLE( "connect_retries", SetNumericValue,
		  &PC_Struct.server_connect_retries, index );
    ADD_TO_TABLE( "connect_delay", SetNumericValue,
		  &PC_Struct.server_connect_delay, index );

    ADD_TO_TABLE( "cache_size", SetNumericValue, 
		  &PC_Struct.cache_size, index );

    ADD_TO_TABLE( "cache_expiration_time", SetNumericValue, 
		  &PC_Struct.cache_expiration_time, index );

    ADD_TO_TABLE( "preauth_command", SetStringValue,
		  &PC_Struct.preauth_command, index );

    ADD_TO_TABLE( "auth_sasl_plain_username", SetStringValue,
		  &PC_Struct.auth_sasl_plain_username, index );
    
    ADD_TO_TABLE( "auth_sasl_plain_password", SetStringValue,
		  &PC_Struct.auth_sasl_plain_password, index );

    ADD_TO_TABLE( "auth_shared_secret", SetStringValue,
		  &PC_Struct.auth_shared_secret, index);

    ADD_TO_TABLE( "proc_username", SetStringValue,
		  &PC_Struct.proc_username, index );
    
    ADD_TO_TABLE( "proc_groupname", SetStringValue,
		  &PC_Struct.proc_groupname, index );
    
    ADD_TO_TABLE( "stat_filename", SetStringValue,
		  &PC_Struct.stat_filename, index );

    ADD_TO_TABLE( "syslog_facility", SetStringValue,
		  &PC_Struct.syslog_facility, index );
    
    ADD_TO_TABLE( "protocol_log_filename", SetStringValue,
		  &PC_Struct.protocol_log_filename, index );

    ADD_TO_TABLE( "syslog_prioritymask", SetStringValue,
		  &PC_Struct.syslog_prioritymask, index );
    
    ADD_TO_TABLE( "tls_ca_file", SetStringValue,
		  &PC_Struct.tls_ca_file, index );
    
    ADD_TO_TABLE( "tls_ca_path", SetStringValue,
		  &PC_Struct.tls_ca_path, index );
    
    ADD_TO_TABLE( "tls_cert_file", SetStringValue,
		  &PC_Struct.tls_cert_file, index );
    
    ADD_TO_TABLE( "tls_key_file", SetStringValue,
		  &PC_Struct.tls_key_file, index );

    ADD_TO_TABLE( "tls_ciphers", SetStringValue,
		  &PC_Struct.tls_ciphers, index );

    ADD_TO_TABLE( "tls_verify_server", SetBooleanValue,
		  &PC_Struct.tls_verify_server, index );

    ADD_TO_TABLE( "tls_no_tlsv1", SetBooleanValue,
		  &PC_Struct.tls_no_tlsv1, index );

    ADD_TO_TABLE( "tls_no_tlsv1.1", SetBooleanValue,
		  &PC_Struct.tls_no_tlsv1_1, index );

    ADD_TO_TABLE( "tls_no_tlsv1.2", SetBooleanValue,
		  &PC_Struct.tls_no_tlsv1_2, index );

    ADD_TO_TABLE( "send_tcp_keepalives", SetBooleanValue,
		  &PC_Struct.send_tcp_keepalives, index );

    ADD_TO_TABLE( "chroot_directory", SetStringValue,
		  &PC_Struct.chroot_directory, index );

    ADD_TO_TABLE( "enable_select_cache", SetBooleanValue,
		  &PC_Struct.enable_select_cache, index );

    ADD_TO_TABLE( "foreground_mode", SetBooleanValue,
		  &PC_Struct.foreground_mode, index );

    ADD_TO_TABLE( "force_tls", SetBooleanValue,
		  &PC_Struct.force_tls, index );

    ADD_TO_TABLE( "enable_admin_commands", SetBooleanValue,
		  &PC_Struct.enable_admin_commands, index );
    
    ConfigTable[index].Keyword[0] = '\0';
    
    FP = fopen( ConfigFile, "r" );
    
    if ( !FP )
    {
	syslog(LOG_ERR, "%s: Unable to open config file '%s': %s -- Exiting",
	       fn, ConfigFile, strerror( errno ) );
	exit( 1 );
    }
    
    for ( ;; )
    {
	if ( !fgets( Buffer, sizeof Buffer, FP ) )
	    break;
	    
	LineNumber++;
	    
	/*
	 * Nullify comments, and CRLFs
	 */
	CP = strchr( Buffer, '#' );
	if ( CP ) *CP = 0;
	
	CP = strchr( Buffer, '\n' );
	if ( CP ) *CP = 0;
	
	CP = strchr( Buffer, '\r' );
	if ( CP ) *CP = 0;
	
	/*
	 * Any line that started with a comment or CRLF, we'll
	 * skip.
	 */
	if ( !strlen( Buffer ) )
	    continue;
	
	CP = strtok( Buffer, " " );
	if ( !CP )
	{
	    syslog(LOG_ERR, "%s: parse error reading config file at line %d.  Exiting.", fn, LineNumber );
	    exit( 1 );
	}
	
	Keyword = CP;
	
	CP = strtok( NULL, " " );
	
	if ( !CP )
	{
	    syslog(LOG_ERR, "%s: parse error reading config file at line %d.  Exiting.", fn, LineNumber );
	    exit( 1 );
	}
	
	Value = CP;

	// we don't just want the next token, we want the rest of the line
	// (put back the space that strtok() changed into a null character)
	//
	Value[ strlen( Value ) ] = ' ';

	// however, we then have to be careful to remove trailing whitespace
	//
	i = strlen( Value ) - 1;
	while ( ( Value[ i ] == ' ' )
	     || ( Value[ i ] == '\t' )
	     || ( Value[ i ] == '\r' )
	     || ( Value[ i ] == '\n' ) )
	{
	    i--;
	}
	if ( i < ( strlen( Value ) - 1 ) )
	    Value[ i + 1 ] = '\0';
	
	for (i = 0; ConfigTable[i].Keyword[0] != '\0'; i++ )
	{
	    if ( ! strcasecmp( (const char *)Keyword, ConfigTable[i].Keyword ) )
	    {
		( ConfigTable[i].SetFunction )( Value, 
						ConfigTable[i].StorageAddress,
						LineNumber );
		break;
	    }
	    
	}
	
	/*
	 * If we get here and we're at our NULL value at the end of our
	 * keyword array, we cycled through the entire array and never
	 * matched any keyword.
	 */
	if ( ! ConfigTable[i].Keyword )
	{
	    syslog( LOG_ERR, "%s: unknown keyword '%s' found at line %d of config file -- Exiting.", fn, Keyword, LineNumber );
	    exit( 1 );
	}
	
    }

    fclose( FP );
}
Ejemplo n.º 16
0
DEF_FUNCTION( RSI,                        /* name */
              TA_GroupId_MarketStrength,  /* groupId */
              "Relative Strength Index",  /* hint */
              NULL,                       /* helpFile */
              TA_FUNC_FLG_UNST_PER,       /* flags */
              NULL                        /* analysis function */
             );
/* RSI END */

/****************************************************************************
 * Step 3 - Add your TA function to the table.
 *          Order is not important. Must be NULL terminated.
 ****************************************************************************/
const TA_FuncDef *TA_DEF_TableR[] =
{
   ADD_TO_TABLE(ROC),
   ADD_TO_TABLE(ROCR),
   ADD_TO_TABLE(RSI),
   NULL
};


/* Do not modify the following line. */
const unsigned int TA_DEF_TableRSize =
              ((sizeof(TA_DEF_TableR)/sizeof(TA_FuncDef *))-1);


/****************************************************************************
 * Step 4 - Make sure "gen_code" is executed for generating all other
 *          source files derived from this one.
 *          You can then re-compile the library as usual and you are done!
Ejemplo n.º 17
0
              TA_GroupId_VolumeIndicators, /* groupId */
              "Positive Volume Index",     /* hint */
              "Pvi",                       /* CamelCase name */
              0                            /* flags */
             );

/* PVI END */
#endif

/****************************************************************************
 * Step 2 - Add your TA function to the table.
 *          Keep in alphabetical order. Must be NULL terminated.
 ****************************************************************************/
const TA_FuncDef *TA_DEF_TableP[] =
{
   ADD_TO_TABLE(PLUS_DI),
   ADD_TO_TABLE(PLUS_DM),
   ADD_TO_TABLE(PPO),
   /* ADD_TO_TABLE(PVI),*/
   NULL
};


/* Do not modify the following line. */
const unsigned int TA_DEF_TablePSize =
              ((sizeof(TA_DEF_TableP)/sizeof(TA_FuncDef *))-1);


/****************************************************************************
 * Step 3 - Make sure "gen_code" is executed for generating all other
 *          source files derived from this one.
Ejemplo n.º 18
0
DEF_FUNCTION( HT_TRENDMODE,                   /* name */
              TA_GroupId_CycleIndicators,  /* groupId */
              "Hilbert Transform - Trend vs Cycle Mode",  /* hint */
              "HtTrendMode",                       /* CamelCase name */
              TA_FUNC_FLG_UNST_PER /* flags */
             );
/* HT_TRENDMODE END */

/****************************************************************************
 * Step 2 - Add your TA function to the table.
 *          Keep in alphabetical order. Must be NULL terminated.
 ****************************************************************************/
const TA_FuncDef *TA_DEF_TableH[] =
{
   ADD_TO_TABLE(HT_DCPERIOD),
   ADD_TO_TABLE(HT_DCPHASE),
   ADD_TO_TABLE(HT_PHASOR),
   ADD_TO_TABLE(HT_SINE),
   ADD_TO_TABLE(HT_TRENDLINE),
   ADD_TO_TABLE(HT_TRENDMODE),
   NULL
};


/* Do not modify the following line. */
const unsigned int TA_DEF_TableHSize =
              ((sizeof(TA_DEF_TableH)/sizeof(TA_FuncDef *))-1);


/****************************************************************************
Ejemplo n.º 19
0
DEF_FUNCTION( DX,                           /* name */
              TA_GroupId_MomentumIndicators,   /* groupId */
              "Directional Movement Index", /* hint */
              NULL,                         /* helpFile */
              TA_FUNC_FLG_UNST_PER,         /* flags */
              NULL                          /* analysis function */
             );
/* DX END */

/****************************************************************************
 * Step 3 - Add your TA function to the table.
 *          Order is not important. Must be NULL terminated.
 ****************************************************************************/
const TA_FuncDef *TA_DEF_TableD[] =
{
   ADD_TO_TABLE(DEMA),
   ADD_TO_TABLE(DX),
   NULL
};


/* Do not modify the following line. */
const unsigned int TA_DEF_TableDSize =
              ((sizeof(TA_DEF_TableD)/sizeof(TA_FuncDef *))-1);


/****************************************************************************
 * Step 4 - Make sure "gen_code" is executed for generating all other
 *          source files derived from this one.
 *          You can then re-compile the library as usual and you are done!
 ****************************************************************************/