Skip to content

AlgoParameter

Summary

Represents an algorithm parameter.

Signature

1
public abstract interface AlgoParameter

Namespace

cAlgo.API

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
 [Robot(AccessRights = AccessRights.None)]
 public class TestExample : Robot
 {
     protected override void OnStart()
     {
         if (AlgoRegistry.Get("Simple Moving Average", AlgoKind.StandardIndicator) is not IndicatorType smaIndicatorType)
             return;
         foreach (var parameter in smaIndicatorType.Parameters)
         {
             Print($"Name: {parameter.Name} | DefaultValue: {parameter.DefaultValue} | Type: {parameter.Type}");
         }
     }
 }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
 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):
         indicatorType = api.AlgoRegistry.Get("Simple Moving Average", AlgoKind.StandardIndicator)
         if indicatorType is None:
             return
         for parameter in IndicatorType(indicatorType).Parameters:
             print(f"Name: {parameter.Name} | DefaultValue: {parameter.DefaultValue} | Type: {parameter.Type}")

Properties

Name

Summary

Gets Parameter name.

Signature

1
public abstract string Name {get;}

Return Value

string

Type

Summary

Gets parameter type.

Signature

1
public abstract AlgoParameterType Type {get;}

Return Value

AlgoParameterType

DefaultValue

Summary

Gets default value of the parameter.

Signature

1
public abstract object DefaultValue {get;}

Return Value

object