Data Source Default value

Created at 07 Jan 2015, 18:03
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!
bachapk's avatar

bachapk

Joined 20.03.2014

Data Source Default value
07 Jan 2015, 18:03


Hi

Can we set default value for Data Series in the input variables. It is always "Close" value when we see parameters of cBot. I want the default value can be any in "Close, High, Open, Low". I am trying it as follow:

[Parameter("Data Source", DefaultValue = MarketSeries.High)]
        public DataSeries TRENDSource { get; set; }

It give following compile time error: 

Error CS0120: An object reference is required for the non-static field, method, or property 'cAlgo.API.Internals.MarketSeries.High.get'

Any help?

Regards

Bacha


@bachapk
Replies

Spotware
09 Jan 2015, 16:05

Can we set default value for Data Series in the input variables

Unfortunately, it is not possible. As a workaround you can create a string parameter. In OnStart method you can check if value is "Open" then take MarketSeries.Open, if value is "Close" - MarketSeries.Close, etc. You can also specify default value for string parameter.


@Spotware