Relative Strength against an index

StrataSearch has many powerful features, with many techniques and approaches to explore. Here we discuss the things we've done, and the things we'd like to do.

Relative Strength against an index

Postby rjay » Mon Jan 13, 2014 11:39 am

I'm trying to filter stocks that have a positive divergence against an index over 120 days, in my case UKX.

So, far I have

diverge ( close, symbol ( UKX, close ), 0.1, 120 ) = 1

but I keep on getting an error saying that UKX does not exist. It does, so I'm guessing I need to reference $Index1, but

diverge ( close, symbol ( $Index1, close ), 0.1, 120 ) = 1

doesn't work either.
rjay
 
Posts: 116
Joined: Wed Jul 26, 2006 6:51 am

Re: Relative Strength against an index

Postby Overload » Mon Jan 13, 2014 12:40 pm

I think it is the leading space in your symbol reference. Try removing the leading space before UKX:

diverge ( close, symbol (UKX, close ), 0.1, 120 ) = 1

Pete
Overload
 
Posts: 2246
Joined: Wed Nov 30, 2005 12:14 pm

Re: Relative Strength against an index

Postby rjay » Mon Jan 13, 2014 1:22 pm

Ah, that was it, thanks Pete.

However, now that I've thought about it 'diverge' is not quite what I want.

I need to find stocks that outperformed the UKX, so that if UKX went up by 5% over the period I want to find stocks that went up by more than 5%.

What's the best formula to use for that ?
rjay
 
Posts: 116
Joined: Wed Jul 26, 2006 6:51 am

Re: Relative Strength against an index

Postby Overload » Mon Jan 13, 2014 6:05 pm

The proc() formula will give you a basic performance return for the specified period, so you could try doing something like this:

proc(close, 120) > symbol(UKX, proc(close, 120))

Pete
Overload
 
Posts: 2246
Joined: Wed Nov 30, 2005 12:14 pm


Return to General Discussion

cron