HomeReady-2-GoPortfolioRankingScreenerStockETFToolsCommunityHelp
ForumsEmail UserPollsFeature RequestsGroups


  Index  | Recent Threads  | Who's Online  | User List  | Search
  Search  
Quick Go »
Thread Status: Normal
Total posts in this thread: 3
[Request a Feature] [Post new Thread]
[Add To My Favorites] [Watch this Thread]
Author
Previous Thread This topic has been viewed 674 times and has 2 replies Next Thread
theilman
Advanced Member


UNITED STATES
Joined: Dec 5, 2007
Posts: 296
Status: Offline

Debug Formula Reply to this Post
Reply with Quote

Like to ask for the group's help. I am attempting to implement the TSI formula. Here is my code:

SMA(100,0,SMA(10,0,(Abs(Close(0) - Close(10))) / ATR(10,0)))

When I try to run it as a buy rule I get an error "SMA invalid series." Advice on what is wrong greatly appreciated. Thanks.

Ted
[Oct 8, 2010 7:49:50 AM] Show Post Printable Version     [Link] Report threaten post: please login first  Go to top 
strader1
Advanced Member


UNITED STATES
Joined: Aug 20, 2006
Posts: 275
Status: Offline

Re: Debug Formula Reply to this Post
Reply with Quote

theilman:

Hi. My memory of the correct syntax for the SMA function is:

SMA(<length> [, < offset>, <series>] ). <series> must be:


"You can use the function GetSeries (in MISC) to use the price series of a different stock or ETF, or you can use one of these constants

Id Description Frequency
#Close Stock's closing prices Daily
#Open Stock's opening prices Daily
#High Stock's high prices Daily
#Low Stock's low prices Daily
#Equity The Portfolio/Sim total value Daily
#Bench Current benchmark closing prices Daily
#TNX 10Y Treasury Note Daily
#SPRP SP500 Risk Premium Weekly starting 3/31/01
#SPEPSCY SP500 EPS CurrentY Weekly starting 3/31/01
#SPEPSNY SP500 EPS NextY Weekly starting 3/31/01
#SPEPSTTM SP500 EPS Trailing 12 months Weekly starting 3/31/01
#SPYield SP500 Yield Weekly starting 3/31/01

For example by setting the 'series' parameter to #Bench, these functions will operate on the benchmark in use. For example to only buy stocks when the 50 bar simple moving average of the benchmark is above the 200 bar average, enter the following Buy Rule:

SMA(50,0,#Bench) > SMA(200,0,#Bench)

NOTES:

The #Bench series is only available in Buy/Sell Rules and the Screener.
When this function is evaluated in the past it reverses out future splits (if any).
VMA cannot be used with the additional series."

(Source: P123 documentation).

From the above it's clear SMA is not an allowed series; hence the error.

-- Bill
[Oct 9, 2010 3:02:12 AM] Show Post Printable Version     [Link] Report threaten post: please login first  Go to top 
theilman
Advanced Member


UNITED STATES
Joined: Dec 5, 2007
Posts: 296
Status: Offline

Re: Debug Formula Reply to this Post
Reply with Quote

Thanks, kind of what I was suspecting.

Ted
[Oct 11, 2010 8:47:03 AM] Show Post Printable Version     [Link] Report threaten post: please login first  Go to top 
[Show Thread Printable Version] [Post new Thread]

Free Trial  /  Log In
Username or Email
Password
Stay logged in
Can't remember username or password?