Peak Oscillator Coding Problem

#1
Requesting all the coding exeprts to help me in coding following indicator .

Actually I am testing the concept used by kase cynthia energy trading.

Like to make peak oscillator for RSI. I have to calculate today's RSI for 8 to 64 days. and plot the highest value of RSI for days ranging from 8 to 64.

Example :

Today I calculate RSI value for 8 days then 9 days upto 64 days.
But I want to plot only the highest value of RSI you get for 8 to 64 days.

I hope experts can undertstand wht I need..

This kind of oscillator catch the market turning poing very well.

Thanks
Ashvin
 
#4
Hi,

I want to devlope one indicator in metastock.

First I want to calculate:

RSI(5 period),
RSI(6 period),
RSI(7 period),
.....
.....
.....
.....

till
RSI(64 period),

Then plot highest value of RSI from above calculated values of rsi for period 5 to 64.

I hope experts will understand my need.
 
D

darsh_goswami

Guest
#5
Hi,

I want to devlope one indicator in metastock.

First I want to calculate:

RSI(5 period),
RSI(6 period),
RSI(7 period),
.....
.....
.....
.....

till
RSI(64 period),

Then plot highest value of RSI from above calculated values of rsi for period 5 to 64.

I hope experts will understand my need.
I dont find any need of such indicator but can be done with the use of arrays. but its going to be very complicated even. I hope Oxy can help u better.

Regards,..
Darsh
 

dhakkan

Active Member
#6
**** Did not noticed this is a MS thread... Sorry

Hi... may be this is what u are looking for in AFL... :) please correct me.
(sorry I dont know MS)

rrsi = 0;
trsi = 0;
for ( i = 5; i < 65; i ++ )
{
trsi = RSI(i);
rrsi = IIf(trsi>rrsi,trsi,rrsi);
}

Graph1 = rrsi; Graph1Style = 5; Graph1Color = colorRed;
 
Last edited:
#8
The following would plot the highest rsi from 5-64 periods. Note that it could be plotting different period rsi for each bar (highest at that bar). Just check out if this is what you wanted. RSI calculations are slow in MS as I have noticed. Also, with more ifs in a line, this could be shortened, but clarity may be lost. The dotted lines will have to be filled in with consecutive rsi periods till you reach the end.

tx:=if(rsi(5) > rsi(6), rsi(5), rsi(6));
tx:=if(tx > rsi(7), tx, rsi(7));
tx:=if(tx > rsi(8), tx, rsi(8));
..............
..............
..............
tx:=if(tx > rsi(64), tx, rsi(64));
tx
 
#9
Hi,

I tried coding with below mentioned method but it gives me the error "too many numeric constants defined in formula".

Please advise.



The following would plot the highest rsi from 5-64 periods. Note that it could be plotting different period rsi for each bar (highest at that bar). Just check out if this is what you wanted. RSI calculations are slow in MS as I have noticed. Also, with more ifs in a line, this could be shortened, but clarity may be lost. The dotted lines will have to be filled in with consecutive rsi periods till you reach the end.

tx:=if(rsi(5) > rsi(6), rsi(5), rsi(6));
tx:=if(tx > rsi(7), tx, rsi(7));
tx:=if(tx > rsi(8), tx, rsi(8));
..............
..............
..............
tx:=if(tx > rsi(64), tx, rsi(64));
tx
 
#10
Try splitting it into 2. That is, create an indicator upto RSI(40), and call it, say,
RSIPk440.
Create another indicator, say, RSIPk464, as follows :
tx:=Fml("RSIPk440");
if(tx > rsi(41), tx, rsi(41));
if(tx > rsi(42), tx, rsi(42));
..............
..............
..............
if(tx > rsi(64), tx, rsi(64));
tx

Now, plot this indicator RSIPk464. It should work, well, hopefully.
 

Similar threads