Assets
interface cAlgo.API
DesktopCLICloud
Represents the list of all the assets with the asset names as string values.
Definition
public interface Assets
Namespace: cAlgo.API · Group: Assets
Examples
Example 1
foreach (var assetName in Assets)
{
var asset = Assets.GetAsset(assetName);
Print("Asset Name: {0} | Asset Digits: {1} | Is Deposit Asset: {2}", asset.Name, asset.Digits, asset.Name == Account.Asset.Name);
}
for assetName in api.Assets:
asset = api.Assets.GetAsset(assetName)
api.Print(f"Asset Name: {asset.Name} | Asset Digits: {asset.Digits} | Is Deposit Asset: {asset.Name == api.Account.Asset.Name}")
Example 2
var eur = Assets.GetAsset("EUR");
var usd = Assets.GetAsset("USD");
if (eur != null && usd != null)
Print("1 EUR is {0} USD", eur.Convert(usd, 1));
eur = api.Assets.GetAsset("EUR")
usd = api.Assets.GetAsset("USD")
if eur is not None and usd is not None:
api.Print(f"1 EUR is {eur.Convert(usd, 1)} USD")
Methods
| Name | Description |
|---|---|
ExistsDesktopCLICloudbool | Defines if the specific asset exists. |
GetAssetDesktopCLICloudAsset | Gets the asset. |
GetAssetsDesktopCLICloudAsset[] | Get multiple assets on a single call. |