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