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

Created at 07 Mar 2021, 18:50
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!
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

PanagiotisCharalampous
08 Mar 2021, 09:08

Hi maxdelater,

Can you provide the complete cBot/Indicator code?

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous