RelativeStrengthIndex.Result.Last(0) does not return a value.

Created at 07 Mar 2021, 18:50
MA

maxdelater

Joined 03.09.2020

RelativeStrengthIndex.Result.Last(0) does not return a value.
07 Mar 2021, 18:50


 

        [Parameter("RSI period", DefaultValue = 14)]
        public int RSIperiod { get; set; }

        public DataSeries SourceRSI { get; set; }

        private RelativeStrengthIndex RSI { get; set; }

        Print("RSI = " + RSI.Result.Last(0));

        And in my log it prints:


Crashed in Calculate with NullReferenceException: Object reference not set to an instance of an object. ( x like 1000)
and then it says: RSI = NaN

Does anyone els have this problem, or does someone know if there is a solution?


@maxdelater
Replies

... Deleted by UFO ...

PanagiotisCharalampous
11 Mar 2021, 12:03

Hi maxdelater,

Can you share the complete cBot code?

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous