coding for a sector closing price

Questions directed to our Support Team. Responses can be expected within 24 hours.

coding for a sector closing price

Postby jawfiaa » Wed Jul 23, 2014 6:04 am

Hello Pete,

I am trying to code for a sector in such a way that I want to select stocks when the market is down the previous day by a certain percentage. so I put the following script :
sector ( “NYSE”, close ) < ref(sector( “NYSE”, close ),-1)*@percent

it didn't work and generated error of undefined formula. So I tried same concept but using the symbol reference formula:
symbol ( SP-500, close ) < ref(symbol ( SP-500, close ),-1)*@perecnt

And that didn't work too.

Can you please help me why I am getting this error and/or if there is another way I can code for this ?

Thank you !
jawfiaa
 
Posts: 7
Joined: Tue Jun 03, 2014 12:41 am

Re: coding for a sector closing price

Postby Overload » Wed Jul 23, 2014 9:18 am

The problem may be in that little space you have between 'sector' and the opening parenthese. It appears the interpreter doesn't like that. Try this instead:

Code: Select all
sector( "NYSE", close ) < ref(sector( "NYSE", close ),-1)*@percent

As an efficiency tip, a sector() or symbol() formula should always be on the outside of all other formulas. In general this will make those formulas run faster. So this would be a better way to code it:

Code: Select all
sector( "NYSE", close ) < sector( "NYSE", ref(close, -1))*@percent

In your post, I also noticed that your sector name is wrapped in a left-quote and a right-quote. That might also be an issue, since StrataSearch generally expects a standard quotation mark. They are different. But that might be something to explore if removing the space between 'sector' and the opening parenthese doesn't solve it for you.

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

Re: coding for a sector closing price

Postby jawfiaa » Thu Jul 24, 2014 4:53 am

Thanks a lot Pete !

The problem is solved by taking the spaces you mentioned:

sector("NYSE", close) < ref(sector("NYSE", close), -1)*@percent
jawfiaa
 
Posts: 7
Joined: Tue Jun 03, 2014 12:41 am


Return to Technical Support

cron