---
id: "M:cAlgo.API.RadioButton.#ctor"
kind: "constructor"
type: "T:cAlgo.API.RadioButton"
url: "https://help.ctrader.com/ctrader-algo/references/Controls/RadioButton/Constructor/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# RadioButton constructor

Member of [RadioButton](https://help.ctrader.com/ctrader-algo/references/Controls/RadioButton/index.md).

## RadioButton()

Initializes a new instance of the Radiobutton class.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Accepted without error but never displayed, so control events such as Click are never raised.
- Cloud: Accepted without error but never displayed, so control events such as Click are never raised.

C#:

```csharp
public RadioButton()
```

Python:

```python
RadioButton()
```

### Examples

C#:

```csharp
var buyRadioButton = new RadioButton { Text = "Buy", GroupName = "Direction", IsChecked = true };
var sellRadioButton = new RadioButton { Text = "Sell", GroupName = "Direction" };
var panel = new StackPanel { Orientation = Orientation.Horizontal };
panel.AddChild(buyRadioButton);
panel.AddChild(sellRadioButton);
Chart.AddControl(panel);
```

Python:

```python
buyRadioButton = RadioButton()
buyRadioButton.Text = "Buy"
buyRadioButton.GroupName = "Direction"
buyRadioButton.IsChecked = True
sellRadioButton = RadioButton()
sellRadioButton.Text = "Sell"
sellRadioButton.GroupName = "Direction"
panel = StackPanel()
panel.Orientation = Orientation.Horizontal
panel.AddChild(buyRadioButton)
panel.AddChild(sellRadioButton)
api.Chart.AddControl(panel)
```

