Skip to content

Assets.GetAsset

method · Assets · cAlgo.API

DesktopCLICloud

Gets the asset.

Definition

Asset GetAsset(string assetName)
api.Assets.GetAsset(assetName: str) -> Asset

Parameters

Name C# type Python type Description
assetName string str Name of the asset you want to get

Returns Asset — Asset

Examples

var gold = Assets.GetAsset("XAU");
if (gold != null)
    Print("{0} has {1} digits", gold.Name, gold.Digits);
gold = api.Assets.GetAsset("XAU")
if gold is not None:
    api.Print(f"{gold.Name} has {gold.Digits} digits")