Skip to content

ParameterAttribute constructor

constructor · ParameterAttribute · cAlgo.API

DesktopCLICloud

Initializes a new ParameterAttribute instance and sets the name.

Overloads

Signature Description
ParameterAttribute(string name) Initializes a new ParameterAttribute instance and sets the name.
ParameterAttribute() Initializes a new instance of the ParameterAttribute class.

ParameterAttribute(string name)

Initializes a new ParameterAttribute instance and sets the name.

public ParameterAttribute(string name)
ParameterAttribute(name: str)

Parameters

Name C# type Python type Description
name string str The name of the parameter.

Examples

public partial class ParameterSample : Robot
{
    protected override void OnStart()
    {
        ExecuteMarketOrder(TradeType.Buy, SymbolName, Symbol.QuantityToVolumeInUnits(VolumeInLots), "myLabel");
    }
}
def on_start(self):
    api.ExecuteMarketOrder(TradeType.Buy, api.SymbolName, api.Symbol.QuantityToVolumeInUnits(api.VolumeInLots), "myLabel")
{
  "AccessRights": "None",
  "Parameters": [
    {
      "Name": "VolumeInLots",
      "DisplayName": "Volume (Lots)",
      "Type": "Double",
      "DefaultValue": 0.01
    }
  ]
}

ParameterAttribute()

Initializes a new instance of the ParameterAttribute class.

public ParameterAttribute()
ParameterAttribute()

Examples

public partial class ParameterSample : Robot
{
    protected override void OnStart()
    {
        Print("MaPeriod: {0}", MaPeriod);
    }
}
def on_start(self):
    api.Print(f"MaPeriod: {api.MaPeriod}")
{
  "AccessRights": "None",
  "Parameters": [
    {
      "Name": "MaPeriod",
      "Type": "Integer",
      "DefaultValue": 14
    }
  ]
}