RSI was <30 in the last 30 periods

Created at 01 Oct 2017, 14:30
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!
irmscher9's avatar

irmscher9

Joined 22.12.2016

RSI was <30 in the last 30 periods
01 Oct 2017, 14:30


Hey :)

What's the best method to check if RSI was lower than 30 in any of the last 30 periods?

 

Thanks


@irmscher9
Replies

irmscher9
01 Oct 2017, 14:35

I made this:

https://www.dropbox.com/s/pen17ams589ck9j/Screenshot%202017-10-01%2014.31.02.png?dl=0

but it seems doesn't work properly...


@irmscher9

irmscher9
01 Oct 2017, 14:37

it's bool like this:

https://www.dropbox.com/s/bpesx4gd0m2ixih/Screenshot%202017-10-01%2014.34.37.png?dl=0


@irmscher9

PanagiotisCharalampous
02 Oct 2017, 09:55

Hi irmscher9,

A more elegant way to do that is the following

            var rsi = Indicators.RelativeStrengthIndex(MarketSeries.Close, 14);
            bool under30 = rsi.Result.Minimum(30) < 30;           

Let me know if this works for you.

Best Regards,

Panagiotis

 


@PanagiotisCharalampous

irmscher9
02 Oct 2017, 11:44

Oh, thanks for prompt reply Panagiotis :)


@irmscher9

irmscher9
10 Oct 2017, 17:09

And what if I would like to figure out how many periods ago RSI was under 30 mark?


@irmscher9

PanagiotisCharalampous
10 Oct 2017, 17:19

Hi irmscher9,

Try the following

            int periords = 0;
            var rsi = Indicators.RelativeStrengthIndex(MarketSeries.Close, 14);
            for (int i = rsi.Result.Count - 1; i >= 0; i--)
            {
                if (rsi.Result[i] < 30)
                {
                    Print("RSI was under 30 " + periords + " perions ago");
                    break;
                }
                else
                    periords++;
            }

Best Regards,

Panagiotis


@PanagiotisCharalampous

irmscher9
10 Oct 2017, 21:44

Thanks a lot! :)

Support is awesome! Where can I leave a review for cTrader and cAlgo software?


@irmscher9

PanagiotisCharalampous
11 Oct 2017, 09:39

Dear irmscher9,

Thanks for your nice words:) If you google "cTrader Review" you will find many reviews of cTrader where you can share your opinion. However the best feedback for us is to see satisfied users of our products.

Best Regards,

Panagiotis


@PanagiotisCharalampous