Multiple arrays storing values

Hi All
Greetings

This is my first post so please ignore any stupid questions

Here is what I have

I have an afl which has rsi(x), demarker(y) and demarker(z) xyz are periods
I store price using valuewhen function.
At certain point during trading they all three reach their peak like rsi to 100 dem to 100 and dem y to 100 and vice versa like rsi to 0 dem to 0 dem y to 0

I want to create arrays which looks back at last 20 such instances where these three had same price value and store them in CCI now here comes the tricky part
if in next bar the price goes up from previous bar then the value of change to added to cci and if it goes down then the value of cci should be substraced by value of change in cci from previous bar
I want to repeat this for next 6 bars and plot the avg % of change of all last 20 instances
same when all three rsi dem1 dem2 goes to bottom
I want to plot the avg of last 20 instances

Thanks in advance
regards

photo_2021-07-12_13-25-26
photo_2021-07-14_12-37-15
these are the images which I get when the rsi , dem , dem2 reaches its peak or bottom

hope it helps in understanding my issue

Anyone? Any hint? Any path finder?
Please guide

@moneyspinners , I guess nobody answered because the description, which is probably clear to you, is difficult to understand or ambiguous for other forum users.

I suggest you try to describe your goal better: in particular, if text and images are not enough, you could create a sample Excel file as I have suggested in this post.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.