Skip to content

GetAsset Method

GetAsset

Summary

Gets the asset.

Signature

1
public abstract Asset GetAsset(string assetName)

Parameters

Name Type Description
assetName string Name of the asset you want to get

Return Value

Asset

Declaring Type

cAlgo.API.Assets

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
 using cAlgo.API;
 namespace cAlgo.Robots
 {
     [Robot(AccessRights = AccessRights.None)]
     public class NewcBot2 : Robot
     {
         protected override void OnStart()
         {
             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);
             }
         }
     }
 }

Last update: January 30, 2023