need help to insert PolynomialRegressionChannels in my bot

Created at 20 Jan 2021, 19:49
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

darksammo

Joined 20.01.2021

need help to insert PolynomialRegressionChannels in my bot
20 Jan 2021, 19:49


Hi all can anyone help me to correctly insert this indicator into my bot?

This is the cbot code

        [Parameter("PRC Degree", DefaultValue = 3.0, MinValue = 1, MaxValue = 4)]
        public int degree { get; set; }

        [Parameter("PRC Period Short", DefaultValue = 30)]
        public int period { get; set; }

        [Parameter("PRC Standard Deviation 1", DefaultValue = 1.6)]
        public double strdDev { get; set; }
        
        [Parameter("PRC Standard Deviation 2", DefaultValue = 2)]
        public double strdDev2 { get; set; }

        [Output("PRC", LineColor = "#7E68D0F7", LineStyle = LineStyle.Lines)]
        public IndicatorDataSeries prc { get; set; }

        [Output("SQH", LineColor = "#7E68D0F7", LineStyle = LineStyle.Lines)]
        public IndicatorDataSeries sqh { get; set; }

        [Output("SQL", LineColor = "#7E68D0F7", LineStyle = LineStyle.Lines)]
        public IndicatorDataSeries sql { get; set; }
        #endregion

        private string botName;
        private string instanceLabel;
        private double stopLoss;
        private PRC newprc;

        protected override void OnStart()
        {
            botName = ToString();
            instanceLabel = botName + "-" + Symbol.Name + "-" + TimeFrame.ToString();
            newprc = Indicators.PolynomialRegressionChannels(degree, period, strdDev, strdDev2);

        }

@darksammo
Replies

firemyst
21 Jan 2021, 05:14 ( Updated at: 21 Jan 2021, 05:15 )

From the code you provided above, you need to do two things:

 

1) remove #endregion as there's no corresponding #region tag

2) Change the line

private PRC newprc;

 to

private PolynomialRegressionChannels newprc;

because there is no "PRC" object type defined in your code.


@firemyst

darksammo
21 Jan 2021, 08:44

RE:

firemyst said:

From the code you provided above, you need to do two things:

 

1) remove #endregion as there's no corresponding #region tag

2) Change the line

private PRC newprc;

 to

private PolynomialRegressionChannels newprc;

because there is no "PRC" object type defined in your code.

Hi Firemyst thanks for the reply

i do it and get this error

Error CS0246: The type or namespace name 'PolynomialRegressionChannels' could not be found; probably missing a using directive or assembly reference


@darksammo

firemyst
21 Jan 2021, 09:04 ( Updated at: 21 Dec 2023, 09:22 )

Have you included all the necessary directives and assembly references?

It works perfectly for me:


@firemyst