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.
Return Value
This method does not return a value.
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.
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