Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Formulas returning Not Enough Data error Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Constellation
Posted : Wednesday, February 23, 2011 6:24:31 PM
Registered User
Joined: 2/7/2006
Posts: 27
Hello, I am trying to use PCFs to calculate averages, and I'm getting some errors with stocks that have existed for much longer than the time period that I'm requesting.

For the stock ABCD, I want to calculate its XAVG. I can calculate AVG(RSI60.15,60) which returns 52.45, but calculating XAVG(RSI60.15,60) returns "not enough data to calculate." Note that this stock has existed for longer than 60 days.

Also on this stock, calculating AVG(BOP10,60) returns a value of 8.89, but calculating XAVG(BOP10,60) results in the error.

Suggestions would be appreciated.
Constellation
Posted : Wednesday, February 23, 2011 6:25:30 PM
Registered User
Joined: 2/7/2006
Posts: 27
PS this is in TC2007
diceman
Posted : Wednesday, February 23, 2011 7:10:53 PM
Registered User
Joined: 1/28/2005
Posts: 6,049

XAVG requires more data than its length.
( just use stocks with more data)

Thanks
diceman

Constellation
Posted : Wednesday, February 23, 2011 7:18:21 PM
Registered User
Joined: 2/7/2006
Posts: 27
That may be true, but then how is TC2007 calculating these same numbers when I display them on a chart as RSI(60,15) (explonential) and applying an exponential moving average to BOP? If they can be displayed on a chart, they should be something that TC2007 can calculate in a PCF.
Bruce_L
Posted : Thursday, February 24, 2011 9:30:32 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Constellation,
The number of Bars of data used to calculated an Exponential Moving Average as part of a Personal Criteria Formula is the Period of the EMA times 5. This was chosen arbitrarily as "enough" Bars to calculate an accurate EMA in the algorithm used by the PCF version of the EMA. It is a pretty good point at which to stop including older data as the weighted contribution of any older data would constitute less than 0.01% of the result and, for most symbols anyway, this means the result will not be visibly different from using more data.

The minimum number of Bars used to calculate an EMA on the Chart in TeleChart is equal to the Period of the EMA. If there are no other Indicators being calculated, this is the number of Bars which will be used to calculate the EMA on the far left of the Chart or the first EMA charted if the EMA does not Plot all the way to the left edge of the Chart. Any Bar beyond the first Plotted EMA uses an additional Bar of data to calculate the EMA.

If another Indicator is being Plotted however, the EMA on the Chart will use the same number of Bars in its calculation as is required to calculate the Indicator with the largest minimum number of Bars required for its calculations.

In comparing these, the calculations of the EMA in a PCF is probably the better choice as the minimum number of Bars required for the Chart results in the weighted contribution of the data not used in calculating the EMA possibly being almost 15%. In addition, the limited number of Bars used in the calculation exposes initialization bias into the calculations as the EMA could be initialized with the first Value being Averaged, zero or a Simple Moving Average (there are other possibilities, but these three are most likely).

While possible, it is not practical to use the exact same calculations for the Chart as for a PCF if you are going to attempt to limit the amount of data used to optimize performance. In the case of the Chart, it is most efficient to continue calculating new Values based on previous Values and in this case, the Zoom of the Chart becomes a factor, while in the case of a PCF, the Zoom would not matter.

What is possible is to create an algorithm which starts returning data immediately, that uses as at least five times the number of Bars as the period if it is available and only uses less data than that if the data is not available. It is probably not going to happen in TeleChart 2007 however as future development is focused on the TC2000.com version 11 beta.

exponential moving average

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Constellation
Posted : Thursday, February 24, 2011 2:40:33 PM
Registered User
Joined: 2/7/2006
Posts: 27
Thanks, that's helpful to know.

Is there a way to create a list of subscribed or favorite threads that attach to my profile here in the Worden forum? I'd like to mark this thread as a favorite.
Bruce_L
Posted : Thursday, February 24, 2011 2:46:34 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
You can subscribe to a topic by selecting Watch this topic near the upper right hand corner of the page.

You can view your subscriptions by selecting My profile (also near the upper right hand corner of the page) | Subscriptions.

Learn how to use the forums: post a new topic, reply, Search existing topics

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.