---
id: "M:cAlgo.API.Internals.IAssetConverter.Convert(System.Double,cAlgo.API.Asset,cAlgo.API.Asset)"
kind: "method"
type: "T:cAlgo.API.Internals.IAssetConverter"
url: "https://help.ctrader.com/ctrader-algo/references/MarketData/IAssetConverter/Convert/"
---

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

# IAssetConverter.Convert

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

## Convert(double value, Asset from, Asset to)

Converts an asset to another asset.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
double Convert(double value, Asset from, Asset to)
```

Python:

```python
api.AssetConverter.Convert(value: float, from: Asset, to: Asset) -> float
```

### Parameters

- `value` (`double`, Python `float`): The value you want to convert from Asset
- `from` (`Asset`, Python `Asset`): Actual or current asset of the value
- `to` (`Asset`, Python `Asset`): Target asset

### Returns

`double` — Value in to / target asset

### Examples

C#:

```csharp
var valueInQuoteAsset = AssetConverter.Convert(1000, Account.Asset, Symbol.QuoteAsset);
Print("1000 {0} is {1} {2}", Account.Asset.Name, valueInQuoteAsset, Symbol.QuoteAsset.Name);
```

Python:

```python
valueInQuoteAsset = api.AssetConverter.Convert(1000, api.Account.Asset, api.Symbol.QuoteAsset)
api.Print(f"1000 {api.Account.Asset.Name} is {valueInQuoteAsset} {api.Symbol.QuoteAsset.Name}")
```

## Convert(double value, string from, string to)

Converts an asset to another asset.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
double Convert(double value, string from, string to)
```

Python:

```python
api.AssetConverter.Convert(value: float, from: str, to: str) -> float
```

### Parameters

- `value` (`double`, Python `float`): The value you want to convert from Asset
- `from` (`string`, Python `str`): Actual or current asset of the value
- `to` (`string`, Python `str`): Target asset

### Returns

`double` — Value in to / target asset

### Examples

C#:

```csharp
var valueInJpy = AssetConverter.Convert(100, "EUR", "JPY");
Print("100 EUR is {0} JPY", valueInJpy);
```

Python:

```python
valueInJpy = api.AssetConverter.Convert(100, "EUR", "JPY")
api.Print(f"100 EUR is {valueInJpy} JPY")
```

## Convert(double value, Asset from, string to)

Converts an asset to another asset.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
double Convert(double value, Asset from, string to)
```

Python:

```python
api.AssetConverter.Convert(value: float, from: Asset, to: str) -> float
```

### Parameters

- `value` (`double`, Python `float`): The value you want to convert from Asset
- `from` (`Asset`, Python `Asset`): Actual or current asset of the value
- `to` (`string`, Python `str`): Target asset name

### Returns

`double` — Value in to / target asset

### Examples

C#:

```csharp
var balanceInUsd = AssetConverter.Convert(Account.Balance, Account.Asset, "USD");
Print("Balance in USD: {0}", balanceInUsd);
```

Python:

```python
balanceInUsd = api.AssetConverter.Convert(api.Account.Balance, api.Account.Asset, "USD")
api.Print(f"Balance in USD: {balanceInUsd}")
```

## Convert(double value, string from, Asset to)

Converts an asset to another asset.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
double Convert(double value, string from, Asset to)
```

Python:

```python
api.AssetConverter.Convert(value: float, from: str, to: Asset) -> float
```

### Parameters

- `value` (`double`, Python `float`): The value you want to convert from Asset
- `from` (`string`, Python `str`): Actual or current asset name of the value
- `to` (`Asset`, Python `Asset`): Target asset

### Returns

`double` — Value in to / target asset

### Examples

C#:

```csharp
var valueInAccountAsset = AssetConverter.Convert(500, "GBP", Account.Asset);
Print("500 GBP is {0} {1}", valueInAccountAsset, Account.Asset.Name);
```

Python:

```python
valueInAccountAsset = api.AssetConverter.Convert(500, "GBP", api.Account.Asset)
api.Print(f"500 GBP is {valueInAccountAsset} {api.Account.Asset.Name}")
```

