Parameters
What Are Parameters?
How It Works
Common Parameter Types
Example
export default class CustomIndicator extends IndicatorImplementation {
// Configurable parameters
public Period!: TOptValue_number;
public ShowLabels!: TOptValue_bool;
public ApplyToPrice!: TOptValue_number;
// Internal parameter (not configurable)
public internalParameter: number = 0;
public Init(): void {
// Create parameters
this.Period = this.api.createTOptValue_number(8);
this.ShowLabels = this.api.createTOptValue_bool(true);
this.ApplyToPrice = this.api.createTOptValue_number(TPriceType.CLOSE);
// Register parameters so they show up in the UI
this.api.RegOption("Period", TOptionType.INTEGER, this.Period);
this.api.RegOption("ShowLabels", TOptionType.BOOLEAN, this.ShowLabels);
this.api.RegOption("ApplyToPrice", TOptionType.INTEGER, this.ApplyToPrice);
}
}Key Rules
Last updated