Indicator does not work on new version

Created at 19 Dec 2022, 12:10
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!
JO

JoaoMGH

Joined 24.10.2020

Indicator does not work on new version
19 Dec 2022, 12:10


Hi.

On the older versions of Ctrader i had this indicator, it worked fine, now it crashes, can you guys explain why??? please.

Many thanks

Here is the code, it's quite simple:

 

  private Supertrend SUP;
        protected override void Initialize()
        {
            SUP = Indicators.Supertrend(6, 3);
        }

        public override void Calculate(int index)
        {
            var SUPdn = SUP.DownTrend.LastValue;
            var SUPup = SUP.UpTrend.LastValue;             

                Chart.DrawRectangle("Recta", index - 2, SUPup + 0.0015, index + 2, SUPup, Color.DarkGreen, 2, LineStyle.Lines);
                Chart.DrawRectangle("Recta2", index - 2, SUPdn - 0.0015, index + 2, SUPdn, Color.DarkRed, 2, LineStyle.Lines);

 


@JoaoMGH