How to accept several different options in a parameter

Created at 26 Feb 2015, 13:25
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
CP

cprcrack

Joined 15.02.2015

How to accept several different options in a parameter
26 Feb 2015, 13:25


Hi, I want to define an input parameter for my Robot, such as:

[Parameter("Quantity (lots):", DefaultValue = 0.01, MinValue = 0.01, Step = 0.01, MaxValue = 1.0)]
public double Quantity { get; set; }

However I want to allow only 3 different options, and I want them to have a name. I have tried the following but the parameter doesn't show up in cTrader/cAlgo:

public enum Mode
{
    Silly,
    Smart,
    Brilliant
}

[Parameter("Mode:", DefaultValue = Mode.Brilliant)]
public Mode SelectedMode { get; set; }

Is there any other alternative to make this work? I suppose there is a way, because you use it yourselves for selecting a Timeframe for every bot (dropdown list with t1, m1, h1...).

If not, could you add support for this? It would be very useful in my opinion.


@cprcrack
Replies

Spotware
27 Feb 2015, 15:03

Currently enum parameters are not supported. We plan to support them in the future.


@Spotware

xjacks
27 Nov 2017, 10:39

RE:

Spotware said:

Currently enum parameters are not supported. We plan to support them in the future.

The year 2017 almost end and the enum parameters are still not supported...


@xjacks

FMogyi
27 Jan 2019, 13:14

Now 2019 and the enum parameters are still not supported...


@FMogyi

PanagiotisCharalampous
28 Jan 2019, 12:59

Hi FMogyi,

Hopefully enum parameters are coming in v3.5 which will be released on Spotware Beta in the following weeks.

Best Regards,

Panagiotis


@PanagiotisCharalampous

ZuniSoft
30 Apr 2020, 21:56

RE:

Spotware said:

Currently enum parameters are not supported. We plan to support them in the future.

then how can I implement a dropdown feature, multiple options in a parameter.


@ZuniSoft