> ## Documentation Index
> Fetch the complete documentation index at: https://docs-indicators.deepcharts.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Parameters, colors and alerts

> The settings of an indicator, the colors of the theme, messages for the user.

## Parameters

Every public property of the indicator with a getter and a setter is a parameter. Deepdom shows it in the settings window and saves it with the workspace.

```csharp theme={null}
[Category("General")]
[DisplayName("Minimum volume")]
[VolCustom(CategoryIndex = 0, PropertyIndex = 0, MinValue = 0, MaxValue = 100000, IncrementValue = 1)]
public int MinVolume { get; set; } = 0;
```

The initial value of the property is the default of the parameter.

| Type | Shown as |
| - | - |
| `bool` | switch |
| `int`, `long`, `double`, `decimal` | number |
| `string` | text |
| an `enum` | list of its values |
| `ColorRef` | color picker |
| a class with public properties | a group of parameters. Always give it an instance as initial value |

Three attributes control how a parameter appears:

* `[Category("General")]` from `System.ComponentModel` puts it in a section.
* `[DisplayName("Minimum volume")]` gives it a label. Without it, the name of the property is used.
* `[VolCustom(...)]` from `VolumetricaControls` sets the order and the limits.

| Value of `VolCustom` | Meaning |
| - | - |
| `CategoryIndex` | order of the section |
| `PropertyIndex` | order inside the section |
| `SubCategory` | a group inside the section |
| `MinValue`, `MaxValue`, `IncrementValue` | limits and step of a number |
| `DecimalPosToShow` | decimals shown for a number |
| `IsVisible` | `false` hides the parameter |
| `EnableTransparent` | a color can be transparent |

A property without a public setter is not a parameter, and fields are never parameters: keep the state of the calculation in fields.

> [!NOTE]
>
> The names of the properties are what the workspace saves. Renaming a property loses the value the user saved for it.

The parameters are set before `OnSet`. When the user changes one, the chart calls `OnSet` again and loads the indicator again, so the calculation never has to watch for changes.

## Colors

Colors are of type `ColorRef`, from `VolumetricaAPI.Chart`. A color parameter, the color of a series, of a point or of an annotation: every color is a `ColorRef`. The `Color` type of WPF is not available to an indicator.

```csharp theme={null}
ColorRef orange = ColorRef.FromRgb(255, 165, 0);
ColorRef halfRed = ColorRef.FromArgb(128, 255, 0, 0);
ColorRef named = ColorRef.Yellow;
ColorRef faint = BoxColor.WithOpacity(25);   // transparency, 0 (invisible) to 255 (solid)
```

### Theme colors

Deepdom has a light and a dark theme, and each has its own green, red, bid and ask. A theme color is a reference the chart resolves with the theme of the user, so the indicator looks right on every theme. Use theme colors as the defaults of the color parameters:

```csharp theme={null}
[Category("Colors")]
public ColorRef AskColor { get; set; } = IMethodAPI.GetColorRefForTheme(ColorReferenceEnum.Ask, ColorTypeEnum.Fill);
```

`ColorReferenceEnum` says what the color means (`Ask`, `Bid`, `Up`, `Down`, `Neutral`, `Volume`, `Container`, `Border`), `ColorTypeEnum` what it is used for (`Stroke`, `Fill`, `Text`). Both are in `VolBookAPI.Structure`. The chart gives these references the color of the current theme before every `OnSet`: the indicator just uses the property.

## Alerts

An indicator can warn the user with a message, a sound or a spoken text:

```csharp theme={null}
Vbk.ShowMessage($"Buy {Vbk.FormatVolume(size)} at {price}", Vbk.SymbolName);
Vbk.PlayAlert(alertName);
Vbk.PlayVoice("Large buy");
```

* Call them **only in realtime**. Every calculation method receives `isRt`: during the history it is `false`, and an alert there would fire once for every past event.
* Fire once per event. A condition which stays true is evaluated again at every update: remember that you already alerted for it.

```csharp theme={null}
if (isRt && AlertEnabled)
    Vbk.ShowMessage(text, Vbk.SymbolName);
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.