How to accept several different options in a parameter
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.
Replies
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
Spotware
27 Feb 2015, 15:03
Currently enum parameters are not supported. We plan to support them in the future.
@Spotware