Skip to content

AlgoInstanceParameter

Summary

The interface representing an indicator / robot instance parameter. Provides properties that allow for accessing various information about an algo instance parameter.

Signature

1
public abstract interface AlgoInstanceParameter

Namespace

cAlgo.API

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
 [Robot(AccessRights = AccessRights.None)]
 public class Test : Robot
 {
     protected override void OnStart()
     {
         var chartIndicator = Chart.Indicators.Add("Simple Moving Average");
         foreach (var parameter in chartIndicator.Parameters)
         {
             Print($"Name: {parameter.Name} | DisplayName: {parameter.DisplayName} | Value: {parameter.Value} | Type: {parameter.Type}");
         }
     }
 }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
 [Robot(AccessRights = AccessRights.None)]
 public class Test : Robot
 {
     protected override void OnStart()
     {
         var chartRobot = Chart.Robots.Add("Sample Break Even");
         foreach (var parameter in chartRobot.Parameters)
         {
             Print($"Name: {parameter.Name} | DisplayName: {parameter.DisplayName} | Value: {parameter.Value} | Type: {parameter.Type}");
         }
     }
 }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
 import clr
 clr.AddReference("cAlgo.API")
 # Import cAlgo API types
 from cAlgo.API import *
 # Import trading wrapper functions
 from robot_wrapper import *
 class Test():
     def on_start(self):
         chartIndicator = api.Chart.Indicators.Add("Simple Moving Average")
         for parameter in chartIndicator.Parameters:
             print(f"Name: {parameter.Name} | DisplayName: {parameter.DisplayName} | Value: {parameter.Value} | Type: {parameter.Type}")
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
 import clr
 clr.AddReference("cAlgo.API")
 # Import cAlgo API types
 from cAlgo.API import *
 # Import trading wrapper functions
 from robot_wrapper import *
 class Test():
     def on_start(self):
         chartRobot = api.Chart.Robots.Add("Sample Break Even")
         for parameter in chartRobot.Parameters:
             print(f"Name: {parameter.Name} | DisplayName: {parameter.DisplayName} | Value: {parameter.Value} | Type: {parameter.Type}")

Properties

Name

Summary

Gets the name of a parameter.

Signature

1
public abstract string Name {get;}

Return Value

string

DisplayName

Summary

Gets the display name of a parameter (shown in the 'Parameters' section of an instance).

Signature

1
public abstract string DisplayName {get;}

Return Value

string

Value

Summary

Gets the value of a parameter.

Signature

1
public abstract object Value {get; set;}

Return Value

object

Type

Summary

Gets the ALgoParameterType of a parameter.

Signature

1
public abstract AlgoParameterType Type {get;}

Return Value

AlgoParameterType