AddOptionValue

Adds a possible value for an enum-type option.

Syntax

AddOptionValue(name: string, value: string): void

Parameters

  • name - A string containing the name of the option to add a value to.

  • value - A string containing the value to add to the option.

Description

The AddOptionValue method adds a possible value for an enum-type option. This is used to define the possible values that users can select for an enum option in an indicator or strategy.

This method is typically used after registering an option with the RegOption method using the TOptionType.ENUM_TYPE type. See TOptionType for more information on option types.

Example

// Register an MA Type option
this.api.RegOption("MA Type", TOptionType.ENUM_TYPE, 0);

// Add possible values for the MA Type option
this.api.AddOptionValue("MA Type", "Simple");
this.api.AddOptionValue("MA Type", "Exponential");
this.api.AddOptionValue("MA Type", "Smoothed");
this.api.AddOptionValue("MA Type", "Weighted");

Last updated