Data Source Default value
Created at 07 Jan 2015, 18:03
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
Spotware
09 Jan 2015, 16:05
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