OmniTrader Professional Forum - OmniLanguage Discussion
OL error using GetClose()

^ Top
kmcintyre

Posts: 132

Joined: 9/12/2007
Location: Valley Center, CA

User Profile
 
Subject : OL error using GetClose()
Posted : 12/26/2014 1:25 PM
Post #23246

This OL formula is giving me an error when used in a filter block

GetClose(SPY)>ZMA(GetClose(SPY),55)

I want to filter out buy signals unless the close of the SPY is above it's 55 period ZMA.

The error I get is "Index was outside the bounds of the array".

What am I doing wrong?

Thanks

Keith
^ Top
Jim Dean

Posts: 3433

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: OL error using GetClose()
Posted : 12/26/2014 3:55 PM
Post #23247 - In reply to #23246

Put the symbol name in quotes, unless you are using a declared string variable to hold it.
^ Top
roberthalljr

Posts: 13

Joined: 3/4/2007

User Profile
 
Subject : RE: OL error using GetClose()
Posted : 12/26/2014 4:04 PM
Post #23248 - In reply to #23246

Keith, you might try putting quotation marks before and after each SPY entry (eg "SPY"). Seems to work that way.
^ Top
kmcintyre

Posts: 132

Joined: 9/12/2007
Location: Valley Center, CA

User Profile
 
Subject : RE: OL error using GetClose()
Posted : 12/26/2014 6:18 PM
Post #23252 - In reply to #23247

Thanks, guys!

Keith



https://www.omnitrader.com/currentclients/proforum/thread-view.asp?threadid=4226&posts=4