Skip to content

Plugin.Assets

property · Plugin · cAlgo.API

DesktopCLICloud

Returns list of all available assets.

Environment behaviour

CLI — not supported. Plugins cannot run in the CLI: ctrader-cli runs cBots only.

Cloud — not supported. Plugins cannot run in the cloud: it runs cBots only.

Definition

public Assets Assets {get;}
api.Assets: Assets

Returns Assets

Examples

Print("Available assets: {0}", Assets.Count);
if (Assets.Exists("USD"))
    Print("Found asset {0}", Assets.GetAsset("USD").Name);
api.Print(f"Available assets: {api.Assets.Count}")
if api.Assets.Exists("USD"):
    api.Print(f"Found asset {api.Assets.GetAsset('USD').Name}")