---
id: "P:cAlgo.API.RadioButton.IsChecked"
kind: "property"
type: "T:cAlgo.API.RadioButton"
url: "https://help.ctrader.com/ctrader-algo/references/Controls/RadioButton/IsChecked/"
---

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

# RadioButton.IsChecked

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

## IsChecked

Defines if the radiobutton is checked.

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 bool IsChecked {get; set;}
```

Python:

```python
radioButton.IsChecked: bool
```

### Returns

`bool` — 

### Examples

C#:

```csharp
var buyRadioButton = new RadioButton { Text = "Buy", GroupName = "Direction", IsChecked = true };
Chart.AddControl(buyRadioButton);
var tradeType = buyRadioButton.IsChecked ? TradeType.Buy : TradeType.Sell;
Print("Trade direction: {0}", tradeType);
```

Python:

```python
buyRadioButton = RadioButton()
buyRadioButton.Text = "Buy"
buyRadioButton.IsChecked = True
api.Chart.AddControl(buyRadioButton)
tradeType = TradeType.Buy if buyRadioButton.IsChecked else TradeType.Sell
api.Print(f"Trade direction: {tradeType}")
```

