| Index | Recent Threads | Who's Online | User List | Search |
|
|
![]() |
Portfolio123 » List all forums » Forum: Ranking Systems and Factors/Functions » Thread: Debug Formula |
|
Total posts in this thread: 3 |
[Request a Feature]
[Post new Thread] [Add To My Favorites] [Watch this Thread] |
| Author |
|
|
theilman
Advanced Member
|
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 |
||
|
|
strader1
Advanced Member
|
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 |
||
|
|
theilman
Advanced Member
|
Thanks, kind of what I was suspecting. Ted |
||
|
| [Show Thread Printable Version] [Post new Thread] |