Default Parameter value

Created at 05 Sep 2017, 21:33
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!
DA

davidp13

Joined 06.05.2014

Default Parameter value
05 Sep 2017, 21:33


Hi. Does anyone know it the following is possible and if so what is the correct code?

         [Parameter("Input Signal Filename", DefaultValue = "C:\\Usersxxx\\Signals\\" + Account.Number + ".csv")]
        public string SignalFilename { get; set; }

Basically Im trying to automatically add the account number to the parameter.

Thanks


@davidp13
Replies

Spotware
06 Sep 2017, 09:55

Dear davidp13,

This is not possible. A solution to this would be to initialize the parameter in the OnStart() method as shown below

        protected override void OnStart()
        {
            SignalFilename = "C:\\Usersxxx\\Signals\\" + Account.Number + ".csv";
        }

Let us know if the above solves your problem.

Best Regards,

cTrader Team


@Spotware